lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190907010534.23713-1-jhubbard@nvidia.com>
Date:   Fri, 6 Sep 2019 18:05:34 -0700
From:   John Hubbard <jhubbard@...dia.com>
To:     YueHaibing <yuehaibing@...wei.com>
CC:     Bartosz Golaszewski <bgolaszewski@...libre.com>,
        <linux-gpio@...r.kernel.org>,
        Linux Next Mailing List <linux-next@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        "John Hubbard" <jhubbard@...dia.com>,
        Linus Walleij <linus.walleij@...aro.org>
Subject: [PATCH] gpio: fix build failure: gpiochip_[un]lock*() static/non-static

While building with !CONFIG_GPIOLIB, I experienced a build failure,
because driver.h in that configuration supplies both a static and
a non-static version of these routines:

	gpiochip_lock_as_irq()
	gpiochip_unlock_as_irq()

Fix this by moving the non-static routines under the scope of
CONFIG_GPIOLIB.

Fixes: commit c7663fa2a663 ("gpio: Move gpiochip_lock/unlock_as_irq to gpio/driver.h")
Cc: YueHaibing <yuehaibing@...wei.com>
Cc: Linus Walleij <linus.walleij@...aro.org>
Signed-off-by: John Hubbard <jhubbard@...dia.com>
---

Hi,

This is for today's linux-next.

More background:

It *looks* like the original commit did correctly put the non-static
versions of these routines in CONFIG_GPIOLIB, and the static versions
inside !CONFIG_GPIOLIB, but my git history foo is not strong enough
to figure out how we got here, so I'm not sure if the "Fixes:" tag
really refers to the guilty commit.

thanks,
John Hubbard
NVIDIA

 include/linux/gpio/driver.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index b74a3bee85e5..39be896aad38 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -702,13 +702,11 @@ void gpiochip_free_own_desc(struct gpio_desc *desc);
 void devprop_gpiochip_set_names(struct gpio_chip *chip,
 				const struct fwnode_handle *fwnode);
 
-/* lock/unlock as IRQ */
-int gpiochip_lock_as_irq(struct gpio_chip *chip, unsigned int offset);
-void gpiochip_unlock_as_irq(struct gpio_chip *chip, unsigned int offset);
-
 #ifdef CONFIG_GPIOLIB
 
 struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc);
+int gpiochip_lock_as_irq(struct gpio_chip *chip, unsigned int offset);
+void gpiochip_unlock_as_irq(struct gpio_chip *chip, unsigned int offset);
 
 #else /* CONFIG_GPIOLIB */
 
-- 
2.23.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