[-next] pinctrl: artpec6: Make two functions static
diff mbox series

Message ID 20190321150909.3576-1-yuehaibing@huawei.com
State New
Headers show
Series
  • [-next] pinctrl: artpec6: Make two functions static
Related show

Commit Message

YueHaibing March 21, 2019, 3:09 p.m. UTC
From: YueHaibing <yuehaibing@huawei.com>

Fix sparse warnings:

drivers/pinctrl/pinctrl-artpec6.c:691:5: warning:
 symbol 'artpec6_pmx_enable' was not declared. Should it be static?
drivers/pinctrl/pinctrl-artpec6.c:705:6: warning:
 symbol 'artpec6_pmx_disable' was not declared. Should it be static?

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/pinctrl/pinctrl-artpec6.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Comments

Jesper Nilsson March 21, 2019, 3:59 p.m. UTC | #1
On Thu, Mar 21, 2019 at 11:09:09PM +0800, Yue Haibing wrote:
> From: YueHaibing <yuehaibing@huawei.com>
> 
> Fix sparse warnings:
> 
> drivers/pinctrl/pinctrl-artpec6.c:691:5: warning:
>  symbol 'artpec6_pmx_enable' was not declared. Should it be static?
> drivers/pinctrl/pinctrl-artpec6.c:705:6: warning:
>  symbol 'artpec6_pmx_disable' was not declared. Should it be static?
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>

