[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20191127100241.5690-1-geert+renesas@glider.be>
Date: Wed, 27 Nov 2019 11:02:41 +0100
From: Geert Uytterhoeven <geert+renesas@...der.be>
To: Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <bgolaszewski@...libre.com>
Cc: linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
Geert Uytterhoeven <geert+renesas@...der.be>
Subject: [PATCH/RFC] gpiolib: Let gpiod_add_lookup_table() call gpiod_add_lookup_tables()
This saves 20 bytes on arm32, and 44 bytes on arm64.
Signed-off-by: Geert Uytterhoeven <geert+renesas@...der.be>
---
Interestingly, making gpiod_add_lookup_table() a static inline function
in <linux/gpio/machine.h> increases the caller's code size by 68 bytes
on arm32.
---
drivers/gpio/gpiolib.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index cb608512ad6bbded..aae01b117bc6450e 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -4373,11 +4373,7 @@ EXPORT_SYMBOL_GPL(gpiod_set_array_value_cansleep);
*/
void gpiod_add_lookup_table(struct gpiod_lookup_table *table)
{
- mutex_lock(&gpio_lookup_lock);
-
- list_add_tail(&table->list, &gpio_lookup_list);
-
- mutex_unlock(&gpio_lookup_lock);
+ gpiod_add_lookup_tables(&table, 1);
}
EXPORT_SYMBOL_GPL(gpiod_add_lookup_table);
--
2.17.1
Powered by blists - more mailing lists