Message ID | 1367887919-25395-1-git-send-email-colin.king@canonical.com |
---|---|
State | Accepted |
Headers | show |
On 05/07/2013 08:51 AM, Colin King wrote: > From: Colin Ian King <colin.king@canonical.com> > > Coverity CID #997326, Unitialized scalar variable > > We should intialize variables matching and not_matching to keep > coverity happy even though we don't actually need to check these > values - the call is just used to check if an AC adapter interface > is available for fwts to read. > > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/acpi/ac_adapter/ac_adapter.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/src/acpi/ac_adapter/ac_adapter.c b/src/acpi/ac_adapter/ac_adapter.c > index 28d0461..3fb97b5 100644 > --- a/src/acpi/ac_adapter/ac_adapter.c > +++ b/src/acpi/ac_adapter/ac_adapter.c > @@ -27,7 +27,8 @@ > > static int ac_adapter_init(fwts_framework *fw) > { > - int matching, not_matching; > + int matching = 0; > + int not_matching = 0; > > if (fwts_ac_adapter_get_state(FWTS_AC_ADAPTER_ANY, &matching, ¬_matching) != FWTS_OK) { > fwts_failed(fw, LOG_LEVEL_LOW, "NoACAdapterEntry", > Acked-by: Alex Hung <alex.hung@canonical.com>
On Tue, May 7, 2013 at 8:51 AM, Colin King <colin.king@canonical.com> wrote: > From: Colin Ian King <colin.king@canonical.com> > > Coverity CID #997326, Unitialized scalar variable > > We should intialize variables matching and not_matching to keep > coverity happy even though we don't actually need to check these > values - the call is just used to check if an AC adapter interface > is available for fwts to read. > > Signed-off-by: Colin Ian King <colin.king@canonical.com> > --- > src/acpi/ac_adapter/ac_adapter.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/src/acpi/ac_adapter/ac_adapter.c b/src/acpi/ac_adapter/ac_adapter.c > index 28d0461..3fb97b5 100644 > --- a/src/acpi/ac_adapter/ac_adapter.c > +++ b/src/acpi/ac_adapter/ac_adapter.c > @@ -27,7 +27,8 @@ > > static int ac_adapter_init(fwts_framework *fw) > { > - int matching, not_matching; > + int matching = 0; > + int not_matching = 0; > > if (fwts_ac_adapter_get_state(FWTS_AC_ADAPTER_ANY, &matching, ¬_matching) != FWTS_OK) { > fwts_failed(fw, LOG_LEVEL_LOW, "NoACAdapterEntry", > -- > 1.8.1.2 > Acked-by: Keng-Yu Lin <kengyu@canonical.com>
diff --git a/src/acpi/ac_adapter/ac_adapter.c b/src/acpi/ac_adapter/ac_adapter.c index 28d0461..3fb97b5 100644 --- a/src/acpi/ac_adapter/ac_adapter.c +++ b/src/acpi/ac_adapter/ac_adapter.c @@ -27,7 +27,8 @@ static int ac_adapter_init(fwts_framework *fw) { - int matching, not_matching; + int matching = 0; + int not_matching = 0; if (fwts_ac_adapter_get_state(FWTS_AC_ADAPTER_ANY, &matching, ¬_matching) != FWTS_OK) { fwts_failed(fw, LOG_LEVEL_LOW, "NoACAdapterEntry",