> ---
>  drivers/pinctrl/pinctrl-artpec6.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-artpec6.c b/drivers/pinctrl/pinctrl-artpec6.c
> index d89dc43..e836850 100644
> --- a/drivers/pinctrl/pinctrl-artpec6.c
> +++ b/drivers/pinctrl/pinctrl-artpec6.c
> @@ -688,8 +688,9 @@ static void artpec6_pmx_select_func(struct pinctrl_dev *pctldev,
>  	}
>  }
>  
> -int artpec6_pmx_enable(struct pinctrl_dev *pctldev, unsigned int function,
> -		       unsigned int group)
> +static int artpec6_pmx_enable(struct pinctrl_dev *pctldev,
> +			      unsigned int function,
> +			      unsigned int group)
>  {
>  	struct artpec6_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
>  
> @@ -702,8 +703,9 @@ int artpec6_pmx_enable(struct pinctrl_dev *pctldev, unsigned int function,
>  	return 0;
>  }
>  
> -void artpec6_pmx_disable(struct pinctrl_dev *pctldev, unsigned int function,
> -			 unsigned int group)
> +static void artpec6_pmx_disable(struct pinctrl_dev *pctldev,
> +				unsigned int function,
> +				unsigned int group)
>  {
>  	struct artpec6_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
>  
> -- 
> 2.7.0

/^JN - Jesper Nilsson
Linus Walleij April 4, 2019, 3:26 p.m. UTC | #2
On Thu, Mar 21, 2019 at 10:09 PM Yue Haibing <yuehaibing@huawei.com> wrote:

> From: YueHaibing <yuehaibing@huawei.com>
>
> Fix sparse warnings:
>
> drivers/pinctrl/pinctrl-artpec6.c:691:5: warning:
>  symbol 'artpec6_pmx_enable' was not declared. Should it be static?
> drivers/pinctrl/pinctrl-artpec6.c:705:6: warning:
>  symbol 'artpec6_pmx_disable' was not declared. Should it be static?
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Patch applied with the ACKs.

Yours,
Linus Walleij
Nathan Chancellor April 8, 2019, 6:01 p.m. UTC | #3
On Thu, Mar 21, 2019 at 11:09:09PM +0800, Yue Haibing wrote:
> From: YueHaibing <yuehaibing@huawei.com>
> 
> Fix sparse warnings:
> 
> drivers/pinctrl/pinctrl-artpec6.c:691:5: warning:
>  symbol 'artpec6_pmx_enable' was not declared. Should it be static?
> drivers/pinctrl/pinctrl-artpec6.c:705:6: warning:
>  symbol 'artpec6_pmx_disable' was not declared. Should it be static?
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/pinctrl/pinctrl-artpec6.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinctrl-artpec6.c b/drivers/pinctrl/pinctrl-artpec6.c
> index d89dc43..e836850 100644
> --- a/drivers/pinctrl/pinctrl-artpec6.c
> +++ b/drivers/pinctrl/pinctrl-artpec6.c
> @@ -688,8 +688,9 @@ static void artpec6_pmx_select_func(struct pinctrl_dev *pctldev,
>  	}
>  }
>  
> -int artpec6_pmx_enable(struct pinctrl_dev *pctldev, unsigned int function,
> -		       unsigned int group)
> +static int artpec6_pmx_enable(struct pinctrl_dev *pctldev,
> +			      unsigned int function,
> +			      unsigned int group)
>  {
>  	struct artpec6_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
>  
> @@ -702,8 +703,9 @@ int artpec6_pmx_enable(struct pinctrl_dev *pctldev, unsigned int function,
>  	return 0;
>  }
>  
> -void artpec6_pmx_disable(struct pinctrl_dev *pctldev, unsigned int function,
> -			 unsigned int group)
> +static void artpec6_pmx_disable(struct pinctrl_dev *pctldev,
> +				unsigned int function,
> +				unsigned int group)

On arm32 allyesconfig:

drivers/pinctrl/pinctrl-artpec6.c:706:13: error: unused function
'artpec6_pmx_disable' [-Werror,-Wunused-function]

This is the second time you've introduced an unused function warning by
making a function static[1], could you please be a little more vigilant
in your clean ups in the future?

[1]: https://lore.kernel.org/lkml/20190327050126.12064-1-natechancellor@gmail.com/

Linus/Jesper/Lars, should this function just be deleted? I'd be happy to
send a patch doing so if that's the right course of action.

Thanks,
Nathan

>  {
>  	struct artpec6_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
>  
> -- 
> 2.7.0
> 
>
YueHaibing April 9, 2019, 1:35 a.m. UTC | #4
On 2019/4/9 2:01, Nathan Chancellor wrote:
> On Thu, Mar 21, 2019 at 11:09:09PM +0800, Yue Haibing wrote:
>> From: YueHaibing <yuehaibing@huawei.com>
>>
>> Fix sparse warnings:
>>
>> drivers/pinctrl/pinctrl-artpec6.c:691:5: warning:
>>  symbol 'artpec6_pmx_enable' was not declared. Should it be static?
>> drivers/pinctrl/pinctrl-artpec6.c:705:6: warning:
>>  symbol 'artpec6_pmx_disable' was not declared. Should it be static?
>>
>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>> ---
>>  drivers/pinctrl/pinctrl-artpec6.c | 10 ++++++----
>>  1 file changed, 6 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/pinctrl/pinctrl-artpec6.c b/drivers/pinctrl/pinctrl-artpec6.c
>> index d89dc43..e836850 100644
>> --- a/drivers/pinctrl/pinctrl-artpec6.c
>> +++ b/drivers/pinctrl/pinctrl-artpec6.c
>> @@ -688,8 +688,9 @@ static void artpec6_pmx_select_func(struct pinctrl_dev *pctldev,
>>  	}
>>  }
>>  
>> -int artpec6_pmx_enable(struct pinctrl_dev *pctldev, unsigned int function,
>> -		       unsigned int group)
>> +static int artpec6_pmx_enable(struct pinctrl_dev *pctldev,
>> +			      unsigned int function,
>> +			      unsigned int group)
>>  {
>>  	struct artpec6_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
>>  
>> @@ -702,8 +703,9 @@ int artpec6_pmx_enable(struct pinctrl_dev *pctldev, unsigned int function,
>>  	return 0;
>>  }
>>  
>> -void artpec6_pmx_disable(struct pinctrl_dev *pctldev, unsigned int function,
>> -			 unsigned int group)
>> +static void artpec6_pmx_disable(struct pinctrl_dev *pctldev,
>> +				unsigned int function,
>> +				unsigned int group)
> 
> On arm32 allyesconfig:
> 
> drivers/pinctrl/pinctrl-artpec6.c:706:13: error: unused function
> 'artpec6_pmx_disable' [-Werror,-Wunused-function]
> 
> This is the second time you've introduced an unused function warning by
> making a function static[1], could you please be a little more vigilant
> in your clean ups in the future?

Sorry for this.

> 
> [1]: https://lore.kernel.org/lkml/20190327050126.12064-1-natechancellor@gmail.com/
> 
> Linus/Jesper/Lars, should this function just be deleted? I'd be happy to
> send a patch doing so if that's the right course of action.
> 
> Thanks,
> Nathan
> 
>>  {
>>  	struct artpec6_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
>>  
>> -- 
>> 2.7.0
>>
>>
> 
> .
>
Jesper Nilsson April 9, 2019, 6:56 a.m. UTC | #5
On Mon, Apr 08, 2019 at 11:01:10AM -0700, Nathan Chancellor wrote:
> On Thu, Mar 21, 2019 at 11:09:09PM +0800, Yue Haibing wrote:
> > From: YueHaibing <yuehaibing@huawei.com>
> > -void artpec6_pmx_disable(struct pinctrl_dev *pctldev, unsigned int function,
> > -			 unsigned int group)
> > +static void artpec6_pmx_disable(struct pinctrl_dev *pctldev,
> > +				unsigned int function,
> > +				unsigned int group)
> 
> On arm32 allyesconfig:
> 
> drivers/pinctrl/pinctrl-artpec6.c:706:13: error: unused function
> 'artpec6_pmx_disable' [-Werror,-Wunused-function]
> 
> This is the second time you've introduced an unused function warning by
> making a function static[1], could you please be a little more vigilant
> in your clean ups in the future?
> 
> [1]: https://lore.kernel.org/lkml/20190327050126.12064-1-natechancellor@gmail.com/
> 
> Linus/Jesper/Lars, should this function just be deleted? I'd be happy to
> send a patch doing so if that's the right course of action.

Yes, that function is unused and can be dropped.

> Thanks,
> Nathan

/^JN - Jesper Nilsson

Patch
diff mbox series

diff --git a/drivers/pinctrl/pinctrl-artpec6.c b/drivers/pinctrl/pinctrl-artpec6.c
index d89dc43..e836850 100644
--- a/drivers/pinctrl/pinctrl-artpec6.c
+++ b/drivers/pinctrl/pinctrl-artpec6.c
@@ -688,8 +688,9 @@  static void artpec6_pmx_select_func(struct pinctrl_dev *pctldev,
 	}
 }
 
-int artpec6_pmx_enable(struct pinctrl_dev *pctldev, unsigned int function,
-		       unsigned int group)
+static int artpec6_pmx_enable(struct pinctrl_dev *pctldev,
+			      unsigned int function,
+			      unsigned int group)
 {
 	struct artpec6_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
 
@@ -702,8 +703,9 @@  int artpec6_pmx_enable(struct pinctrl_dev *pctldev, unsigned int function,
 	return 0;
 }
 
-void artpec6_pmx_disable(struct pinctrl_dev *pctldev, unsigned int function,
-			 unsigned int group)
+static void artpec6_pmx_disable(struct pinctrl_dev *pctldev,
+				unsigned int function,
+				unsigned int group)
 {
 	struct artpec6_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);