All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Jinjie Ruan <ruanjinjie@huawei.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] genirq: Simplify the check for __irq_get_desc_lock()
Date: Tue, 07 May 2024 12:20:46 +0200	[thread overview]
Message-ID: <87bk5hrkht.ffs@tglx> (raw)
In-Reply-To: <a75c2818-11eb-3f78-1699-94a5b10ef232@huawei.com>

On Tue, May 07 2024 at 09:16, Jinjie Ruan wrote:
> On 2024/5/7 1:55, Thomas Gleixner wrote:
>>>  	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.

The code checks whether the descriptor is marked as per CPU devid if and
only if the caller requested it.

As the code exactly doing that, what is the point of changing it to
something incomprehensible?

Thanks,

        tglx

      reply	other threads:[~2024-05-07 10:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-06 12:50 [PATCH] genirq: Simplify the check for __irq_get_desc_lock() Jinjie Ruan
2024-05-06 17:55 ` Thomas Gleixner
2024-05-07  1:16   ` Jinjie Ruan
2024-05-07 10:20     ` 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=87bk5hrkht.ffs@tglx \
    --to=tglx@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ruanjinjie@huawei.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: link
Be 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.