Message ID | 20230504200527.1935944-5-mathieu.desnoyers@efficios.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp597240vqo; Thu, 4 May 2023 13:46:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6nBZWN41M8eMvDUeNofzmypFVbHCV5D1GUpFzNLJMdK7+udd/EmLSdjyrtlFiXVGkNdqbS X-Received: by 2002:a17:902:768c:b0:1aa:e0c4:54e8 with SMTP id m12-20020a170902768c00b001aae0c454e8mr4552395pll.28.1683233192416; Thu, 04 May 2023 13:46:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683233192; cv=none; d=google.com; s=arc-20160816; b=dAixZO3ojSng2drf/v07HSzP4FloN8/8IAbpi3X9lcSIezS9N68aiexKEDaUsvrkwh 0w6igLVHmsr23lBsP3TTc6LHGY+auiYmiWvcF7yer9ZGH/ShAO6hZDOmjXj3t7fdbxnJ FMnHkmhT9GgQwVhYVn0V0/F7rVApqmL45Ly6qvvTHjb2++ptmHAiTNvmkvU6XmLmVlPH 7BUz3o9mB1hw7sIkduV0BgNQdDItTvqVYrF2XRV+iogh4SaLRw59xFG7upvTMmjLePGn pMjHDL+2ZNr6Wy2YBvlIgkeYrB3z3gbxbzRbc4kmmqPFDuKjXZg5VhSYFIJuuaSKfEhf RQSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=TAz6OqpaDHPyJTHK6/RmvvqS7GhmEj0Kkzr4nF+F4d8=; b=fl0zVWrKI8n8BfuEnxGvPM9RYFBe8QH3Ymo2RAbCABPAIOijJhP4JWDp9ES7TTvXkD HgyLTg8EjESbqX6ujHbiYzsRntLw2OYyD/M2qsliNZSQxul9nEZ9T1vJmyXxALyUwhwr 2c9KZER6EB9n+hb71+QYnrhXQlkKCOYecvlMnTvLbOyGMbtjbZd5PiY/GCbCldT54zT1 H0EA79JLCXI9xz+7GdDpGECW1rhPJ2c2RlwbZMV/1ulWEBEaOXJuEhLw9OCPwCrOe8Pb awWiVmj3Tpok41HQqN6gCnZ5wqR9TEwNyAuhkS1IjSQW1yrHqi0lvWgC4KXIzyKZwbI9 NBiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=IfKCIjYQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 14-20020a17090a004e00b0024e52b03440si3913556pjb.101.2023.05.04.13.46.19; Thu, 04 May 2023 13:46:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=IfKCIjYQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230123AbjEDUch (ORCPT <rfc822;b08248@gmail.com> + 99 others); Thu, 4 May 2023 16:32:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231196AbjEDUcU (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 4 May 2023 16:32:20 -0400 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9267E19434; Thu, 4 May 2023 13:22:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1683230733; bh=ZEKk2l+avXLFbsd5WjSG9znQ65K2KXiDXgyV8vZ7EJA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IfKCIjYQSXozgD4Wb+wSwBd+stdAcMsdT2i7VdXVhDqafbIW98tLuRfWIBLQZ+upQ 5cHlYfTa3Xacv7BcJRQjH/KgIlprqL2os0yCC4v5U1jBnVjjzAOo8SbzbhlzvKzMbr xsgD+dGSe18n+gif1kzPhm7D/VrQEw+jlmdRLLTOHI+fz8FHAT+PohpHF2J7q1HDPH x2iH82MRkVPYP9LF5JDu/DNky5u5fcl2ZbUWmIH8cL3c6qvJNMbGCOILIGskgK9xjy OpOb1k8U26ecYsStldMJQXyZQUN/oCdD/EusL/yddPWCrmAcHo8IK1GDvFgkHgoSZ6 9raHAvS4UD5rg== Received: from localhost.localdomain (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4QC4Ym5dLWzxRJ; Thu, 4 May 2023 16:05:32 -0400 (EDT) From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> To: Andrew Morton <akpm@linux-foundation.org> Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers <mathieu.desnoyers@efficios.com>, "Paul E. McKenney" <paulmck@kernel.org>, Frederic Weisbecker <frederic@kernel.org>, Neeraj Upadhyay <quic_neeraju@quicinc.com>, Joel Fernandes <joel@joelfernandes.org>, Josh Triplett <josh@joshtriplett.org>, Boqun Feng <boqun.feng@gmail.com>, Steven Rostedt <rostedt@goodmis.org>, Lai Jiangshan <jiangshanlai@gmail.com>, Zqiang <qiang1.zhang@intel.com>, rcu@vger.kernel.org Subject: [RFC PATCH 04/13] rculist_bl.h: Fix parentheses around macro pointer parameter use Date: Thu, 4 May 2023 16:05:18 -0400 Message-Id: <20230504200527.1935944-5-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230504200527.1935944-1-mathieu.desnoyers@efficios.com> References: <20230504200527.1935944-1-mathieu.desnoyers@efficios.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764997927556058725?= X-GMAIL-MSGID: =?utf-8?q?1764997927556058725?= |
Series |
Fix parentheses around macro parameter use in headers
|
|
Commit Message
Mathieu Desnoyers
May 4, 2023, 8:05 p.m. UTC
Add missing parentheses around use of macro argument "tpos" in those
patterns to ensure operator precedence behaves as expected:
- typeof(*tpos)
- pos->next
- x && y is changed for (x) && (y).
The typeof(*tpos) lack of parentheses around "tpos" is not an issue per se
in the specific macros modified here because "tpos" is used as an lvalue,
which should prevent use of any operator causing issue. Still add the
extra parentheses for consistency.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: "Paul E. McKenney" <paulmck@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Frederic Weisbecker <frederic@kernel.org>
Cc: Neeraj Upadhyay <quic_neeraju@quicinc.com>
Cc: Joel Fernandes <joel@joelfernandes.org>
Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Boqun Feng <boqun.feng@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Lai Jiangshan <jiangshanlai@gmail.com>
Cc: Zqiang <qiang1.zhang@intel.com>
Cc: rcu@vger.kernel.org
---
include/linux/rculist_bl.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/linux/rculist_bl.h b/include/linux/rculist_bl.h index 0b952d06eb0b..798c0a03bf5c 100644 --- a/include/linux/rculist_bl.h +++ b/include/linux/rculist_bl.h @@ -94,8 +94,8 @@ static inline void hlist_bl_add_head_rcu(struct hlist_bl_node *n, */ #define hlist_bl_for_each_entry_rcu(tpos, pos, head, member) \ for (pos = hlist_bl_first_rcu(head); \ - pos && \ - ({ tpos = hlist_bl_entry(pos, typeof(*tpos), member); 1; }); \ - pos = rcu_dereference_raw(pos->next)) + (pos) && \ + ({ tpos = hlist_bl_entry(pos, typeof(*(tpos)), member); 1; }); \ + pos = rcu_dereference_raw((pos)->next)) #endif