From: Christophe Leroy <christophe.leroy@csgroup.eu> To: Daniel Axtens <dja@axtens.net>, Jiapeng Chong <jiapeng.chong@linux.alibaba.com>, qiang.zhao@nxp.com Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, leoyang.li@nxp.com Subject: Re: [PATCH] soc: fsl: qe: remove unused function Date: Fri, 16 Apr 2021 09:06:23 +0200 [thread overview] Message-ID: <76468b5b-0eb0-8772-b7b5-21bb708aa053@csgroup.eu> (raw) In-Reply-To: <87blaeg1ig.fsf@linkitivity.dja.id.au> 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
WARNING: multiple messages have this Message-ID (diff)
From: Christophe Leroy <christophe.leroy@csgroup.eu> To: Daniel Axtens <dja@axtens.net>, Jiapeng Chong <jiapeng.chong@linux.alibaba.com>, qiang.zhao@nxp.com Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, leoyang.li@nxp.com Subject: Re: [PATCH] soc: fsl: qe: remove unused function Date: Fri, 16 Apr 2021 09:06:23 +0200 [thread overview] Message-ID: <76468b5b-0eb0-8772-b7b5-21bb708aa053@csgroup.eu> (raw) In-Reply-To: <87blaeg1ig.fsf@linkitivity.dja.id.au> 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
next prev parent reply other threads:[~2021-04-16 7:06 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-04-15 8:34 [PATCH] soc: fsl: qe: remove unused function Jiapeng Chong 2021-04-15 8:34 ` Jiapeng Chong 2021-04-15 8:34 ` Jiapeng Chong 2021-04-16 6:57 ` Daniel Axtens 2021-04-16 6:57 ` Daniel Axtens 2021-04-16 6:57 ` Daniel Axtens 2021-04-16 7:06 ` Christophe Leroy [this message] 2021-04-16 7:06 ` Christophe Leroy 2021-04-21 7:56 ` Jiapeng Chong 2021-04-21 7:56 ` Jiapeng Chong
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=76468b5b-0eb0-8772-b7b5-21bb708aa053@csgroup.eu \ --to=christophe.leroy@csgroup.eu \ --cc=dja@axtens.net \ --cc=jiapeng.chong@linux.alibaba.com \ --cc=leoyang.li@nxp.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linuxppc-dev@lists.ozlabs.org \ --cc=qiang.zhao@nxp.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.