From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by dpdk.org (Postfix, from userid 1017) id 22ACD1C7CD; Thu, 5 Apr 2018 08:41:35 +0200 (CEST) In-Reply-To: <1522910389-35530-2-git-send-email-Ravi1.kumar@amd.com> References: <1522910389-35530-2-git-send-email-Ravi1.kumar@amd.com> To: test-report@dpdk.org Cc: Ravi Kumar Message-Id: <20180405064135.22ACD1C7CD@dpdk.org> Date: Thu, 5 Apr 2018 08:41:35 +0200 (CEST) From: checkpatch@dpdk.org Subject: [dpdk-test-report] |WARNING| pw37221 [PATCH v4 02/17] net/axgbe: add register map and related macros X-BeenThere: test-report@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: automatic DPDK test reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Apr 2018 06:41:35 -0000 Test-Label: checkpatch Test-Status: WARNING http://dpdk.org/patch/37221 _coding style issues_ CHECK:MACRO_ARG_REUSE: Macro argument reuse '_var' - possible side-effects? #1315: FILE: drivers/net/axgbe/axgbe_common.h:1336: +#define SET_BITS(_var, _index, _width, _val) \ +do { \ + (_var) &= ~(((0x1 << (_width)) - 1) << (_index)); \ + (_var) |= (((_val) & ((0x1 << (_width)) - 1)) << (_index)); \ +} while (0) CHECK:MACRO_ARG_REUSE: Macro argument reuse '_index' - possible side-effects? #1315: FILE: drivers/net/axgbe/axgbe_common.h:1336: +#define SET_BITS(_var, _index, _width, _val) \ +do { \ + (_var) &= ~(((0x1 << (_width)) - 1) << (_index)); \ + (_var) |= (((_val) & ((0x1 << (_width)) - 1)) << (_index)); \ +} while (0) CHECK:MACRO_ARG_REUSE: Macro argument reuse '_width' - possible side-effects? #1315: FILE: drivers/net/axgbe/axgbe_common.h:1336: +#define SET_BITS(_var, _index, _width, _val) \ +do { \ + (_var) &= ~(((0x1 << (_width)) - 1) << (_index)); \ + (_var) |= (((_val) & ((0x1 << (_width)) - 1)) << (_index)); \ +} while (0) CHECK:MACRO_ARG_REUSE: Macro argument reuse '_var' - possible side-effects? #1324: FILE: drivers/net/axgbe/axgbe_common.h:1345: +#define SET_BITS_LE(_var, _index, _width, _val) \ +do { \ + (_var) &= rte_cpu_to_le_32(~(((0x1 << (_width)) - 1) << (_index)));\ + (_var) |= rte_cpu_to_le_32((((_val) & \ + ((0x1 << (_width)) - 1)) << (_index))); \ +} while (0) CHECK:MACRO_ARG_REUSE: Macro argument reuse '_index' - possible side-effects? #1324: FILE: drivers/net/axgbe/axgbe_common.h:1345: +#define SET_BITS_LE(_var, _index, _width, _val) \ +do { \ + (_var) &= rte_cpu_to_le_32(~(((0x1 << (_width)) - 1) << (_index)));\ + (_var) |= rte_cpu_to_le_32((((_val) & \ + ((0x1 << (_width)) - 1)) << (_index))); \ +} while (0) CHECK:MACRO_ARG_REUSE: Macro argument reuse '_width' - possible side-effects? #1324: FILE: drivers/net/axgbe/axgbe_common.h:1345: +#define SET_BITS_LE(_var, _index, _width, _val) \ +do { \ + (_var) &= rte_cpu_to_le_32(~(((0x1 << (_width)) - 1) << (_index)));\ + (_var) |= rte_cpu_to_le_32((((_val) & \ + ((0x1 << (_width)) - 1)) << (_index))); \ +} while (0) CHECK:MACRO_ARG_REUSE: Macro argument reuse '_pdata' - possible side-effects? #1377: FILE: drivers/net/axgbe/axgbe_common.h:1398: +#define AXGMAC_IOWRITE_BITS(_pdata, _reg, _field, _val) \ +do { \ + u32 reg_val = AXGMAC_IOREAD((_pdata), _reg); \ + SET_BITS(reg_val, \ + _reg##_##_field##_INDEX, \ + _reg##_##_field##_WIDTH, (_val)); \ + AXGMAC_IOWRITE((_pdata), _reg, reg_val); \ +} while (0) CHECK:MACRO_ARG_REUSE: Macro argument reuse '_reg' - possible side-effects? #1377: FILE: drivers/net/axgbe/axgbe_common.h:1398: +#define AXGMAC_IOWRITE_BITS(_pdata, _reg, _field, _val) \ +do { \ + u32 reg_val = AXGMAC_IOREAD((_pdata), _reg); \ + SET_BITS(reg_val, \ + _reg##_##_field##_INDEX, \ + _reg##_##_field##_WIDTH, (_val)); \ + AXGMAC_IOWRITE((_pdata), _reg, reg_val); \ +} while (0) CHECK:MACRO_ARG_REUSE: Macro argument reuse '_pdata' - possible side-effects? #1403: FILE: drivers/net/axgbe/axgbe_common.h:1424: +#define AXGMAC_MTL_IOWRITE_BITS(_pdata, _n, _reg, _field, _val) \ +do { \ + u32 reg_val = AXGMAC_MTL_IOREAD((_pdata), (_n), _reg); \ + SET_BITS(reg_val, \ + _reg##_##_field##_INDEX, \ + _reg##_##_field##_WIDTH, (_val)); \ + AXGMAC_MTL_IOWRITE((_pdata), (_n), _reg, reg_val); \ +} while (0) CHECK:MACRO_ARG_REUSE: Macro argument reuse '_n' - possible side-effects? #1403: FILE: drivers/net/axgbe/axgbe_common.h:1424: +#define AXGMAC_MTL_IOWRITE_BITS(_pdata, _n, _reg, _field, _val) \ +do { \ + u32 reg_val = AXGMAC_MTL_IOREAD((_pdata), (_n), _reg); \ + SET_BITS(reg_val, \ + _reg##_##_field##_INDEX, \ + _reg##_##_field##_WIDTH, (_val)); \ + AXGMAC_MTL_IOWRITE((_pdata), (_n), _reg, reg_val); \ +} while (0) CHECK:MACRO_ARG_REUSE: Macro argument reuse '_reg' - possible side-effects? #1403: FILE: drivers/net/axgbe/axgbe_common.h:1424: +#define AXGMAC_MTL_IOWRITE_BITS(_pdata, _n, _reg, _field, _val) \ +do { \ + u32 reg_val = AXGMAC_MTL_IOREAD((_pdata), (_n), _reg); \ + SET_BITS(reg_val, \ + _reg##_##_field##_INDEX, \ + _reg##_##_field##_WIDTH, (_val)); \ + AXGMAC_MTL_IOWRITE((_pdata), (_n), _reg, reg_val); \ +} while (0) CHECK:MACRO_ARG_REUSE: Macro argument reuse '_channel' - possible side-effects? #1427: FILE: drivers/net/axgbe/axgbe_common.h:1448: +#define AXGMAC_DMA_IOWRITE_BITS(_channel, _reg, _field, _val) \ +do { \ + u32 reg_val = AXGMAC_DMA_IOREAD((_channel), _reg); \ + SET_BITS(reg_val, \ + _reg##_##_field##_INDEX, \ + _reg##_##_field##_WIDTH, (_val)); \ + AXGMAC_DMA_IOWRITE((_channel), _reg, reg_val); \ +} while (0) CHECK:MACRO_ARG_REUSE: Macro argument reuse '_reg' - possible side-effects? #1427: FILE: drivers/net/axgbe/axgbe_common.h:1448: +#define AXGMAC_DMA_IOWRITE_BITS(_channel, _reg, _field, _val) \ +do { \ + u32 reg_val = AXGMAC_DMA_IOREAD((_channel), _reg); \ + SET_BITS(reg_val, \ + _reg##_##_field##_INDEX, \ + _reg##_##_field##_WIDTH, (_val)); \ + AXGMAC_DMA_IOWRITE((_channel), _reg, reg_val); \ +} while (0) CHECK:MACRO_ARG_REUSE: Macro argument reuse '_pdata' - possible side-effects? #1485: FILE: drivers/net/axgbe/axgbe_common.h:1506: +#define XSIR0_IOWRITE_BITS(_pdata, _reg, _field, _val) \ +do { \ + u16 reg_val = XSIR0_IOREAD((_pdata), _reg); \ + SET_BITS(reg_val, \ + _reg##_##_field##_INDEX, \ + _reg##_##_field##_WIDTH, (_val)); \ + XSIR0_IOWRITE((_pdata), _reg, reg_val); \ +} while (0) CHECK:MACRO_ARG_REUSE: Macro argument reuse '_reg' - possible side-effects? #1485: FILE: drivers/net/axgbe/axgbe_common.h:1506: +#define XSIR0_IOWRITE_BITS(_pdata, _reg, _field, _val) \ +do { \ + u16 reg_val = XSIR0_IOREAD((_pdata), _reg); \ + SET_BITS(reg_val, \ + _reg##_##_field##_INDEX, \ + _reg##_##_field##_WIDTH, (_val)); \ + XSIR0_IOWRITE((_pdata), _reg, reg_val); \ +} while (0) CHECK:MACRO_ARG_REUSE: Macro argument reuse '_pdata' - possible side-effects? #1505: FILE: drivers/net/axgbe/axgbe_common.h:1526: +#define XSIR1_IOWRITE_BITS(_pdata, _reg, _field, _val) \ +do { \ + u16 reg_val = XSIR1_IOREAD((_pdata), _reg); \ + SET_BITS(reg_val, \ + _reg##_##_field##_INDEX, \ + _reg##_##_field##_WIDTH, (_val)); \ + XSIR1_IOWRITE((_pdata), _reg, reg_val); \ +} while (0) CHECK:MACRO_ARG_REUSE: Macro argument reuse '_reg' - possible side-effects? #1505: FILE: drivers/net/axgbe/axgbe_common.h:1526: +#define XSIR1_IOWRITE_BITS(_pdata, _reg, _field, _val) \ +do { \ + u16 reg_val = XSIR1_IOREAD((_pdata), _reg); \ + SET_BITS(reg_val, \ + _reg##_##_field##_INDEX, \ + _reg##_##_field##_WIDTH, (_val)); \ + XSIR1_IOWRITE((_pdata), _reg, reg_val); \ +} while (0) CHECK:MACRO_ARG_REUSE: Macro argument reuse '_pdata' - possible side-effects? #1528: FILE: drivers/net/axgbe/axgbe_common.h:1549: +#define XRXTX_IOWRITE_BITS(_pdata, _reg, _field, _val) \ +do { \ + u16 reg_val = XRXTX_IOREAD((_pdata), _reg); \ + SET_BITS(reg_val, \ + _reg##_##_field##_INDEX, \ + _reg##_##_field##_WIDTH, (_val)); \ + XRXTX_IOWRITE((_pdata), _reg, reg_val); \ +} while (0) CHECK:MACRO_ARG_REUSE: Macro argument reuse '_reg' - possible side-effects? #1528: FILE: drivers/net/axgbe/axgbe_common.h:1549: +#define XRXTX_IOWRITE_BITS(_pdata, _reg, _field, _val) \ +do { \ + u16 reg_val = XRXTX_IOREAD((_pdata), _reg); \ + SET_BITS(reg_val, \ + _reg##_##_field##_INDEX, \ + _reg##_##_field##_WIDTH, (_val)); \ + XRXTX_IOWRITE((_pdata), _reg, reg_val); \ +} while (0) CHECK:MACRO_ARG_REUSE: Macro argument reuse '_pdata' - possible side-effects? #1561: FILE: drivers/net/axgbe/axgbe_common.h:1582: +#define XP_IOWRITE_BITS(_pdata, _reg, _field, _val) \ +do { \ + u32 reg_val = XP_IOREAD((_pdata), (_reg)); \ + SET_BITS(reg_val, \ + _reg##_##_field##_INDEX, \ + _reg##_##_field##_WIDTH, (_val)); \ + XP_IOWRITE((_pdata), (_reg), reg_val); \ +} while (0) CHECK:MACRO_ARG_REUSE: Macro argument reuse '_reg' - possible side-effects? #1561: FILE: drivers/net/axgbe/axgbe_common.h:1582: +#define XP_IOWRITE_BITS(_pdata, _reg, _field, _val) \ +do { \ + u32 reg_val = XP_IOREAD((_pdata), (_reg)); \ + SET_BITS(reg_val, \ + _reg##_##_field##_INDEX, \ + _reg##_##_field##_WIDTH, (_val)); \ + XP_IOWRITE((_pdata), (_reg), reg_val); \ +} while (0) CHECK:MACRO_ARG_REUSE: Macro argument reuse '_pdata' - possible side-effects? #1594: FILE: drivers/net/axgbe/axgbe_common.h:1615: +#define XI2C_IOWRITE_BITS(_pdata, _reg, _field, _val) \ +do { \ + u32 reg_val = XI2C_IOREAD((_pdata), (_reg)); \ + SET_BITS(reg_val, \ + _reg##_##_field##_INDEX, \ + _reg##_##_field##_WIDTH, (_val)); \ + XI2C_IOWRITE((_pdata), (_reg), reg_val); \ +} while (0) CHECK:MACRO_ARG_REUSE: Macro argument reuse '_reg' - possible side-effects? #1594: FILE: drivers/net/axgbe/axgbe_common.h:1615: +#define XI2C_IOWRITE_BITS(_pdata, _reg, _field, _val) \ +do { \ + u32 reg_val = XI2C_IOREAD((_pdata), (_reg)); \ + SET_BITS(reg_val, \ + _reg##_##_field##_INDEX, \ + _reg##_##_field##_WIDTH, (_val)); \ + XI2C_IOWRITE((_pdata), (_reg), reg_val); \ +} while (0) CHECK:MACRO_ARG_REUSE: Macro argument reuse '_pdata' - possible side-effects? #1608: FILE: drivers/net/axgbe/axgbe_common.h:1629: +#define XMDIO_READ(_pdata, _mmd, _reg) \ + ((_pdata)->hw_if.read_mmd_regs((_pdata), 0, \ + MII_ADDR_C45 | ((_mmd) << 16) | ((_reg) & 0xffff))) CHECK:MACRO_ARG_REUSE: Macro argument reuse '_pdata' - possible side-effects? #1615: FILE: drivers/net/axgbe/axgbe_common.h:1636: +#define XMDIO_WRITE(_pdata, _mmd, _reg, _val) \ + ((_pdata)->hw_if.write_mmd_regs((_pdata), 0, \ + MII_ADDR_C45 | ((_mmd) << 16) | ((_reg) & 0xffff), (_val))) CHECK:MACRO_ARG_REUSE: Macro argument reuse '_pdata' - possible side-effects? #1619: FILE: drivers/net/axgbe/axgbe_common.h:1640: +#define XMDIO_WRITE_BITS(_pdata, _mmd, _reg, _mask, _val) \ +do { \ + u32 mmd_val = XMDIO_READ((_pdata), (_mmd), (_reg)); \ + mmd_val &= ~(_mask); \ + mmd_val |= (_val); \ + XMDIO_WRITE((_pdata), (_mmd), (_reg), (mmd_val)); \ +} while (0) CHECK:MACRO_ARG_REUSE: Macro argument reuse '_mmd' - possible side-effects? #1619: FILE: drivers/net/axgbe/axgbe_common.h:1640: +#define XMDIO_WRITE_BITS(_pdata, _mmd, _reg, _mask, _val) \ +do { \ + u32 mmd_val = XMDIO_READ((_pdata), (_mmd), (_reg)); \ + mmd_val &= ~(_mask); \ + mmd_val |= (_val); \ + XMDIO_WRITE((_pdata), (_mmd), (_reg), (mmd_val)); \ +} while (0) CHECK:MACRO_ARG_REUSE: Macro argument reuse '_reg' - possible side-effects? #1619: FILE: drivers/net/axgbe/axgbe_common.h:1640: +#define XMDIO_WRITE_BITS(_pdata, _mmd, _reg, _mask, _val) \ +do { \ + u32 mmd_val = XMDIO_READ((_pdata), (_mmd), (_reg)); \ + mmd_val &= ~(_mask); \ + mmd_val |= (_val); \ + XMDIO_WRITE((_pdata), (_mmd), (_reg), (mmd_val)); \ +} while (0) total: 0 errors, 0 warnings, 28 checks, 1648 lines checked