From: Jinjie Ruan <ruanjinjie@huawei.com>
To: Thomas Gleixner <tglx@linutronix.de>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] genirq: Simplify the check for __irq_get_desc_lock()
Date: Tue, 7 May 2024 09:16:07 +0800 [thread overview]
Message-ID: <a75c2818-11eb-3f78-1699-94a5b10ef232@huawei.com> (raw)
In-Reply-To: <87seyurfk7.ffs@tglx>
On 2024/5/7 1:55, Thomas Gleixner wrote:
> On Mon, May 06 2024 at 20:50, Jinjie Ruan wrote:
>
>> If it set "_IRQ_DESC_PERCPU" in "check" but the desc is not percpu, or if
>> the desc is percpu but it not set "_IRQ_DESC_PERCPU" in "check", it both
>> return NULL, so simplify the check in __irq_get_desc_lock() with "!=".
>
> What is exactly simplified here?
>
>> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
>> ---
>> kernel/irq/irqdesc.c | 6 +-----
>> 1 file changed, 1 insertion(+), 5 deletions(-)
>>
>> diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
>> index 88ac3652fcf2..6c52deb134b9 100644
>> --- a/kernel/irq/irqdesc.c
>> +++ b/kernel/irq/irqdesc.c
>> @@ -882,11 +882,7 @@ __irq_get_desc_lock(unsigned int irq, unsigned long *flags, bool bus,
>>
>> if (desc) {
>> if (check & _IRQ_DESC_CHECK) {
>> - if ((check & _IRQ_DESC_PERCPU) &&
>> - !irq_settings_is_per_cpu_devid(desc))
>> - return NULL;
>> -
>> - if (!(check & _IRQ_DESC_PERCPU) &&
>> + if (!!(check & _IRQ_DESC_PERCPU) !=
>> irq_settings_is_per_cpu_devid(desc))
>> return NULL;
>
> The existing code is readable and obvious. This is not.
Thank you for your review. The existing code is indeed clear, but it
seems that both judgments are checking whether the percpu flags are
consistent.
>
> Thanks,
>
> tglx
next prev parent reply other threads:[~2024-05-07 1:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-06 12:50 Jinjie Ruan
2024-05-06 17:55 ` Thomas Gleixner
2024-05-07 1:16 ` Jinjie Ruan [this message]
2024-05-07 10:20 ` Thomas Gleixner
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=a75c2818-11eb-3f78-1699-94a5b10ef232@huawei.com \
--to=ruanjinjie@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®