Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
9724a850
Commit
9724a850
authored
Sep 11, 2012
by
Ben Hutchings
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sfc: Add parentheses around use of bitfield macro arguments
Signed-off-by:
Ben Hutchings
<
bhutchings@solarflare.com
>
parent
726ba0e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
drivers/net/ethernet/sfc/bitfield.h
drivers/net/ethernet/sfc/bitfield.h
+11
-11
No files found.
drivers/net/ethernet/sfc/bitfield.h
View file @
9724a850
...
...
@@ -120,10 +120,10 @@ typedef union efx_oword {
* [0,high-low), with garbage in bits [high-low+1,...).
*/
#define EFX_EXTRACT_NATIVE(native_element, min, max, low, high) \
((
(low > max) || (high < min)
) ? 0 : \
(
(low > min) ?
\
((native_element) >> (low -
min)) : \
((native_element) << (min - low)
)))
((
low) > (max) || (high) < (min
) ? 0 : \
(
low) > (min) ?
\
(native_element) >> ((low) - (
min)) : \
(native_element) << ((min) - (low
)))
/*
* Extract bit field portion [low,high) from the 64-bit little-endian
...
...
@@ -142,27 +142,27 @@ typedef union efx_oword {
#define EFX_EXTRACT_OWORD64(oword, low, high) \
((EFX_EXTRACT64((oword).u64[0], 0, 63, low, high) | \
EFX_EXTRACT64((oword).u64[1], 64, 127, low, high)) & \
EFX_MASK64(
high + 1 - low
))
EFX_MASK64(
(high) + 1 - (low)
))
#define EFX_EXTRACT_QWORD64(qword, low, high) \
(EFX_EXTRACT64((qword).u64[0], 0, 63, low, high) & \
EFX_MASK64(
high + 1 - low
))
EFX_MASK64(
(high) + 1 - (low)
))
#define EFX_EXTRACT_OWORD32(oword, low, high) \
((EFX_EXTRACT32((oword).u32[0], 0, 31, low, high) | \
EFX_EXTRACT32((oword).u32[1], 32, 63, low, high) | \
EFX_EXTRACT32((oword).u32[2], 64, 95, low, high) | \
EFX_EXTRACT32((oword).u32[3], 96, 127, low, high)) & \
EFX_MASK32(
high + 1 - low
))
EFX_MASK32(
(high) + 1 - (low)
))
#define EFX_EXTRACT_QWORD32(qword, low, high) \
((EFX_EXTRACT32((qword).u32[0], 0, 31, low, high) | \
EFX_EXTRACT32((qword).u32[1], 32, 63, low, high)) & \
EFX_MASK32(
high + 1 - low
))
EFX_MASK32(
(high) + 1 - (low)
))
#define EFX_EXTRACT_DWORD(dword, low, high) \
(EFX_EXTRACT32((dword).u32[0], 0, 31, low, high) & \
EFX_MASK32(
high + 1 - low
))
EFX_MASK32(
(high) + 1 - (low)
))
#define EFX_OWORD_FIELD64(oword, field) \
EFX_EXTRACT_OWORD64(oword, EFX_LOW_BIT(field), \
...
...
@@ -442,10 +442,10 @@ typedef union efx_oword {
cpu_to_le32(EFX_INSERT_NATIVE(min, max, low, high, value))
#define EFX_INPLACE_MASK64(min, max, low, high) \
EFX_INSERT64(min, max, low, high, EFX_MASK64(
high + 1 - low
))
EFX_INSERT64(min, max, low, high, EFX_MASK64(
(high) + 1 - (low)
))
#define EFX_INPLACE_MASK32(min, max, low, high) \
EFX_INSERT32(min, max, low, high, EFX_MASK32(
high + 1 - low
))
EFX_INSERT32(min, max, low, high, EFX_MASK32(
(high) + 1 - (low)
))
#define EFX_SET_OWORD64(oword, low, high, value) do { \
(oword).u64[0] = (((oword).u64[0] \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment