From nobody Sat Feb 7 18:20:45 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54A01EB64DC for ; Fri, 21 Jul 2023 09:04:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230518AbjGUJD6 (ORCPT ); Fri, 21 Jul 2023 05:03:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229554AbjGUJD5 (ORCPT ); Fri, 21 Jul 2023 05:03:57 -0400 Received: from mail.208.org (unknown [183.242.55.162]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5ACEE2D7D for ; Fri, 21 Jul 2023 02:03:54 -0700 (PDT) Received: from mail.208.org (email.208.org [127.0.0.1]) by mail.208.org (Postfix) with ESMTP id 4R6kBF4fR5zBRSTx for ; Fri, 21 Jul 2023 17:03:49 +0800 (CST) Authentication-Results: mail.208.org (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=208.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=208.org; h= content-transfer-encoding:content-type:message-id:user-agent :references:in-reply-to:subject:to:from:date:mime-version; s= dkim; t=1689930229; x=1692522230; bh=cSCFQw9hjDMj+m8XhrzSaZr3Xb5 zOIMnO6//5pRzzUI=; b=SL4/VJC/YYJ5jJy/p/43OSr3VVt5H44t7KQd323F+5C LJwFbfBGpj2hLfeaeeKrrHLFPHUZ7shmrrN98x02ZUyS06ePbdtrr4l9kuyThyzb mppTInvQe/OPpyAlbHrSkATN0BMZx/S8+mNRcVI670J21nAqpgKsS1ajBexq58TV 0gYaHFXSoCWdPvl6soWFbvB3mUbtP+TNkFu8HZSAHspOSCQP+NcGC/2dPpjCA/qL 0vAy/9R6GeQTG3Wyr9gXWQZzVz7cPb64xrLNOtgf6VOi/mxy5NZ4iN9mh5ibfKHh uZmTnXJBDeerD1FmpQFDmPvfGmScTk56IchGX6/nzCg== X-Virus-Scanned: amavisd-new at mail.208.org Received: from mail.208.org ([127.0.0.1]) by mail.208.org (mail.208.org [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id a03nskruB0IP for ; Fri, 21 Jul 2023 17:03:49 +0800 (CST) Received: from localhost (email.208.org [127.0.0.1]) by mail.208.org (Postfix) with ESMTPSA id 4R6kBF1qXNzBJnMj; Fri, 21 Jul 2023 17:03:49 +0800 (CST) MIME-Version: 1.0 Date: Fri, 21 Jul 2023 09:03:49 +0000 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 In-Reply-To: <20230721090248.6331-1-xujianghui@cdjrlc.com> References: <20230721090248.6331-1-xujianghui@cdjrlc.com> User-Agent: Roundcube Webmail Message-ID: X-Sender: sunran001@208suo.com Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8"; format="flowed" Fixes the following checkpatch errors: ERROR: do not use assignment in if condition Signed-off-by: Ran Sun --- 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=20 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,=20 int ioapic, int pin, if (legacy) irq =3D alloc_isa_irq_from_domain(domain, irq, ioapic, pin, &tmp); - else if ((irq =3D irq_find_mapping(domain, pin)) =3D=3D 0) - irq =3D alloc_irq_from_domain(domain, ioapic, gsi, &tmp); + else { + irq =3D irq_find_mapping(domain, pin); + if (irq =3D=3D 0) + irq =3D alloc_irq_from_domain(domain, ioapic, gsi, &tmp); + } else if (!mp_check_pin_attr(irq, &tmp)) irq =3D -EBUSY; if (irq >=3D 0) {