diff mbox series

[v1,1/1] gpiolib: Deduplicate forward declaration in the consumer.h header

Message ID 20210803173925.57216-1-andriy.shevchenko@linux.intel.com
State New
Headers show
Series [v1,1/1] gpiolib: Deduplicate forward declaration in the consumer.h header | expand

Commit Message

Andy Shevchenko Aug. 3, 2021, 5:39 p.m. UTC
struct acpi_device is repeated in two branches of ifdeffery.
Move it out and hence deduplicate.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 include/linux/gpio/consumer.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Linus Walleij Aug. 11, 2021, 12:05 p.m. UTC | #1
On Tue, Aug 3, 2021 at 7:39 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> struct acpi_device is repeated in two branches of ifdeffery.
> Move it out and hence deduplicate.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

That's neat!
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
Andy Shevchenko Aug. 11, 2021, 12:56 p.m. UTC | #2
On Wed, Aug 11, 2021 at 02:05:40PM +0200, Linus Walleij wrote:
> On Tue, Aug 3, 2021 at 7:39 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> 
> > struct acpi_device is repeated in two branches of ifdeffery.
> > Move it out and hence deduplicate.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> 
> That's neat!
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Thanks!

Bart, I'll send this inside my usual PR in terms of GPIO ACPI support.
diff mbox series

Patch

diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h
index 566feb56601f..414b8f98d70f 100644
--- a/include/linux/gpio/consumer.h
+++ b/include/linux/gpio/consumer.h
@@ -680,10 +680,10 @@  struct acpi_gpio_mapping {
 	unsigned int quirks;
 };
 
-#if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_ACPI)
-
 struct acpi_device;
 
+#if IS_ENABLED(CONFIG_GPIOLIB) && IS_ENABLED(CONFIG_ACPI)
+
 int acpi_dev_add_driver_gpios(struct acpi_device *adev,
 			      const struct acpi_gpio_mapping *gpios);
 void acpi_dev_remove_driver_gpios(struct acpi_device *adev);
@@ -696,8 +696,6 @@  struct gpio_desc *acpi_get_and_request_gpiod(char *path, int pin, char *label);
 
 #else  /* CONFIG_GPIOLIB && CONFIG_ACPI */
 
-struct acpi_device;
-
 static inline int acpi_dev_add_driver_gpios(struct acpi_device *adev,
 			      const struct acpi_gpio_mapping *gpios)
 {