Message ID | 20210922084804.99060-1-colin.king@canonical.com |
---|---|
State | Accepted |
Headers | show |
Series | fwts_devicetree: clean up static analysis warning | expand |
On 2021-09-22 2:48 a.m., Colin King wrote: > From: Colin Ian King <colin.king@canonical.com> > > The variable length should be initialized to zero to clean up > an overly pedantic static analysis warning of an uninitialized > variable. > > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/lib/src/fwts_devicetree.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/lib/src/fwts_devicetree.c b/src/lib/src/fwts_devicetree.c > index 5556446c..dcd5f5f0 100644 > --- a/src/lib/src/fwts_devicetree.c > +++ b/src/lib/src/fwts_devicetree.c > @@ -265,7 +265,7 @@ int fwts_dt_stringlist_count( > const char *property) > { > const char *list, *end; > - int length, count = 0; > + int length = 0, count = 0; > > list = fdt_getprop(fdt, nodeoffset, property, &length); > if (!list) { > Acked-by: Alex Hung <alex.hung@canonical.com>
On 9/22/21 4:48 PM, Colin King wrote: > From: Colin Ian King <colin.king@canonical.com> > > The variable length should be initialized to zero to clean up > an overly pedantic static analysis warning of an uninitialized > variable. > > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/lib/src/fwts_devicetree.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/lib/src/fwts_devicetree.c b/src/lib/src/fwts_devicetree.c > index 5556446c..dcd5f5f0 100644 > --- a/src/lib/src/fwts_devicetree.c > +++ b/src/lib/src/fwts_devicetree.c > @@ -265,7 +265,7 @@ int fwts_dt_stringlist_count( > const char *property) > { > const char *list, *end; > - int length, count = 0; > + int length = 0, count = 0; > > list = fdt_getprop(fdt, nodeoffset, property, &length); > if (!list) { > Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff --git a/src/lib/src/fwts_devicetree.c b/src/lib/src/fwts_devicetree.c index 5556446c..dcd5f5f0 100644 --- a/src/lib/src/fwts_devicetree.c +++ b/src/lib/src/fwts_devicetree.c @@ -265,7 +265,7 @@ int fwts_dt_stringlist_count( const char *property) { const char *list, *end; - int length, count = 0; + int length = 0, count = 0; list = fdt_getprop(fdt, nodeoffset, property, &length); if (!list) {