mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86/ioapic: do not use assignment in if condition
       [not found] <20230721090248.6331-1-xujianghui@cdjrlc.com>
@ 2023-07-21  9:03 ` sunran001
  0 siblings, 0 replies; only message in thread
From: sunran001 @ 2023-07-21  9:03 UTC (permalink / raw)
  To: tglx, mingo, bp, dave.hansen, x86; +Cc: linux-kernel

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) {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-07-21  9:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20230721090248.6331-1-xujianghui@cdjrlc.com>
2023-07-21  9:03 ` [PATCH] x86/ioapic: do not use assignment in if condition sunran001

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®