From patchwork Thu May 4 20:05:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 90236 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp603716vqo; Thu, 4 May 2023 14:01:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7VzuCkTy2lMnAhMZTqrMrfpd4q3FQBujd3qT7gacYL+FxPwKv4+q/tpHBZ42FZYZYy0uqe X-Received: by 2002:a17:90a:fb41:b0:24e:3254:5d94 with SMTP id iq1-20020a17090afb4100b0024e32545d94mr3189055pjb.40.1683234084487; Thu, 04 May 2023 14:01:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683234084; cv=none; d=google.com; s=arc-20160816; b=vZl0CkvGeD7v1TYqrRX/Hp+1mBNr7PsNnh756hE9c7Go0Qjr97hUFSnEq1ZNjiab9o 9cKdvi09S4o75gZVDDQ5j1Y+/TshjszluC4korCrdQAQdpyzEHI8Aoofho0pw6gd8ixI jTrozGZkAB4tfyiI67u7gmd8xfKIyI9+PdRgntEXJinh/piSoDIn0yVNDxZVoDkoYXRw daQ520wXACfsvmP+kovFguNeoLox+fboAZqA1dd/54vV4jdkPIImFc6YRpjJFPnZ8y8m bij23BAWJZNH9EWEBV3p6o1ZpGKhBPxy2/5Chqgbe+sflI6O3o2b9230ZwbkBIwQ+4L7 l/GA== 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=9ZzIAKfT9InAlFyzxC81nuZuDOW7gOvBeNUt/7jIN3Y=; b=Da0GZxd7SMAEc2ASgJiEb5mUQLQRTxknXOJ7wqi5vW56yOqCzVRu8Hi2D0Yyc6110t XpxQo3km+qrYcSrWPVuy2pEvS+hug4B8xcPpDKyYorHhr6GXKqvSleNfmSH0RsCQ/rsQ 273RPxjCLA6L79/IYh3/qmwk9Zpr1H+qq4PrsgnPUtTWk0+VP7SMs3mhMTPPZhagsjks V+Q4Jb1HpR0cYANAxxA2vaVC1UdanxeH3qgZgBS8jpt8/Tc1WqbNxgBiL0gtZ4u2grQp jo0vEsr2y72wK1YWP31LRgYFQA4bpCGf0kjIxGUNcBBMcMr1jU8DkKsP91GW72t2sVUK jU1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=QKHvDn6H; 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 rm12-20020a17090b3ecc00b0024681cc291csi5136822pjb.88.2023.05.04.14.00.57; Thu, 04 May 2023 14:01:24 -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=QKHvDn6H; 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 S229955AbjEDUsN (ORCPT + 99 others); Thu, 4 May 2023 16:48:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229996AbjEDUry (ORCPT ); Thu, 4 May 2023 16:47:54 -0400 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0725AD22 for ; Thu, 4 May 2023 13:47:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1683230733; bh=dMinXl77eDsU1Swj1Mb43GwAjcr/wXhk2zDxp1xftSo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QKHvDn6Hf3v0PHsQWe1RYRYUrA6cXCyH8x79TPvgUZp1EldRddS1HoRHyXcsej3KL MzttQmErR1tipru+dWJxiPqeOpKCqohr0r0M5qbIOZDWXzAmLatxqJ0tLt1uCERr7M Q1RjExLIPDuvuxS/aMp9Onj9KvtqU/4ZrjjOaZtq1NKCsBDDqRUcsYWyo4xfZ95yBG PUyU6YuACzZPsntH2K4lvKUXxuthxoyYcHxMO9vgdK2AOqRmCg5mK8kNG7hTuoX9W/ gz86VeH9i+KvGq8E07uXrGku3OO+Ub5r/oj/KUnkXfyjd3nMSC3dn7IEDYsroPjZDd V9kHHG34ChNxA== Received: from localhost.localdomain (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4QC4Yn2d43z11qs; Thu, 4 May 2023 16:05:33 -0400 (EDT) From: Mathieu Desnoyers To: Andrew Morton Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers , Eric Dumazet Subject: [RFC PATCH 06/13] list_nulls.h: Fix parentheses around macro pointer parameter use Date: Thu, 4 May 2023 16:05:20 -0400 Message-Id: <20230504200527.1935944-7-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=-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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764998863714793322?= X-GMAIL-MSGID: =?utf-8?q?1764998863714793322?= Add missing parentheses around use of macro argument "pos" in those patterns to ensure operator precedence behaves as expected: - typeof(*tpos) - pos->next 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 Cc: Andrew Morton Cc: Eric Dumazet --- include/linux/list_nulls.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/list_nulls.h b/include/linux/list_nulls.h index fa6e8471bd22..74ffde881e44 100644 --- a/include/linux/list_nulls.h +++ b/include/linux/list_nulls.h @@ -127,8 +127,8 @@ static inline void hlist_nulls_del(struct hlist_nulls_node *n) #define hlist_nulls_for_each_entry(tpos, pos, head, member) \ for (pos = (head)->first; \ (!is_a_nulls(pos)) && \ - ({ tpos = hlist_nulls_entry(pos, typeof(*tpos), member); 1;}); \ - pos = pos->next) + ({ tpos = hlist_nulls_entry(pos, typeof(*(tpos)), member); 1;}); \ + pos = (pos)->next) /** * hlist_nulls_for_each_entry_from - iterate over a hlist continuing from current point @@ -139,7 +139,7 @@ static inline void hlist_nulls_del(struct hlist_nulls_node *n) */ #define hlist_nulls_for_each_entry_from(tpos, pos, member) \ for (; (!is_a_nulls(pos)) && \ - ({ tpos = hlist_nulls_entry(pos, typeof(*tpos), member); 1;}); \ - pos = pos->next) + ({ tpos = hlist_nulls_entry(pos, typeof(*(tpos)), member); 1;}); \ + pos = (pos)->next) #endif