diff mbox series

soc: fsl: qe: remove unused function

Message ID 1618475663-100748-1-git-send-email-jiapeng.chong@linux.alibaba.com (mailing list archive)
State Not Applicable
Headers show
Series soc: fsl: qe: remove unused function | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch powerpc/merge (0702e74703f57173e70cfab2a79a3e682e9e96ec)
snowpatch_ozlabs/build-ppc64le success Build succeeded
snowpatch_ozlabs/build-ppc64be success Build succeeded
snowpatch_ozlabs/build-ppc64e success Build succeeded
snowpatch_ozlabs/build-pmac32 success Build succeeded
snowpatch_ozlabs/checkpatch success total: 0 errors, 0 warnings, 0 checks, 11 lines checked
snowpatch_ozlabs/needsstable success Patch has no Fixes tags

Commit Message

Jiapeng Chong April 15, 2021, 8:34 a.m. UTC
Fix the following clang warning:

drivers/soc/fsl/qe/qe_ic.c:234:29: warning: unused function
'qe_ic_from_irq' [-Wunused-function].

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/soc/fsl/qe/qe_ic.c | 5 -----
 1 file changed, 5 deletions(-)

Comments

Daniel Axtens April 16, 2021, 6:57 a.m. UTC | #1
Hi Jiapeng,

> Fix the following clang warning:
>
> drivers/soc/fsl/qe/qe_ic.c:234:29: warning: unused function
> 'qe_ic_from_irq' [-Wunused-function].
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  drivers/soc/fsl/qe/qe_ic.c | 5 -----
>  1 file changed, 5 deletions(-)
>
> diff --git a/drivers/soc/fsl/qe/qe_ic.c b/drivers/soc/fsl/qe/qe_ic.c
> index 0390af9..b573712 100644
> --- a/drivers/soc/fsl/qe/qe_ic.c
> +++ b/drivers/soc/fsl/qe/qe_ic.c
> @@ -231,11 +231,6 @@ static inline void qe_ic_write(__be32  __iomem *base, unsigned int reg,
>  	qe_iowrite32be(value, base + (reg >> 2));
>  }
>  
> -static inline struct qe_ic *qe_ic_from_irq(unsigned int virq)
> -{
> -	return irq_get_chip_data(virq);
> -}

This seems good to me.

 * We know that this function can't be called directly from outside the
  file, because it is static.

 * The function address isn't used as a function pointer anywhere, so
   that means it can't be called from outside the file that way (also
   it's inline, which would make using a function pointer unwise!)

 * There's no obvious macros in that file that might construct the name
   of the function in a way that is hidden from grep.

All in all, I am fairly confident that the function is indeed not used.

Reviewed-by: Daniel Axtens <dja@axtens.net>

Kind regards,
Daniel

