Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp11209rwr; Thu, 4 May 2023 14:02:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5qS/BW0WEn8MtOhKEHRU3AcK+nNDuQCOVNohw7sPz2DK67hRC3aoXcX+ONxeAofRdro5HE X-Received: by 2002:a17:902:b213:b0:1aa:f5dd:2d63 with SMTP id t19-20020a170902b21300b001aaf5dd2d63mr4472830plr.1.1683234157748; Thu, 04 May 2023 14:02:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683234157; cv=none; d=google.com; s=arc-20160816; b=cXUnuIO7rqbHWsmb7C4X2UcrENQj2nD7LqNh/L8Ez7L3GRzCKDb1eDArZZHK59vpNJ +UbzgzwExUzVWxUf30R0qy/+3S/nLFSJB2ubiuOTpIPHaYo616bBcrGaqzyPjLcZQPsz dvCHTB+/ZkodPhrewgpFQ07U2ZSnRJ6Rtlgtyo2RSCeSnOaaHxyeEwTM88Eu83b5uKnO cMoztvXYvfbsF89EV6ehykv8o+MR+tkl/nmQxzXtYcTlI14zsPSzADgLAqRW/wUHnHC4 syoy8ERR4yVDI8I8tCjrH27RLX9xJfZvO5w+X24Yd59snqmHrEWnwjAhM3Vl6/yTDJN3 sgVg== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e9-20020a170903240900b001a6ee332903si35476574plo.347.2023.05.04.14.02.24; Thu, 04 May 2023 14:02:37 -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 S229928AbjEDUsN (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 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: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- 2.25.1