From patchwork Thu May 4 20:05:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Desnoyers X-Patchwork-Id: 90242 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp609483vqo; Thu, 4 May 2023 14:09:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5OxONoUXPBSjtr0/Axnx1PzTkzWrn4qEM0+/cLqPHbYQsfDLPbbsv8nir5Xdk6PTH19DDy X-Received: by 2002:a17:90b:3592:b0:247:35c7:bd67 with SMTP id mm18-20020a17090b359200b0024735c7bd67mr3312689pjb.46.1683234589523; Thu, 04 May 2023 14:09:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683234589; cv=none; d=google.com; s=arc-20160816; b=H4lRyet4G5ScKx6w13QDxdbZUNlA/DR7mq6ng3BqZadIVTJ163tKHaggFXaLNcxSWj Rko8xhGVz8MxIpfQxKvDppEkPQNa1Az8p0petTM23rb/VYtCslT2Z51DbZLrstHAUFan oE98PM+A5EqHJcsBYCy2TEHcLYCXuuhqFzpqkyAilJi1GwRkieLjLXZZgqVOqRdMy5On wdSy+eeCbiH/u0y0EFahsgfrdrHeqa53MN52SgkLdXoExoin1CU556U6fcXFEghCXn0q AA8IFNVU8kIOe1aYgWbVQI9T/JxK04SJYuMLuvg3amI2Hzb1VAzIlOYNXPDSfxOgHZbm r5WA== 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 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.09.35; Thu, 04 May 2023 14:09:49 -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 S230327AbjEDVCW (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 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?1764999393099283428?= X-GMAIL-MSGID: =?utf-8?q?1764999393099283428?= 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 */