* [PATCH] soc: fsl: qe: remove unused function
@ 2021-04-15 8:34 Jiapeng Chong
2021-04-16 6:57 ` Daniel Axtens
0 siblings, 1 reply; 4+ messages in thread
From: Jiapeng Chong @ 2021-04-15 8:34 UTC (permalink / raw)
To: qiang.zhao
Cc: leoyang.li, linuxppc-dev, linux-arm-kernel, linux-kernel, Jiapeng Chong
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);
-}
-
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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] soc: fsl: qe: remove unused function
2021-04-15 8:34 [PATCH] soc: fsl: qe: remove unused function Jiapeng Chong
@ 2021-04-16 6:57 ` Daniel Axtens
2021-04-16 7:06 ` Christophe Leroy
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Axtens @ 2021-04-16 6:57 UTC (permalink / raw)
To: Jiapeng Chong, qiang.zhao
Cc: leoyang.li, linuxppc-dev, linux-arm-kernel, linux-kernel, Jiapeng Chong
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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] soc: fsl: qe: remove unused function
2021-04-16 6:57 ` Daniel Axtens
@ 2021-04-16 7:06 ` Christophe Leroy
2021-04-21 7:56 ` Jiapeng Chong
0 siblings, 1 reply; 4+ messages in thread
From: Christophe Leroy @ 2021-04-16 7:06 UTC (permalink / raw)
To: Daniel Axtens, Jiapeng Chong, qiang.zhao
Cc: linuxppc-dev, linux-kernel, linux-arm-kernel, leoyang.li
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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] soc: fsl: qe: remove unused function
2021-04-16 7:06 ` Christophe Leroy
@ 2021-04-21 7:56 ` Jiapeng Chong
0 siblings, 0 replies; 4+ messages in thread
From: Jiapeng Chong @ 2021-04-21 7:56 UTC (permalink / raw)
To: Christophe Leroy; +Cc: linuxppc-dev, linux-kernel, linux-arm-kernel
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.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-04-21 7:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-15 8:34 [PATCH] soc: fsl: qe: remove unused function Jiapeng Chong
2021-04-16 6:57 ` Daniel Axtens
2021-04-16 7:06 ` Christophe Leroy
2021-04-21 7:56 ` Jiapeng Chong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).