diff mbox series

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

Message ID 20200604200139.4868-1-trini@konsulko.com
State Accepted
Commit a37f765219870e4cb4ed9590dff77ed8a380a462
Headers show
Series gpio: omap_gpio: Fix unused function warning in non-DM case | expand

Commit Message

Tom Rini June 4, 2020, 8:01 p.m. UTC
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 <lokeshvutla at ti.com>
Signed-off-by: Tom Rini <trini at konsulko.com>
---
 drivers/gpio/omap_gpio.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

Comments

Lokesh Vutla June 5, 2020, 4:34 a.m. UTC | #1
On 05/06/20 1:31 am, Tom Rini wrote:
> 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 <lokeshvutla at ti.com>
> Signed-off-by: Tom Rini <trini at konsulko.com>

Reviewed-by: Lokesh Vutla <lokeshvutla at ti.com>

Thanks and regards,
Lokesh

> ---
>  drivers/gpio/omap_gpio.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpio/omap_gpio.c b/drivers/gpio/omap_gpio.c
> index 4249850f4bf9..c986ef03805c 100644
> --- a/drivers/gpio/omap_gpio.c
> +++ b/drivers/gpio/omap_gpio.c
> @@ -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)
>  {
>
Lokesh Vutla June 18, 2020, 1:52 p.m. UTC | #2
On 05/06/20 1:31 am, Tom Rini wrote:
> 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 <lokeshvutla at ti.com>
> Signed-off-by: Tom Rini <trini at konsulko.com>

Applied to u-boot-ti next.

Thanks and regards,
Lokesh
diff mbox series

Patch

diff --git a/drivers/gpio/omap_gpio.c b/drivers/gpio/omap_gpio.c
index 4249850f4bf9..c986ef03805c 100644
--- a/drivers/gpio/omap_gpio.c
+++ b/drivers/gpio/omap_gpio.c
@@ -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)
 {