From nobody Wed Feb 11 20:55:49 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D41AC7EE21 for ; Thu, 4 May 2023 20:48:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229975AbjEDUsO (ORCPT ); Thu, 4 May 2023 16:48:14 -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: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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_n= ode *n) #define hlist_nulls_for_each_entry(tpos, pos, head, member) \ for (pos =3D (head)->first; \ (!is_a_nulls(pos)) && \ - ({ tpos =3D hlist_nulls_entry(pos, typeof(*tpos), member); 1;}); \ - pos =3D pos->next) + ({ tpos =3D hlist_nulls_entry(pos, typeof(*(tpos)), member); 1;}); \ + pos =3D (pos)->next) =20 /** * 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_n= ode *n) */ #define hlist_nulls_for_each_entry_from(tpos, pos, member) \ for (; (!is_a_nulls(pos)) && \ - ({ tpos =3D hlist_nulls_entry(pos, typeof(*tpos), member); 1;}); \ - pos =3D pos->next) + ({ tpos =3D hlist_nulls_entry(pos, typeof(*(tpos)), member); 1;}); \ + pos =3D (pos)->next) =20 #endif --=20 2.25.1