Skip to contentSkip to conversation

gpio: omap_gpio: Fix unused function warning in non-DM case

PATCH New Tom Rini 2 participants 3 messages Jun 4, 2020 – Jun 18, 2020 GPIO

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 gpio: omap_gpio: Fix unused function warning in non-DM case

In the case of non-DM_GPIO the function get_gpio_index() will never be called, and clang will warn about this. Move this to be with the other non-DM code for easier removal later.

Cc Lokesh Vutla <[email protected]>
---
 drivers/gpio/omap_gpio.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/gpio/omap_gpio.c +4 -5
index 4249850f4bf9..c986ef03805c 100644
@@ -41,11 +41,6 @@ struct gpio_bank {
 
 #endif
 
-static inline int get_gpio_index(int gpio)
-{
-	return gpio & 0x1f;
-}
-
 int gpio_is_valid(int gpio)
 {
 	return (gpio >= 0) && (gpio < OMAP_MAX_GPIO);
@@ -122,6 +117,10 @@ static int _get_gpio_value(const struct gpio_bank *bank, int gpio)
 }
 
 #if !CONFIG_IS_ENABLED(DM_GPIO)
+static inline int get_gpio_index(int gpio)
+{
+	return gpio & 0x1f;
+}
 
 static inline const struct gpio_bank *get_gpio_bank(int gpio)
 {
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 gpio: omap_gpio: Fix unused function warning in non-DM case

Quoted 6 lines · Tom Rini

In the case of non-DM_GPIO the function get_gpio_index() will never be called, and clang will warn about this. Move this to be with the other non-DM code for easier removal later.

Cc Lokesh Vutla <[email protected]>

Thanks and regards,
Lokesh

Quoted 32 lines
---
 drivers/gpio/omap_gpio.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/gpio/omap_gpio.c +4 -5
index 4249850f4bf9..c986ef03805c 100644
@@ -41,11 +41,6 @@ struct gpio_bank {
 
 #endif
 
-static inline int get_gpio_index(int gpio)
-{
-	return gpio & 0x1f;
-}
-
 int gpio_is_valid(int gpio)
 {
 	return (gpio >= 0) && (gpio < OMAP_MAX_GPIO);
@@ -122,6 +117,10 @@ static int _get_gpio_value(const struct gpio_bank *bank, int gpio)
 }
 
 #if !CONFIG_IS_ENABLED(DM_GPIO)
+static inline int get_gpio_index(int gpio)
+{
+	return gpio & 0x1f;
+}
 
 static inline const struct gpio_bank *get_gpio_bank(int gpio)
 {
#2 lore raw

PATCH 1/1 gpio: omap_gpio: Fix unused function warning in non-DM case

In reply to Tom Rini
Quoted 6 lines · Tom Rini

In the case of non-DM_GPIO the function get_gpio_index() will never be called, and clang will warn about this. Move this to be with the other non-DM code for easier removal later.

Cc Lokesh Vutla <[email protected]>

Applied to u-boot-ti next.

Thanks and regards,
Lokesh