summaryrefslogtreecommitdiff
path: root/drivers/net/qede
diff options
context:
space:
mode:
authorAndrius Sirvys <andrius.sirvys@intel.com>2019-02-19 13:24:50 +0000
committerFerruh Yigit <ferruh.yigit@intel.com>2019-03-01 18:17:36 +0100
commit902f389f9b4cad1feba320e8b779432eeb76cada (patch)
treed3ca28674479374dcca355c943b3a7fe1cee9457 /drivers/net/qede
parentfef6b216390f33c066ea15e9de7845dfc3ab6d6a (diff)
downloaddpdk-next-eventdev-902f389f9b4cad1feba320e8b779432eeb76cada.zip
dpdk-next-eventdev-902f389f9b4cad1feba320e8b779432eeb76cada.tar.gz
dpdk-next-eventdev-902f389f9b4cad1feba320e8b779432eeb76cada.tar.xz
drivers/net: fix shifting 32-bit signed variable 31 times
Shifting signed 32-bit values by 31-bits has the potential for unexpected outcomes as compiler can overwrite a bit. Specified that values are unsigned. Errors are observed from running cppcheck. Bugzilla ID: 58 Fixes: 69e209be5464 ("net/axgbe: add register map and related macros") Fixes: b5bf7719221d ("bnx2x: driver support routines") Fixes: ed2ced6fe927 ("net/bnxt: check initialization before accessing stats") Fixes: 6fda3f0ddda9 ("net/cxgbe: add API to program hardware MPS table") Fixes: bdb244b96920 ("e1000: whitespace changes") Fixes: 5a32a257f957 ("e1000: more NICs in base driver") Fixes: 2fe669f4bcd2 ("net/nfp: support MAC address change") Fixes: defb9a5dd156 ("nfp: introduce driver initialization") Fixes: ec94dbc57362 ("qede: add base driver") Fixes: d2e7d931d0ad ("net/qede/base: formatting changes") Fixes: cdc07e83bb24 ("net/tap: add eBPF program file") Cc: stable@dpdk.org Signed-off-by: Andrius Sirvys <andrius.sirvys@intel.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Diffstat (limited to 'drivers/net/qede')
-rw-r--r--drivers/net/qede/base/common_hsi.h4
-rw-r--r--drivers/net/qede/base/ecore_hsi_common.h2
-rw-r--r--drivers/net/qede/base/ecore_hsi_eth.h2
-rw-r--r--drivers/net/qede/base/ecore_hw_defs.h2
4 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/qede/base/common_hsi.h b/drivers/net/qede/base/common_hsi.h
index 2aaf298..7047eb9 100644
--- a/drivers/net/qede/base/common_hsi.h
+++ b/drivers/net/qede/base/common_hsi.h
@@ -400,9 +400,9 @@
#define QM_BYTE_CRD_REG_WIDTH 24
#define QM_BYTE_CRD_REG_SIGN_BIT (1 << (QM_BYTE_CRD_REG_WIDTH - 1))
#define QM_WFQ_CRD_REG_WIDTH 32
-#define QM_WFQ_CRD_REG_SIGN_BIT (1 << (QM_WFQ_CRD_REG_WIDTH - 1))
+#define QM_WFQ_CRD_REG_SIGN_BIT (1U << (QM_WFQ_CRD_REG_WIDTH - 1))
#define QM_RL_CRD_REG_WIDTH 32
-#define QM_RL_CRD_REG_SIGN_BIT (1 << (QM_RL_CRD_REG_WIDTH - 1))
+#define QM_RL_CRD_REG_SIGN_BIT (1U << (QM_RL_CRD_REG_WIDTH - 1))
/*****************/
/* CAU CONSTANTS */
diff --git a/drivers/net/qede/base/ecore_hsi_common.h b/drivers/net/qede/base/ecore_hsi_common.h
index 6d4a4dd..2ce0ea9 100644
--- a/drivers/net/qede/base/ecore_hsi_common.h
+++ b/drivers/net/qede/base/ecore_hsi_common.h
@@ -2250,7 +2250,7 @@ struct igu_cleanup {
#define IGU_CLEANUP_CLEANUP_TYPE_MASK 0x7
#define IGU_CLEANUP_CLEANUP_TYPE_SHIFT 28
/* must always be set (use enum command_type_bit) */
-#define IGU_CLEANUP_COMMAND_TYPE_MASK 0x1
+#define IGU_CLEANUP_COMMAND_TYPE_MASK 0x1U
#define IGU_CLEANUP_COMMAND_TYPE_SHIFT 31
__le32 reserved1;
};
diff --git a/drivers/net/qede/base/ecore_hsi_eth.h b/drivers/net/qede/base/ecore_hsi_eth.h
index 158ca67..7bc0947 100644
--- a/drivers/net/qede/base/ecore_hsi_eth.h
+++ b/drivers/net/qede/base/ecore_hsi_eth.h
@@ -2420,7 +2420,7 @@ struct gft_ram_line {
#define GFT_RAM_LINE_TCP_FLAG_NS_SHIFT 29
#define GFT_RAM_LINE_DST_PORT_MASK 0x1
#define GFT_RAM_LINE_DST_PORT_SHIFT 30
-#define GFT_RAM_LINE_SRC_PORT_MASK 0x1
+#define GFT_RAM_LINE_SRC_PORT_MASK 0x1U
#define GFT_RAM_LINE_SRC_PORT_SHIFT 31
__le32 hi;
#define GFT_RAM_LINE_DSCP_MASK 0x1
diff --git a/drivers/net/qede/base/ecore_hw_defs.h b/drivers/net/qede/base/ecore_hw_defs.h
index b8c2686..92361e7 100644
--- a/drivers/net/qede/base/ecore_hw_defs.h
+++ b/drivers/net/qede/base/ecore_hw_defs.h
@@ -51,7 +51,7 @@ struct igu_ctrl_reg {
#define IGU_CTRL_REG_PXP_ADDR_SHIFT 16
#define IGU_CTRL_REG_RESERVED_MASK 0x1
#define IGU_CTRL_REG_RESERVED_SHIFT 28
-#define IGU_CTRL_REG_TYPE_MASK 0x1 /* use enum igu_ctrl_cmd */
+#define IGU_CTRL_REG_TYPE_MASK 0x1U /* use enum igu_ctrl_cmd */
#define IGU_CTRL_REG_TYPE_SHIFT 31
};