Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp419901lqh; Tue, 7 May 2024 03:20:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVQ7+JwRxJDP1PhFNP+uBBMMUzo1o+tGnmj4mZaMaUUW2UmnCZXw6xSTPFJgPqfMh2XCMK3ZDqIDYdsHaGqMAgzppHfysY+VRzjHAnDVA== X-Google-Smtp-Source: AGHT+IFrdByRy2tP/kyT3pWh/52TTNEKcKJX+L29SKP6iEXotG5jQULb3ErqDw9GRCp2d0QFw8Hp X-Received: by 2002:a05:6a20:9c8f:b0:1af:ae5e:db89 with SMTP id mj15-20020a056a209c8f00b001afae5edb89mr7992713pzb.61.1715077258184; Tue, 07 May 2024 03:20:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715077258; cv=pass; d=google.com; s=arc-20160816; b=lwLYMbGFOCIP+ffXEEHUCnHmOC+Lv57cpXWY/gpjNhlkcZaTdT9ZOF7RKaA22hDROj 6LY+nyYfewPjLmNFDFoOosBLYbUgJ7gfjRxjELNAJY8DLzPF8K5vV04V8SKDnZVGTLqL UXoHtqzpavW/M6cjGhGL/IH9/DRDdPwUlXvZ4NrcJooZwShzVlzi1IJ5APbxhtHhFFZM A26ZAj3um8mH/ReI30x2o9pndEfhX6BFv3TSySEDihTltVZK5vJKAonGzigxr7SpWN14 rX3RLkoVg7ORpVrJt0eh736RA8PfZ+k5hRCB12QCXLx7SsD7lllygwFHh0dUK8FdpMlf u9FQ== 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:to:dkim-signature :dkim-signature:from; bh=XhEN/ky7pbyVwbgnC9pAsY2qwoBMWLKX+rA0d7wKphA=; fh=T0AyOqJHeXn2dQmt98wiCk+ATLXatPr36HLpzEjftL8=; b=vKWK4jNkXlc+pChuYjgeP6FIURNMd1neu7BsZMnt14mqgkD1g5T/6gXx+MdqFTR87P ocSlzJmMZztjmE5TqvL13tYCKIq9ia7q078LWAUnIo96+SnPkQaTzJ/Cn9NdAT0rLzwN OJtdm4EFZVOEuIF7q9+Swf3jA8+ZH459qc1LAKWkmf7qIvGFfxvCGFfdrcGpKKFM4R1M 3qAxIstmFG0wzLKl9K1fmd9CrfRB19zZ+KcP03ugZNjD+owuO+5nDWjsqBr8JqQ2d20s yd/CqpT7Ixs2Xx8m19+TEpPfrrsf2hSLdE034J2+UU2HVPPxaXqeZKK9xaiuIbReRHpE gUmA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=LeAc4xYv; 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-171078-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171078-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id n2-20020a63e042000000b005fdc959743dsi9569589pgj.260.2024.05.07.03.20.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 03:20:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-171078-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; dkim=pass header.i=@linutronix.de header.s=2020 header.b=LeAc4xYv; 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-171078-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171078-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 8C84B28502C for ; Tue, 7 May 2024 10:20:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8597D14EC72; Tue, 7 May 2024 10:20:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="LeAc4xYv"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="IFhfTbr7" 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 69EC514EC4A for ; Tue, 7 May 2024 10:20:49 +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=1715077250; cv=none; b=jAwuayytrTpr4UrSdopP9SotwSpeJiRvcJa2FYMVte0kMCBJKTZXmrgjzSmufxTxhX4W2S5YQD/v5yFQUqHqBSfqojtQngbl700KwT35mndJ0i6ta8y+kjZMxDC/GYlbiUR8iM7Bt6aVc8FKsLxr2FvVTrGWpaIKv7RSUXoqvks= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715077250; c=relaxed/simple; bh=F4mEaspsKH+C3SRbI+tnMOWwoo2Lhi0QrK0rMcAr70w=; h=From:To:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=cr5A6G2A+plSH8QKrlc5MtPubNe4HJWMWHh9J512sdsmNtXjdyNfZI8g6nk64WaYef2pgliu/qeCXl9xCAUOlxZ2W3JJhu75LaeOzm63ymjO6H9CvV1CwBD135gf8OqEcDL6LeMMho3ewKpHFTTOXIj5+4g/j7wqiKZFBK7Sl1E= 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=LeAc4xYv; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=IFhfTbr7; 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=1715077247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=XhEN/ky7pbyVwbgnC9pAsY2qwoBMWLKX+rA0d7wKphA=; b=LeAc4xYvuqRyPDjZNgFLwy+p6uWE1mzlysZJ7qLSBgAnSVqhNhCue6MpxfCKTJ27X6ZdYp NpWJXBUr7xT2XJATVp0S3pf39Sl9M88CFtz1qDb0QdTQ7mxj/OzII9pEMx4I0UxumiOSi6 QOIsSyVAtaywdlnSKwbmbPcHdzl4AFjOnw/Bo7Bt9r0HSTrakw/4MA3gALTjIQtpqC6vNk 6v/Ye/yyyeosn7GJu1ESJLfj4HJ1vnQV5wCEdPU5ZiuJTOizacXLT4i8Nim/cscv7RY+MW vwzoYrje9R9hU8DaJJoyphxHfQS2QfhFuOshGJ1UgmUio5T9qEtFyricTcjDXA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1715077247; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=XhEN/ky7pbyVwbgnC9pAsY2qwoBMWLKX+rA0d7wKphA=; b=IFhfTbr7iOTQuSa3OVjBVUfyeOPHy9ewZ8aQYlsjcm8WczKXzLkTumecJi+Vqg5USo0lFb wL3ik5chp0oP0uDw== To: Jinjie Ruan , linux-kernel@vger.kernel.org Subject: Re: [PATCH] genirq: Simplify the check for __irq_get_desc_lock() In-Reply-To: References: <20240506125057.307586-1-ruanjinjie@huawei.com> <87seyurfk7.ffs@tglx> Date: Tue, 07 May 2024 12:20:46 +0200 Message-ID: <87bk5hrkht.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 Tue, May 07 2024 at 09:16, Jinjie Ruan wrote: > On 2024/5/7 1:55, Thomas Gleixner wrote: >>> 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. > > Thank you for your review. The existing code is indeed clear, but it > seems that both judgments are checking whether the percpu flags are > consistent. The code checks whether the descriptor is marked as per CPU devid if and only if the caller requested it. As the code exactly doing that, what is the point of changing it to something incomprehensible? Thanks, tglx