From patchwork Thu May 4 20:05:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 90240 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp608183vqo; Thu, 4 May 2023 14:07:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5ZkX13cR4wGYXuDo4uI98aoC+xAwqYf4t9WGoKpi+FpFwNPy6IeGIOv/WGbnQ8YolaiA74 X-Received: by 2002:a17:902:e5c9:b0:1aa:fe23:a7f8 with SMTP id u9-20020a170902e5c900b001aafe23a7f8mr5399995plf.59.1683234452242; Thu, 04 May 2023 14:07:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683234452; cv=none; d=google.com; s=arc-20160816; b=SvL3qVGHWyJ5inkyA20/qjUbIyHz155K8p+DlGOV0wXhDVYNg1AahV20iu6T6SvLEu BUiUC9V7B462ZOt4uinEaxXQR/Tq4nN1umoroLhUiSM43f+daA6hQXW4k88NbPJnH2rQ SUoe+j+pozfA+f8dyftk6kLArloRNXKqZ7VuvcL75rVCrXRmSKJxh2hklQiCKoS9EVqn bs2Fg9PpMqX5SBMx01zs6pAtS4k0XbvDVT8CA5jVWqQDAEly0NhTR9A1tOzY9YdtbghG WRj7tjHrsQSsBFgqRRTet3bDeoGv0Ir57ais/RBGOeM2iAK0DldsCJZjjGhBCTFglQOR fxZg== 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=3fyNm0wVVcT/TLXXDeU2ch8hRopaezBDb3vsoRrtbiQ=; b=CkfiGz312NUPuBMjsZoYn8E9ypbjtO9C6G+ZIcx8qDuaOH0OlF0FIX3Xl1Z3FVUTPe H6vuC/ENXxbadfplvZ1DL8HPom7SP9GqUhpuoCUaetvM0aenkK6CBCy1hUNRVXcdQoT1 BB5idRumeHCDwWLmqJrC8Owa7GIC/S44HxPEEcw79Z6k9Rbiqu1xx/vcZPl6ql9vckFj 2EmsqHWbEwllAoO5Zia3i6r3yjdH7Yjzirtyzw3k3sxmpspfdCnRcfQC7gRwzBFNqYlf 5SMFOD/QleIdYWEYeZw9V6Yc6NSlzYjq9/xP7BgnwMaoRogmmXWznMTwpbmz2FOggoci DXMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=N0jaaMPN; 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 t10-20020a170902e84a00b0019a826d3054si37968957plg.640.2023.05.04.14.07.17; Thu, 04 May 2023 14:07: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=N0jaaMPN; 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 S229906AbjEDVBi (ORCPT + 99 others); Thu, 4 May 2023 17:01:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230369AbjEDVBS (ORCPT ); Thu, 4 May 2023 17:01:18 -0400 Received: from smtpout.efficios.com (unknown [IPv6:2607:5300:203:b2ee::31e5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0E8313C10; Thu, 4 May 2023 14:00:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1683230732; bh=D/NfiDdblr1nISgkSaCGt1uzTz4bykGLb/1bVKOEMww=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N0jaaMPNt4wgec6S+UXVf+cRhRvvT7e7d14PG5ZkCYpwfQLOYyu0n1nDOZ8A6bhye ut3K1V5mWn/K8ziXFRU222jQPbdpUQti5+xKhlOuewRc8MWNrqDlJsRURvhWRSVT0t JMUnH3+xGstJ6bHBVPMTU8yrcg37TV3CFoIK0/1pOgHNMP8MxJbMQvtiqUiUAX5vjB Frip0V51Cjqsk/ZCtfgWKK0tjDkrEEN7Uj22K+8O2hqobuOOuAEzgaeKRgXU1cIAou ze0+ixYVLRr909UzlBGQf6Z4zQu4zA8gsElrCqoImMeu58ksiVa6D5N6HXYmnUdgvj sxdzMviQL1VRw== Received: from localhost.localdomain (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4QC4Ym3GV2z122c; Thu, 4 May 2023 16:05:32 -0400 (EDT) From: Mathieu Desnoyers To: Andrew Morton Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers , Alexei Starovoitov , "Paul E. McKenney" , Frederic Weisbecker , Neeraj Upadhyay , Joel Fernandes , Josh Triplett , Boqun Feng , Steven Rostedt , Lai Jiangshan , Zqiang , rcu@vger.kernel.org Subject: [RFC PATCH 03/13] rculist_nulls.h: Add parentheses around macro pointer parameter use Date: Thu, 4 May 2023 16:05:17 -0400 Message-Id: <20230504200527.1935944-4-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 X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RDNS_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764999249169056121?= X-GMAIL-MSGID: =?utf-8?q?1764999249169056121?= Add parentheses around use of macro argument "tpos" in those patterns to ensure operator precedence behaves as expected: - typeof(*tpos) 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 with other list iteration code across the kernel tree. Signed-off-by: Mathieu Desnoyers Cc: Andrew Morton Cc: Alexei Starovoitov Cc: "Paul E. McKenney" Cc: Andrew Morton Cc: Frederic Weisbecker Cc: Neeraj Upadhyay Cc: Joel Fernandes Cc: Josh Triplett Cc: Boqun Feng Cc: Steven Rostedt Cc: Lai Jiangshan Cc: Zqiang Cc: rcu@vger.kernel.org --- include/linux/rculist_nulls.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/rculist_nulls.h b/include/linux/rculist_nulls.h index ba4c00dd8005..6e56dd2daecf 100644 --- a/include/linux/rculist_nulls.h +++ b/include/linux/rculist_nulls.h @@ -168,7 +168,7 @@ static inline void hlist_nulls_add_fake(struct hlist_nulls_node *n) for (({barrier();}), \ pos = rcu_dereference_raw(hlist_nulls_first_rcu(head)); \ (!is_a_nulls(pos)) && \ - ({ tpos = hlist_nulls_entry(pos, typeof(*tpos), member); 1; }); \ + ({ tpos = hlist_nulls_entry(pos, typeof(*(tpos)), member); 1; }); \ pos = rcu_dereference_raw(hlist_nulls_next_rcu(pos))) /** @@ -183,7 +183,7 @@ static inline void hlist_nulls_add_fake(struct hlist_nulls_node *n) for (({barrier();}), \ pos = rcu_dereference_raw(hlist_nulls_first_rcu(head)); \ (!is_a_nulls(pos)) && \ - ({ tpos = hlist_nulls_entry(pos, typeof(*tpos), member); \ + ({ tpos = hlist_nulls_entry(pos, typeof(*(tpos)), member); \ pos = rcu_dereference_raw(hlist_nulls_next_rcu(pos)); 1; });) #endif #endif