net/qede/base: fix macro ecore MFW set field
authorRasesh Mody <rasesh.mody@cavium.com>
Tue, 25 Apr 2017 07:28:44 +0000 (00:28 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 28 Apr 2017 12:46:18 +0000 (14:46 +0200)
Fix ECORE_MFW_SET_FIELD macro

Coverity issue: 1423907
Coverity issue: 1423908
Fixes: 0b6bf70d7ee3 ("net/qede/base: support previous driver unload")

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
drivers/net/qede/base/ecore.h
drivers/net/qede/base/mcp_public.h

index 31470b6..63cbc38 100644 (file)
@@ -104,7 +104,7 @@ do {                                                                        \
 
 #define ECORE_MFW_SET_FIELD(name, field, value)                                \
 do {                                                                   \
-       (name) &= ~((field ## _MASK) << (field ## _SHIFT));             \
+       (name) &= ~(field ## _MASK);                                    \
        (name) |= (((value) << (field ## _SHIFT)) & (field ## _MASK));  \
 } while (0)
 
index 8d65390..fcf9847 100644 (file)
@@ -1056,16 +1056,16 @@ struct load_req_stc {
 #define LOAD_REQ_ROLE_MASK             0x000000FF
 #define LOAD_REQ_ROLE_SHIFT            0
 #define LOAD_REQ_LOCK_TO_MASK          0x0000FF00
-#define LOAD_REQ_LOCK_TO_SHIFT         0 /* @DPDK */
+#define LOAD_REQ_LOCK_TO_SHIFT         8
 #define LOAD_REQ_LOCK_TO_DEFAULT       0
 #define LOAD_REQ_LOCK_TO_NONE          255
 #define LOAD_REQ_FORCE_MASK            0x000F0000
-#define LOAD_REQ_FORCE_SHIFT           0 /* @DPDK */
+#define LOAD_REQ_FORCE_SHIFT           16
 #define LOAD_REQ_FORCE_NONE            0
 #define LOAD_REQ_FORCE_PF              1
 #define LOAD_REQ_FORCE_ALL             2
 #define LOAD_REQ_FLAGS0_MASK           0x00F00000
-#define LOAD_REQ_FLAGS0_SHIFT          0 /* @DPDK */
+#define LOAD_REQ_FLAGS0_SHIFT          20
 #define LOAD_REQ_FLAGS0_AVOID_RESET    (0x1 << 0)
 };