* [PATCH] arch: arm: mach-rpc: ecard: Remove some unused functions
@ 2015-01-01 17:55 Rickard Strandqvist
2015-01-02 9:29 ` Arnd Bergmann
0 siblings, 1 reply; 2+ messages in thread
From: Rickard Strandqvist @ 2015-01-01 17:55 UTC (permalink / raw)
To: linux-arm-kernel
Removes some functions that are not used anywhere:
ecard_disablefiq() ecard_enablefiq()
This was partially found by using a static code analysis program called cppcheck.
Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
arch/arm/mach-rpc/ecard.c | 29 -----------------------------
1 file changed, 29 deletions(-)
diff --git a/arch/arm/mach-rpc/ecard.c b/arch/arm/mach-rpc/ecard.c
index fcb1d59..e5c8caf 100644
--- a/arch/arm/mach-rpc/ecard.c
+++ b/arch/arm/mach-rpc/ecard.c
@@ -462,35 +462,6 @@ static struct irq_chip ecard_chip = {
.irq_unmask = ecard_irq_unmask,
};
-void ecard_enablefiq(unsigned int fiqnr)
-{
- ecard_t *ec = slot_to_ecard(fiqnr);
-
- if (ec) {
- if (!ec->ops)
- ec->ops = &ecard_default_ops;
-
- if (ec->claimed && ec->ops->fiqenable)
- ec->ops->fiqenable(ec, fiqnr);
- else
- printk(KERN_ERR "ecard: rejecting request to "
- "enable FIQs for %d\n", fiqnr);
- }
-}
-
-void ecard_disablefiq(unsigned int fiqnr)
-{
- ecard_t *ec = slot_to_ecard(fiqnr);
-
- if (ec) {
- if (!ec->ops)
- ec->ops = &ecard_default_ops;
-
- if (ec->ops->fiqdisable)
- ec->ops->fiqdisable(ec, fiqnr);
- }
-}
-
static void ecard_dump_irq_state(void)
{
ecard_t *ec;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread* [PATCH] arch: arm: mach-rpc: ecard: Remove some unused functions
2015-01-01 17:55 [PATCH] arch: arm: mach-rpc: ecard: Remove some unused functions Rickard Strandqvist
@ 2015-01-02 9:29 ` Arnd Bergmann
0 siblings, 0 replies; 2+ messages in thread
From: Arnd Bergmann @ 2015-01-02 9:29 UTC (permalink / raw)
To: linux-arm-kernel
On Thursday 01 January 2015 18:55:12 Rickard Strandqvist wrote:
> Removes some functions that are not used anywhere:
> ecard_disablefiq() ecard_enablefiq()
>
> This was partially found by using a static code analysis program called cppcheck.
>
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Looks like a correct change to me, very nice!
However looking a bit further you will notice that after this is removed,
there is more that becomes unused:
> -void ecard_enablefiq(unsigned int fiqnr)
> -{
> - ecard_t *ec = slot_to_ecard(fiqnr);
> -
> - if (ec) {
> - if (!ec->ops)
> - ec->ops = &ecard_default_ops;
> -
> - if (ec->claimed && ec->ops->fiqenable)
> - ec->ops->fiqenable(ec, fiqnr);
> - else
> - printk(KERN_ERR "ecard: rejecting request to "
> - "enable FIQs for %d\n", fiqnr);
> - }
> -}
> -
> -void ecard_disablefiq(unsigned int fiqnr)
> -{
> - ecard_t *ec = slot_to_ecard(fiqnr);
> -
> - if (ec) {
> - if (!ec->ops)
> - ec->ops = &ecard_default_ops;
> -
> - if (ec->ops->fiqdisable)
> - ec->ops->fiqdisable(ec, fiqnr);
> - }
> -}
These are in fact the only references to the fiqenable/fiqdisable/fiqpending
callback pointers, so it would be helpful to remove them as well, along with
the stub implementation from
Is cppcheck something you are working on yourself, or did you pick it up
from someone else? Is it possible to get cppcheck to also find those unused
callback pointers? I assume we have more of them in other code.
Arnd
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-01-02 9:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-01 17:55 [PATCH] arch: arm: mach-rpc: ecard: Remove some unused functions Rickard Strandqvist
2015-01-02 9:29 ` Arnd Bergmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox