Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1517232

Re: [PATCH] ACPI / gpio: avoid warning for gpio hogging code

From Mika Westerberg <mika.westerberg@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH] ACPI / gpio: avoid warning for gpio hogging code
Date 2016-11-08 15:20 +0100
Message-ID <sBfpM-20X-19@gated-at.bofh.it> (permalink)
References <sBeWK-1y1-33@gated-at.bofh.it>
Organization Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo

Show all headers | View raw


On Tue, Nov 08, 2016 at 02:40:06PM +0100, Arnd Bergmann wrote:
> The newly added acpi_gpiochip_scan_gpios function produces a few harmless
> warnings:
> 
> drivers/gpio/gpiolib-acpi.c: In function ‘acpi_gpiochip_add’:
> drivers/gpio/gpiolib-acpi.c:925:7: error: ‘dflags’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
> drivers/gpio/gpiolib-acpi.c:925:9: error: ‘lflags’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
> 
> The problem is that he compiler cannot know that a negative return value
> from fwnode_property_read_u32_array() or acpi_gpiochip_pin_to_gpio_offset()
> implies that the IS_ERR(gpio_desc) is true, as the value could in theory
> be below -MAX_ERRNO.
> 
> The function already initializes its output values to zero, and moving
> that intialization a little higher up ensures that we can never have
> uninitialized data in the caller.
> 
> Fixes: c80f1ba75df2 ("ACPI / gpio: Add hogging support")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] ACPI / gpio: avoid warning for gpio hogging code Arnd Bergmann <arnd@arndb.de> - 2016-11-08 14:50 +0100
  Re: [PATCH] ACPI / gpio: avoid warning for gpio hogging code Mika Westerberg <mika.westerberg@linux.intel.com> - 2016-11-08 15:20 +0100
  Re: [PATCH] ACPI / gpio: avoid warning for gpio hogging code Linus Walleij <linus.walleij@linaro.org> - 2016-11-09 09:50 +0100

csiph-web