qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 5/7] gpio: Add GPIO Aggregator/Repeater driver


From: Eugeniu Rosca
Subject: Re: [PATCH v3 5/7] gpio: Add GPIO Aggregator/Repeater driver
Date: Wed, 27 Nov 2019 15:15:29 +0100
User-agent: Mutt/1.12.1+40 (7f8642d4ee82) (2019-06-28)

Hi Geert,

Many thanks for the series upgrade.
A few static-analysis findings below (could be false positives).

On Wed, Nov 27, 2019 at 09:42:51AM +0100, Geert Uytterhoeven wrote:

[..]

> +static bool isrange(const char *s)
> +{
> +     size_t n = strlen(s);

Cppcheck 1.40-18521-ge6d692d96058:
drivers/gpio/gpio-aggregator.c:69:11: style: Variable 'n' is assigned a value 
that is never used. [unreadVariable]

Smatch v0.5.0-6150-gc1ed13e4ee7b:
drivers/gpio/gpio-aggregator.c:69 isrange() warn: unused return: n = strlen()

[..]

> +     aggr->lookups->dev_id = kasprintf(GFP_KERNEL, "%s.%d", DRV_NAME, id);
> +     if (!aggr->lookups) {
> +             res = -ENOMEM;
> +             goto remove_idr;
> +     }

s/aggr->lookups/aggr->lookups->dev_id/ ?

[..]

> +static int gpio_fwd_get_multiple(struct gpio_chip *chip, unsigned long *mask,
> +                              unsigned long *bits)
> +{
> +     struct gpiochip_fwd *fwd = gpiochip_get_data(chip);
> +     unsigned long *values, flags;

gcc 9.2.1:
warning: ‘flags’ may be used uninitialized in this function 
[-Wmaybe-uninitialized]

[..]

> +static void gpio_fwd_set_multiple(struct gpio_chip *chip, unsigned long 
> *mask,
> +                               unsigned long *bits)
> +{
> +     struct gpiochip_fwd *fwd = gpiochip_get_data(chip);
> +     unsigned long *values, flags;

gcc 9.2.1, same as above:
warning: ‘flags’ may be used uninitialized in this function 
[-Wmaybe-uninitialized]

Should these be silenced like in 2bf593f101f3ca ("xilinx_uartps.c:
suppress "may be used uninitialised" warning") ?

I plan to do some runtime testing soon.

-- 
Best Regards,
Eugeniu



reply via email to

[Prev in Thread] Current Thread [Next in Thread]