On Mon, Mar 31, 2014 at 03:11:33PM +0300, Dan Carpenter wrote:
> On Mon, Mar 31, 2014 at 03:05:25PM +0300, Mika Westerberg wrote:
> > On Fri, Mar 28, 2014 at 11:37:32AM +0300, Dan Carpenter wrote:
> > > Hello Mika Westerberg,
> > > 
> > > The patch 473ed7be0da0: "gpio / ACPI: Add support for ACPI GPIO
> > > operation regions" from Mar 14, 2014, leads to the following static
> > > checker warning:
> > > 
> > >   drivers/gpio/gpiolib-acpi.c:454 acpi_gpio_adr_space_handler()
> > >   warn: should 'gpiod_get_raw_value(desc) << i' be a 64 bit type?
> > 
> > Thanks for the report. However, I'm not able to reproduce this warning with
> > sparse. How did you get this?
> 
> It's not a Sparse warning.  It's some unreleased stuff (too many false
> positives).  I sort through the warnings manually and send the ones
> which seem valid.

I see.

What do you think about the patch below? I have to admit that this kind of
stuff is in my "gray" area of understanding.

diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index d5be56fe689e..401add28933f 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -451,7 +451,7 @@ acpi_gpio_adr_space_handler(u32 function, 
acpi_physical_address address,
                if (function == ACPI_WRITE)
                        gpiod_set_raw_value(desc, !!((1 << i) & *value));
                else
-                       *value |= gpiod_get_raw_value(desc) << i;
+                       *value |= (u64)gpiod_get_raw_value(desc) << i;
        }
 
 out:
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to