Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp20446rwr; Thu, 4 May 2023 14:10:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6zHvAjtXkcLxEKaxlBSlw+5e4AL8mOAaMGcnjWCwcAN8vjrG9G9CyAQcw0A153saF6hwEf X-Received: by 2002:a17:903:32c9:b0:1a6:8ed5:428a with SMTP id i9-20020a17090332c900b001a68ed5428amr6241839plr.22.1683234620138; Thu, 04 May 2023 14:10:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683234620; cv=none; d=google.com; s=arc-20160816; b=BkDqu+L/QhqxEGUb4dOYKCjOH5n8R7ztO2AxhIMJkD8KbuJreIek7nF2EwdKsFK9F/ JUUdLtf0d1sExhsWevM4+l7xUNhXRYcjYvhCicQrsPErT3E5XuUdyYEEczzp0LwM/H2U bcMgFn1tF/SeYhNbu1gT86WBb6ufGhVaoKWnkjjU9lNBkM826/yK2HZtOoFijmDmSVBh k3nB+IlPRc6zG8YpwIPDmbP3OXsdpZboi4EwN4mJDhUT0hmVYJ4oR/deOumVUMbg6Ytq FUK3fQ5zzIDydCFykC/T3XKwjOgXCTKbTbTwdzGApZKa7DYJR05eNSuZYJCfHEPmov2q w6Lw== 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=KqlCASvx3Lriit5qvu9KDdo/u6rvrJrwdo5bXhas5d8=; b=QIihuLUjNchF/M2hQTlnLupXXWuJLcCh9SZFDdBEadRVU+LPkca+pN8XfRTgEPsleU nkvzEie8/YFqyz2Ssc9VBInPEcKDi9BpqUpAWQk5s9hG/ldgRPGQfAP78glSHkUQ+E1r TRkAg3tjct13hoSht4+22GClnQsF6uxXe4jI3+aZ6R7/xNxy1pLUU+kruTM0AFXVS6OW Ak2VPchCHQkYtFZjzkZO+ww+YKqXoBTBxuwK9QMAtlpOck4dgtDaiI09cbjH6qBFivXK DN1K1afP3doyzonXpI/N/JMY9uuN10ZSgme5qEBLAKKx6oM3q1o6gpV8XLaS7nsZ8oF9 mLnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=j4elbQnq; 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 t10-20020a170902e84a00b0019a826d3054si37968957plg.640.2023.05.04.14.10.07; Thu, 04 May 2023 14:10:20 -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=j4elbQnq; 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 S230314AbjEDVCW (ORCPT + 99 others); Thu, 4 May 2023 17:02:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230502AbjEDVBo (ORCPT ); Thu, 4 May 2023 17:01:44 -0400 Received: from smtpout.efficios.com (unknown [IPv6:2607:5300:203:b2ee::31e5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A04CCAD25; Thu, 4 May 2023 14:01:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1683230734; bh=4eWXzqJGW3r8CsJlCJi50P2D2+UPMfjU80F5mDNGm64=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j4elbQnqRi3jTLzFpSiA0lk6IUePnELvzLSch+U+lB44pmffUULxho7cstr32fRmp yyx1I+uF0AnCbCfOeFuhbpm9M+MKLg3C4I0HuLxBmbbEeVApWLWZDZ8PL8JKHyf52K 13KvbCwD6QqP5tZR/5f610cJ4pLH1mRtE2vw0WUp2+pvQuWZgzCXbomISIxP/sd/u7 cA0w22qS71+/mFkQ6qgxcoQVSCrPm+fOwAuiNHV/Ve2xDcRtJT8qpXrdm/z12eKFGR T3pJWBfjoN+FX3vOSg9dJ8gqXIA00bDqrxNK+2LL6Y+7FuE0di03m3j7FiuY4jVvTT CFcEQmkiCs0/A== Received: from localhost.localdomain (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4QC4Yp2nzCz11jJ; Thu, 4 May 2023 16:05:34 -0400 (EDT) From: Mathieu Desnoyers To: Andrew Morton Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org Subject: [RFC PATCH 11/13] netdevice.h: Fix parentheses around macro parameter use Date: Thu, 4 May 2023 16:05:25 -0400 Message-Id: <20230504200527.1935944-12-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=-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 Add missing parentheses around macro parameter use in the following pattern: - "x - 1" changed for "(x) - 1", - "x->member" changed for "(x)->member". to ensure operator precedence behaves as expected. Remove useless parentheses around macro parameter use in the following pattern: - m((x), y) changed for m(x, y), because comma has the lowest operator precedence, which makes the extra comma useless. Signed-off-by: Mathieu Desnoyers Cc: Andrew Morton Cc: "David S. Miller" Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: netdev@vger.kernel.org --- include/linux/netdevice.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 08fbd4622ccf..5a357262a45b 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -283,7 +283,7 @@ struct hh_cache { /* cached hardware header; allow for machine alignment needs. */ #define HH_DATA_MOD 16 #define HH_DATA_OFF(__len) \ - (HH_DATA_MOD - (((__len - 1) & (HH_DATA_MOD - 1)) + 1)) + (HH_DATA_MOD - ((((__len) - 1) & (HH_DATA_MOD - 1)) + 1)) #define HH_DATA_ALIGN(__len) \ (((__len)+(HH_DATA_MOD-1))&~(HH_DATA_MOD - 1)) unsigned long hh_data[HH_DATA_ALIGN(LL_MAX_HEADER) / sizeof(long)]; @@ -4459,7 +4459,7 @@ static inline void netif_tx_unlock_bh(struct net_device *dev) } #define HARD_TX_LOCK(dev, txq, cpu) { \ - if ((dev->features & NETIF_F_LLTX) == 0) { \ + if (((dev)->features & NETIF_F_LLTX) == 0) { \ __netif_tx_lock(txq, cpu); \ } else { \ __netif_tx_acquire(txq); \ @@ -4467,12 +4467,12 @@ static inline void netif_tx_unlock_bh(struct net_device *dev) } #define HARD_TX_TRYLOCK(dev, txq) \ - (((dev->features & NETIF_F_LLTX) == 0) ? \ + ((((dev)->features & NETIF_F_LLTX) == 0) ? \ __netif_tx_trylock(txq) : \ __netif_tx_acquire(txq)) #define HARD_TX_UNLOCK(dev, txq) { \ - if ((dev->features & NETIF_F_LLTX) == 0) { \ + if (((dev)->features & NETIF_F_LLTX) == 0) { \ __netif_tx_unlock(txq); \ } else { \ __netif_tx_release(txq); \ @@ -4534,7 +4534,7 @@ static inline void netif_addr_unlock_bh(struct net_device *dev) * rcu_read_lock held. */ #define for_each_dev_addr(dev, ha) \ - list_for_each_entry_rcu(ha, &dev->dev_addrs.list, list) + list_for_each_entry_rcu(ha, &(dev)->dev_addrs.list, list) /* These functions live elsewhere (drivers/net/net_init.c, but related) */ @@ -5237,6 +5237,6 @@ extern struct net_device *blackhole_netdev; /* Note: Avoid these macros in fast path, prefer per-cpu or per-queue counters. */ #define DEV_STATS_INC(DEV, FIELD) atomic_long_inc(&(DEV)->stats.__##FIELD) #define DEV_STATS_ADD(DEV, FIELD, VAL) \ - atomic_long_add((VAL), &(DEV)->stats.__##FIELD) + atomic_long_add(VAL, &(DEV)->stats.__##FIELD) #endif /* _LINUX_NETDEVICE_H */ -- 2.25.1