* re: gpiolib: translate pin number in GPIO ACPI callbacks
@ 2015-03-23 15:55 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2015-03-23 15:55 UTC (permalink / raw)
To: qipeng.zha; +Cc: linux-gpio
Hello qipeng.zha,
The patch 4de60970abf9: "gpiolib: translate pin number in GPIO ACPI
callbacks" from Mar 11, 2015, leads to the following static checker
warning:
drivers/gpio/gpiolib-acpi.c:559 acpi_gpio_adr_space_handler()
warn: unsigned 'pin' is never less than zero.
drivers/gpio/gpiolib-acpi.c
550
551 length = min(agpio->pin_table_length, (u16)(pin_index + bits));
552 for (i = pin_index; i < length; ++i) {
553 unsigned pin = agpio->pin_table[i];
^^^^^^^^^^^^^^^^^^^^^^^^^
"pin" is already assigned.
554 struct acpi_gpio_connection *conn;
555 struct gpio_desc *desc;
556 bool found;
557
558 pin = acpi_gpiochip_pin_to_gpio_offset(chip, pin);
559 if (pin < 0) {
^^^^^^^
Error checking doesn't work.
560 status = AE_BAD_PARAMETER;
561 goto out;
562 }
563
564 mutex_lock(&achip->conn_lock);
regards,
dan carpenter
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-03-23 15:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-23 15:55 gpiolib: translate pin number in GPIO ACPI callbacks Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).