From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 01460A0561 for ; Thu, 18 Mar 2021 10:33:58 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F0CFB140F34; Thu, 18 Mar 2021 10:33:57 +0100 (CET) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mails.dpdk.org (Postfix) with ESMTP id AB417140F1B for ; Thu, 18 Mar 2021 10:33:56 +0100 (CET) Received: by dpdk.org (Postfix, from userid 1017) id A6B9E5A8C; Thu, 18 Mar 2021 10:33:56 +0100 (CET) In-Reply-To: <20210318093208.17824-7-jiawenwu@trustnetic.com> References: <20210318093208.17824-7-jiawenwu@trustnetic.com> To: test-report@dpdk.org Cc: Jiawen Wu Message-Id: <20210318093356.A6B9E5A8C@dpdk.org> Date: Thu, 18 Mar 2021 10:33:56 +0100 (CET) From: checkpatch@dpdk.org Subject: [dpdk-test-report] |WARNING| pw89476 [PATCH 6/6] net/ngbe: define registers X-BeenThere: test-report@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: automatic DPDK test reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: test-report-bounces@dpdk.org Sender: "test-report" Test-Label: checkpatch Test-Status: WARNING http://dpdk.org/patch/89476 _coding style issues_ CHECK:MACRO_ARG_REUSE: Macro argument reuse 'y' - possible side-effects? #107: FILE: drivers/net/ngbe/base/ngbe_regs.h:35: +#define ROUND_UP(x, y) (((x) + (y) - 1) / (y) * (y)) CHECK:MACRO_ARG_REUSE: Macro argument reuse 'y' - possible side-effects? #108: FILE: drivers/net/ngbe/base/ngbe_regs.h:36: +#define ROUND_DOWN(x, y) ((x) / (y) * (y)) CHECK:MACRO_ARG_REUSE: Macro argument reuse 'x' - possible side-effects? #109: FILE: drivers/net/ngbe/base/ngbe_regs.h:37: +#define ROUND_OVER(x, maxbits, unitbits) \ + ((x) >= 1 << (maxbits) ? 0 : (x) >> (unitbits)) CHECK:MACRO_ARG_REUSE: Macro argument reuse 'tc' - possible side-effects? #840: FILE: drivers/net/ngbe/base/ngbe_regs.h:768: +#define NGBE_PBTXSTAT_EMPT(tc, r) ((1 << (tc) & (r)) >> (tc)) WARNING:TYPO_SPELLING: 'sting' may be misspelled - perhaps 'string'? #1347: FILE: drivers/net/ngbe/base/ngbe_regs.h:1275: +#define NVM_VER_SIZE 32 /* version sting size */ CHECK:MACRO_ARG_REUSE: Macro argument reuse 'last' - possible side-effects? #1355: FILE: drivers/net/ngbe/base/ngbe_regs.h:1283: +#define NGBE_UPDCNT32(reg, last, cur) \ +do { \ + uint32_t latest = rd32(hw, reg); \ + if (hw->offset_loaded || hw->rx_loaded) \ + last = 0; \ + cur += (latest - last) & UINT_MAX; \ + last = latest; \ +} while (0) CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'cur' may be better as '(cur)' to avoid precedence issues #1355: FILE: drivers/net/ngbe/base/ngbe_regs.h:1283: +#define NGBE_UPDCNT32(reg, last, cur) \ +do { \ + uint32_t latest = rd32(hw, reg); \ + if (hw->offset_loaded || hw->rx_loaded) \ + last = 0; \ + cur += (latest - last) & UINT_MAX; \ + last = latest; \ +} while (0) CHECK:MACRO_ARG_REUSE: Macro argument reuse 'regl' - possible side-effects? #1364: FILE: drivers/net/ngbe/base/ngbe_regs.h:1292: +#define NGBE_UPDCNT36(regl, last, cur) \ +do { \ + uint64_t new_lsb = rd32(hw, regl); \ + uint64_t new_msb = rd32(hw, regl + 4); \ + uint64_t latest = ((new_msb << 32) | new_lsb); \ + if (hw->offset_loaded || hw->rx_loaded) \ + last = 0; \ + cur += (0x1000000000LL + latest - last) & 0xFFFFFFFFFLL; \ + last = latest; \ +} while (0) CHECK:MACRO_ARG_REUSE: Macro argument reuse 'last' - possible side-effects? #1364: FILE: drivers/net/ngbe/base/ngbe_regs.h:1292: +#define NGBE_UPDCNT36(regl, last, cur) \ +do { \ + uint64_t new_lsb = rd32(hw, regl); \ + uint64_t new_msb = rd32(hw, regl + 4); \ + uint64_t latest = ((new_msb << 32) | new_lsb); \ + if (hw->offset_loaded || hw->rx_loaded) \ + last = 0; \ + cur += (0x1000000000LL + latest - last) & 0xFFFFFFFFFLL; \ + last = latest; \ +} while (0) CHECK:MACRO_ARG_PRECEDENCE: Macro argument 'cur' may be better as '(cur)' to avoid precedence issues #1364: FILE: drivers/net/ngbe/base/ngbe_regs.h:1292: +#define NGBE_UPDCNT36(regl, last, cur) \ +do { \ + uint64_t new_lsb = rd32(hw, regl); \ + uint64_t new_msb = rd32(hw, regl + 4); \ + uint64_t latest = ((new_msb << 32) | new_lsb); \ + if (hw->offset_loaded || hw->rx_loaded) \ + last = 0; \ + cur += (0x1000000000LL + latest - last) & 0xFFFFFFFFFLL; \ + last = latest; \ +} while (0) CHECK:MACRO_ARG_REUSE: Macro argument reuse 'hw' - possible side-effects? #1515: FILE: drivers/net/ngbe/base/ngbe_regs.h:1443: +#define rd32w(hw, reg, mask, slice) do { \ + rd32((hw), reg); \ + po32m((hw), reg, mask, mask, NULL, 5, slice); \ +} while (0) CHECK:MACRO_ARG_REUSE: Macro argument reuse 'reg' - possible side-effects? #1515: FILE: drivers/net/ngbe/base/ngbe_regs.h:1443: +#define rd32w(hw, reg, mask, slice) do { \ + rd32((hw), reg); \ + po32m((hw), reg, mask, mask, NULL, 5, slice); \ +} while (0) CHECK:MACRO_ARG_REUSE: Macro argument reuse 'mask' - possible side-effects? #1515: FILE: drivers/net/ngbe/base/ngbe_regs.h:1443: +#define rd32w(hw, reg, mask, slice) do { \ + rd32((hw), reg); \ + po32m((hw), reg, mask, mask, NULL, 5, slice); \ +} while (0) CHECK:MACRO_ARG_REUSE: Macro argument reuse 'hw' - possible side-effects? #1520: FILE: drivers/net/ngbe/base/ngbe_regs.h:1448: +#define wr32w(hw, reg, val, mask, slice) do { \ + wr32((hw), reg, val); \ + po32m((hw), reg, mask, mask, NULL, 5, slice); \ +} while (0) CHECK:MACRO_ARG_REUSE: Macro argument reuse 'reg' - possible side-effects? #1520: FILE: drivers/net/ngbe/base/ngbe_regs.h:1448: +#define wr32w(hw, reg, val, mask, slice) do { \ + wr32((hw), reg, val); \ + po32m((hw), reg, mask, mask, NULL, 5, slice); \ +} while (0) CHECK:MACRO_ARG_REUSE: Macro argument reuse 'mask' - possible side-effects? #1520: FILE: drivers/net/ngbe/base/ngbe_regs.h:1448: +#define wr32w(hw, reg, val, mask, slice) do { \ + wr32((hw), reg, val); \ + po32m((hw), reg, mask, mask, NULL, 5, slice); \ +} while (0) total: 0 errors, 1 warnings, 15 checks, 1495 lines checked