mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: sunran001@208suo.com
To: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
	dave.hansen@linux.intel.com, x86@kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] x86/ioapic: do not use assignment in if condition
Date: Fri, 21 Jul 2023 09:03:49 +0000	[thread overview]
Message-ID: <f42427601560dee3e611a6145b6c3b8b@208suo.com> (raw)
In-Reply-To: <20230721090248.6331-1-xujianghui@cdjrlc.com>

Fixes the following checkpatch errors:

ERROR: do not use assignment in if condition

Signed-off-by: Ran Sun <sunran001@208suo.com>
---
  arch/x86/kernel/apic/io_apic.c | 7 +++++--
  1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/apic/io_apic.c 
b/arch/x86/kernel/apic/io_apic.c
index 4241dc243aa8..be32b085d37e 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -1058,8 +1058,11 @@ static int mp_map_pin_to_irq(u32 gsi, int idx, 
int ioapic, int pin,
  		if (legacy)
  			irq = alloc_isa_irq_from_domain(domain, irq,
  							ioapic, pin, &tmp);
-		else if ((irq = irq_find_mapping(domain, pin)) == 0)
-			irq = alloc_irq_from_domain(domain, ioapic, gsi, &tmp);
+		else {
+			irq = irq_find_mapping(domain, pin);
+			if (irq == 0)
+				irq = alloc_irq_from_domain(domain, ioapic, gsi, &tmp);
+		}
  		else if (!mp_check_pin_attr(irq, &tmp))
  			irq = -EBUSY;
  		if (irq >= 0) {

           reply	other threads:[~2023-07-21  9:04 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20230721090248.6331-1-xujianghui@cdjrlc.com>]

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=f42427601560dee3e611a6145b6c3b8b@208suo.com \
    --to=sunran001@208suo.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@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

all inboxes | Powered by JetHome®