> -
>  static inline struct qe_ic *qe_ic_from_irq_data(struct irq_data *d)
>  {
>  	return irq_data_get_irq_chip_data(d);
> -- 
> 1.8.3.1
Christophe Leroy April 16, 2021, 7:06 a.m. UTC | #2
Le 16/04/2021 à 08:57, Daniel Axtens a écrit :
> Hi Jiapeng,
> 
>> Fix the following clang warning:

You are not fixing a warning, you are removing a function in order to fix a warning ...

>>
>> drivers/soc/fsl/qe/qe_ic.c:234:29: warning: unused function
>> 'qe_ic_from_irq' [-Wunused-function].

Would be wise to tell that the last users of the function where removed by commit d7c2878cfcfa 
("soc: fsl: qe: remove unused qe_ic_set_* functions")

https://github.com/torvalds/linux/commit/d7c2878cfcfa

>>
>> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
>> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
>> ---
>>   drivers/soc/fsl/qe/qe_ic.c | 5 -----
>>   1 file changed, 5 deletions(-)
>>
>> diff --git a/drivers/soc/fsl/qe/qe_ic.c b/drivers/soc/fsl/qe/qe_ic.c
>> index 0390af9..b573712 100644
>> --- a/drivers/soc/fsl/qe/qe_ic.c
>> +++ b/drivers/soc/fsl/qe/qe_ic.c
>> @@ -231,11 +231,6 @@ static inline void qe_ic_write(__be32  __iomem *base, unsigned int reg,
>>   	qe_iowrite32be(value, base + (reg >> 2));
>>   }
>>   
>> -static inline struct qe_ic *qe_ic_from_irq(unsigned int virq)
>> -{
>> -	return irq_get_chip_data(virq);
>> -}
> 
> This seems good to me.
> 
>   * We know that this function can't be called directly from outside the
>    file, because it is static.
> 
>   * The function address isn't used as a function pointer anywhere, so
>     that means it can't be called from outside the file that way (also
>     it's inline, which would make using a function pointer unwise!)
> 
>   * There's no obvious macros in that file that might construct the name
>     of the function in a way that is hidden from grep.
> 
> All in all, I am fairly confident that the function is indeed not used.
> 
> Reviewed-by: Daniel Axtens <dja@axtens.net>
> 
> Kind regards,
> Daniel
> 
>> -
>>   static inline struct qe_ic *qe_ic_from_irq_data(struct irq_data *d)
>>   {
>>   	return irq_data_get_irq_chip_data(d);
>> -- 
>> 1.8.3.1
Jiapeng Chong April 21, 2021, 7:56 a.m. UTC | #3
On 2021/4/16 15:06, Christophe Leroy wrote:
> 
> 
> Le 16/04/2021 à 08:57, Daniel Axtens a écrit :
>> Hi Jiapeng,
>>
>>> Fix the following clang warning:
> 
> You are not fixing a warning, you are removing a function in order to 
> fix a warning ...
> 
>>>
>>> drivers/soc/fsl/qe/qe_ic.c:234:29: warning: unused function
>>> 'qe_ic_from_irq' [-Wunused-function].
> 
> Would be wise to tell that the last users of the function where removed 
> by commit d7c2878cfcfa ("soc: fsl: qe: remove unused qe_ic_set_* 
> functions")
> 
> https://github.com/torvalds/linux/commit/d7c2878cfcfa
> 
>>>
>>> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
>>> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
>>> ---
>>>   drivers/soc/fsl/qe/qe_ic.c | 5 -----
>>>   1 file changed, 5 deletions(-)
>>>
>>> diff --git a/drivers/soc/fsl/qe/qe_ic.c b/drivers/soc/fsl/qe/qe_ic.c
>>> index 0390af9..b573712 100644
>>> --- a/drivers/soc/fsl/qe/qe_ic.c
>>> +++ b/drivers/soc/fsl/qe/qe_ic.c
>>> @@ -231,11 +231,6 @@ static inline void qe_ic_write(__be32  __iomem 
>>> *base, unsigned int reg,
>>>       qe_iowrite32be(value, base + (reg >> 2));
>>>   }
>>> -static inline struct qe_ic *qe_ic_from_irq(unsigned int virq)
>>> -{
>>> -    return irq_get_chip_data(virq);
>>> -}
>>
>> This seems good to me.
>>
>>   * We know that this function can't be called directly from outside the
>>    file, because it is static.
>>
>>   * The function address isn't used as a function pointer anywhere, so
>>     that means it can't be called from outside the file that way (also
>>     it's inline, which would make using a function pointer unwise!)
>>
>>   * There's no obvious macros in that file that might construct the name
>>     of the function in a way that is hidden from grep.
>>
>> All in all, I am fairly confident that the function is indeed not used.
>>
>> Reviewed-by: Daniel Axtens <dja@axtens.net>
>>
>> Kind regards,
>> Daniel
>>
>>> -
>>>   static inline struct qe_ic *qe_ic_from_irq_data(struct irq_data *d)
>>>   {
>>>       return irq_data_get_irq_chip_data(d);
>>> -- 
>>> 1.8.3.1
Hi,
I will follow the advice and send V2 later.
diff mbox series

Patch

diff --git a/drivers/soc/fsl/qe/qe_ic.c b/drivers/soc/fsl/qe/qe_ic.c
index 0390af9..b573712 100644
--- a/drivers/soc/fsl/qe/qe_ic.c
+++ b/drivers/soc/fsl/qe/qe_ic.c
@@ -231,11 +231,6 @@  static inline void qe_ic_write(__be32  __iomem *base, unsigned int reg,
 	qe_iowrite32be(value, base + (reg >> 2));
 }
 
-static inline struct qe_ic *qe_ic_from_irq(unsigned int virq)
-{
-	return irq_get_chip_data(virq);
-}
-
 static inline struct qe_ic *qe_ic_from_irq_data(struct irq_data *d)
 {
 	return irq_data_get_irq_chip_data(d);