Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp1371571lqh; Mon, 6 May 2024 06:03:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXBvLuG4AYkEtfsmjzPf+cVYcaTD2Bp41J0TjClht9l5SleFbOUzT6FDglG8OvA1aYUjCTjTz5g+RNXUVBMpsgp8VPrsMchYU/FCN20LQ== X-Google-Smtp-Source: AGHT+IGjozRwJiNbipBZsPSDlklX6Wd8bEX1MP5ND1dhbDlAd0Rfd6Q7BISUONSpyLAkrm/uWgo5 X-Received: by 2002:a05:6808:2014:b0:3c9:62d9:4ea0 with SMTP id q20-20020a056808201400b003c962d94ea0mr6925124oiw.48.1715000596374; Mon, 06 May 2024 06:03:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715000596; cv=pass; d=google.com; s=arc-20160816; b=dDsAJa4U96C+qS7uKUxKJBLPwWX5pC9vCRalQhoUTD9rkzsSfVt+Hl6j66S8OOk6pR xwnWOYommraeP71dN6LsRxKpK/NgvCeD8Q1FVVMRLewzz4hNMkd5JixCX9PC1lX8sAPo AZxrUnOPTzirmvzQBYfSlJzJKFDH8qbcPQHfzuz2sy/fZ2R3qpA96+ovsZzJwNkLruON ROtkTXZDev7GlDGjZXEzWcKdiCosIotjnM6CjS4sXiSv1hMVRI6kJltd9gkiHtQsBbXx BuggusBIdVv5ZM0IOaMukxfVDF74+Ywh6iPyXYed6uWEg9Sxi6uF62YJMITD5tC75Vtn 4Rcg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=ap/evQ3easLv4/5RWO3zO3NT+nc7FN0NGIqK/mQm7V4=; fh=iQIEIpegfxGHAXzmCmQbfua7u3pb28YTuJpmY/Z0V14=; b=y/8agzyOYC6mszSvBOj5nCtorLfXrY01l9PlIC4OgzKpsUDTYToxQta1r5IkmsySKJ 2Nm1Fweqo+PFOPAaEgjjZ55E4qiR2EwMWewH10nIGQv33F12uNlpMY5LUUrrHTCvT7Vx WSJOMhpC6LwUikvm7sacPwMYrxkUg67Yua1/7fHPD1+8Ux7tRQbhwgrE49408VZRg2Dt 9iqdOm9gRtjl3QdSlUUWVoYJyiLzE7JD0XjNFAT7hZDcIa1UF0XENkBiIAuk/BqqC03b 6lKxH5L51jBCwtsJx6Roz6l8QJS/epgBl/reij+p5cr8qOrOV5vItH7t9bKGFm1Eh2aP 1VWg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-169842-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169842-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id k6-20020a0568080e8600b003c7533c8323si3172710oil.11.2024.05.06.06.03.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 06:03:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-169842-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huawei.com dmarc=pass fromdomain=huawei.com); spf=pass (google.com: domain of linux-kernel+bounces-169842-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169842-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 84E65289F13 for ; Mon, 6 May 2024 12:51:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C82794EB45; Mon, 6 May 2024 12:51:51 +0000 (UTC) Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 682E81DFED for ; Mon, 6 May 2024 12:51:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.255 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714999911; cv=none; b=MXPyJX66LaWyC30JYMguOIcPyjlAXVqcTrtyrwa0ycRCaT1JMjVIP1088FRFMHhqPRNFKeuhWLVc8Oo30yGm3TzJnTQykzj94dtR5paInkH+f0yx0sSuDWQqATqlH7pKt5vHqB1/ulZ1dyP9AGUprsLsEfKQN3Y287UaNqrEdSI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714999911; c=relaxed/simple; bh=1KXzSoo3QAex6UeVIC3bVa80QNaS8yOCfTa9OgS4nok=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=GDqyBa52nnIj/TkhzLObnWfdw8xg6xv70z7sk9ZnJsuQ9MjIYN3CWQ4C0Hp1BJ1rYirihOywgDCi5SggrRiA6qsArzu74nkNqZ8/vwP0Dn0M4wqSzr9YoC1Ycg7kZeEtEvRClEQxwNgqyzHEyvYb5vfQSos55ttfoJRiQ7WGfnk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.255 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.162.254]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4VY1Rc3kq8z1RBpv for ; Mon, 6 May 2024 20:48:28 +0800 (CST) Received: from kwepemi500008.china.huawei.com (unknown [7.221.188.139]) by mail.maildlp.com (Postfix) with ESMTPS id C85DD1800C9 for ; Mon, 6 May 2024 20:51:45 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemi500008.china.huawei.com (7.221.188.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Mon, 6 May 2024 20:51:45 +0800 From: Jinjie Ruan To: , CC: Subject: [PATCH] genirq: Simplify the check for __irq_get_desc_lock() Date: Mon, 6 May 2024 20:50:57 +0800 Message-ID: <20240506125057.307586-1-ruanjinjie@huawei.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemi500008.china.huawei.com (7.221.188.139) 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 "!=". Signed-off-by: Jinjie Ruan --- 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; } -- 2.34.1