git.droids-corp.org
/
dpdk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9e2f08a
)
net/qede/base: improve set field macro
author
Rasesh Mody
<rasesh.mody@cavium.com>
Thu, 5 Jan 2017 07:03:44 +0000
(23:03 -0800)
committer
Ferruh Yigit
<ferruh.yigit@intel.com>
Tue, 17 Jan 2017 18:40:52 +0000
(19:40 +0100)
Improve robustness of the SET_FIELD macro by using a mask.
Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
drivers/net/qede/base/ecore.h
patch
|
blob
|
history
diff --git
a/drivers/net/qede/base/ecore.h
b/drivers/net/qede/base/ecore.h
index
907b35b
..
c9f3b00
100644
(file)
--- a/
drivers/net/qede/base/ecore.h
+++ b/
drivers/net/qede/base/ecore.h
@@
-80,7
+80,7
@@
enum ecore_nvm_cmd {
#define SET_FIELD(value, name, flag) \
do { \
(value) &= ~(name##_MASK << name##_SHIFT); \
- (value) |= (((
u64)flag) << (name##_SHIFT));
\
+ (value) |= (((
(u64)flag) & (u64)name##_MASK) << (name##_SHIFT));
\
} while (0)
#define GET_FIELD(value, name) \