From: Thomas Gleixner <tglx@linutronix.de>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Marc Zyngier <maz@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
"linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] irqdomain: fix -Wshadow warning
Date: Mon, 16 Nov 2020 18:28:36 +0100 [thread overview]
Message-ID: <877dqlyzwb.fsf@nanos.tec.linutronix.de> (raw)
In-Reply-To: <CAK8P3a2fprKoq3D-u4vV7RvqdpCL06ET2QWS9HJkLuOnNU5Ntg@mail.gmail.com>
On Mon, Nov 16 2020 at 16:26, Arnd Bergmann wrote:
> On Mon, Nov 16, 2020 at 3:03 PM Thomas Gleixner <tglx@linutronix.de> wrote:
>> So instead of trying to chase all these places we really want to rename
>> the global 'nr_irqs' variable.
>
> Fair enough, yes.
>
>> Something like the uncompiled below which is purely mechanical and does
>> not even try to look at some of the places which use it for the very
>> wrong reasons and purpose * Shudder *.
>
> Looks good to me.
>
> If we rename it, we might want to pick an even longer name to make
> it stand out in code review when it does get used, and easier to
> grep for.
Sure, I just picked it lazily without much thought.
>> + if (msi < max_nr_irqs && irq_get_chip_data(msi) == msic) {
>> generic_handle_irq(msi);
>> msic->fifo_virt[idx] = cpu_to_le32(0xffffffff);
>> } else {
>
> Most of the ones like this seem to have been simply converted from
> old sanity checks using NR_IRQS and would work just as well without
> the checks.
Yeah. As I said I did not look closely, but the peek already told me
that there is cruft.
> Actually removing the checks would have a small regression
> potential.
Right, it shouldn't cause problems.
>> --- a/drivers/pcmcia/at91_cf.c
>> +++ b/drivers/pcmcia/at91_cf.c
>
> potential.
>
>> @@ -312,7 +312,7 @@ static int at91_cf_probe(struct platform
>> goto fail0a;
>> cf->socket.pci_irq = gpio_to_irq(board->irq_pin);
>> } else
>> - cf->socket.pci_irq = nr_irqs + 1;
>> + cf->socket.pci_irq = max_nr_irqs + 1;
>>
>> /*
>> * pcmcia layer only remaps "real" memory not iospace
>
> This one would seem to actually warrant a bugfix, setting
> the field to zero.
Indeed.
Thanks,
tglx
prev parent reply other threads:[~2020-11-16 17:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-26 16:20 Arnd Bergmann
2020-11-16 14:03 ` Thomas Gleixner
2020-11-16 15:26 ` Arnd Bergmann
2020-11-16 17:28 ` Thomas Gleixner [this message]
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=877dqlyzwb.fsf@nanos.tec.linutronix.de \
--to=tglx@linutronix.de \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
/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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome