Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp50749lqh; Mon, 6 May 2024 10:55:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV9NS6FvYMACmxCDtnUZ26TgSpTZy/CrdoeOEerB7uD63U85kjqxGjxJKOvFDZlq87E3PMakz5ufOgn/cRd4Ei7Qjw4mx5p/Gv7y34sgg== X-Google-Smtp-Source: AGHT+IFSGxsYnXmAQspIgwJkeH/8L7ZnwF9hXsrApFRn11b0cuk5IteSLTMFNWTjAvx7hwdd83tG X-Received: by 2002:a05:6a00:4f83:b0:6e6:5396:ce43 with SMTP id ld3-20020a056a004f8300b006e65396ce43mr14244309pfb.7.1715018125017; Mon, 06 May 2024 10:55:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715018125; cv=pass; d=google.com; s=arc-20160816; b=cdS/17PzY4rkbSkKKkfjJqE8YvAkvLOmpDD2+7lC0RILDntghChhwjVlO0Eh/fimw5 ysDYlp3qkvFj6YD+EfXrsbz2MsDHUS8U2VPyT+PaiY4J7TMevW7nizHEnVlBSwRgjLjJ EJ6Rl5GstQZTnLmrCOugMgkG15ZTjSxDHrXah3bhPJJcaNdQLQotZdNAHDbAPM9XekVj jQBKbOGtpWYsvbQyMTrtg8nS0HpOb8OQjPCgkSIJx5+0L1ZbwsneN/SmG8KJ7rsXQlDG J1+Vganb8osnw0UTOKF9EHTFhWl/kxcBg2T4o5v1rZlxmn9t7cuSPPgocyPsjFt/qXEy 89cg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=U51dnmYHkLKYOuLjpfA/M9qO4l6bj3W7dZL4udcjMGM=; fh=E762zwGjlneN3nVefwferRmxrYPVMeB4RPy755j6/pg=; b=DLykDPNG8T3bDl1jSu2fomS2rm3nai2G1r1Vusg7LzoM3UHf2+LLteD0LJhIetrI3q CRGPHBIjsxWC/llRUfSGSaFFOkO+nygcZC+6gpEm1MBtNdk1Sbgrekou+sEx9DZ0udFQ HS5BsXxKlfeYCg5+DOtC1tNU/UFPowWmC7avWOePKEQfKdkMpW4OiBiqfh3EP/BmLiGK 32eNtJN/U9YL//nqAmwvXpzZd2+5gzc55YqeL1XQkkm9F8eyp7lGH8GSe2Qi1i72+0kX 6zg9yi+/Tykz12xg7clJUCfaKQYxiq8SJr6RA8RsP2sMh0POYlYYEJJgIyKRKIQJM5ny YPKA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=yz0LYfni; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-170258-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170258-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d123-20020a633681000000b0061c6e36e28dsi7497108pga.125.2024.05.06.10.55.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 10:55:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170258-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=yz0LYfni; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-170258-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170258-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de 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 F01F82832B2 for ; Mon, 6 May 2024 17:55:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3DAB8158A03; Mon, 6 May 2024 17:55:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="yz0LYfni"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="q7kGooUr" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 F100B158844 for ; Mon, 6 May 2024 17:55:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715018108; cv=none; b=BPo5JoBPQIEIJl6J8e8p38HK3SXdUkHXqeR6fGwped66C/SACEnNBlToo8mjB/tYT8fel2grVWkFFxwSwbLdEwvDbSB9n9jfzgDR7j9sNS/Raux8vWHwqHjVgpR7uFy+sSp5a0aUUiGz4RzDzgb6agU8dCWgTtgL3OHHQDOEXjQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715018108; c=relaxed/simple; bh=n27Qz5MtRxSJNQb6ApH8VngkuT8JGmIHQ5xZYNGihXk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=s3mvBuHwITfDLJZGo5OnxEVMXZRU9yYBn+CdhIS7Cdby0bdANNmfZOI7/fJJzurAHziBDGSjN2WcIQfxSZa77KT/SNCEpbp6j1HJq4nk2MzS3iAssuPVNEudsY3xrYWMA+bMEUCqmbDll/ntXLQUAL99bydc3YcxOzR2lRKBYGg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=yz0LYfni; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=q7kGooUr; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1715018105; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=U51dnmYHkLKYOuLjpfA/M9qO4l6bj3W7dZL4udcjMGM=; b=yz0LYfniCXAqDLQpoqs2QJTst6IGAckzLShFyVDzoht69vAPo5gvnsJq8uYd2pDr4j5S+N i/KmTlM+StmxVxnXP6Z8xseVoSUHM96QiiyMQXItk9vhGCAQ8SicQk9qm6fQrVjtn06tCL ZIhCOP9YBje7c1rE1ykEbpK4/Hmb5fLb8W8ddv5eD7UJsOHlDAbLBvwWJhJC+soKfRewao 0mjnLJcav2d1gkY5llEaFIH8wcrgEkwrM77OB84BkO58te3CfUx3s9s2lUaO/rMhP6Z2Wt TLSiTaa8NuYzh0m/Qy9Wfp2yGY6kA73TTd+KeMZNmzw7IjzdFq7d3vKKYuOQ8w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1715018105; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=U51dnmYHkLKYOuLjpfA/M9qO4l6bj3W7dZL4udcjMGM=; b=q7kGooUrRBeypvxmuEZeZ3ywzccEJ7NeyBhKMk479RoRLt58eK1/EvddwtMpTLN0h9cddc uZDa6VvliAloLmAg== To: Jinjie Ruan , linux-kernel@vger.kernel.org Cc: ruanjinjie@huawei.com Subject: Re: [PATCH] genirq: Simplify the check for __irq_get_desc_lock() In-Reply-To: <20240506125057.307586-1-ruanjinjie@huawei.com> References: <20240506125057.307586-1-ruanjinjie@huawei.com> Date: Mon, 06 May 2024 19:55:04 +0200 Message-ID: <87seyurfk7.ffs@tglx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Mon, May 06 2024 at 20:50, Jinjie Ruan wrote: > 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 "!=". What is exactly simplified here? > 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; The existing code is readable and obvious. This is not. Thanks, tglx