diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2012-09-11 16:37:36 -0400 |
---|---|---|
committer | Ben Hutchings <bhutchings@solarflare.com> | 2012-10-01 20:58:39 -0400 |
commit | 9724a8504c875145f5a513bb8eca50671cee23b4 (patch) | |
tree | 3d1cc1ed4a3c836906c092c9834f3339693b4be1 /drivers/net/ethernet/sfc/bitfield.h | |
parent | 726ba0e14a7915effee9e8e652a37306d9637d13 (diff) |
sfc: Add parentheses around use of bitfield macro arguments
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Diffstat (limited to 'drivers/net/ethernet/sfc/bitfield.h')
-rw-r--r-- | drivers/net/ethernet/sfc/bitfield.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/net/ethernet/sfc/bitfield.h b/drivers/net/ethernet/sfc/bitfield.h index b26a954c27fc..5400a33f254f 100644 --- a/drivers/net/ethernet/sfc/bitfield.h +++ b/drivers/net/ethernet/sfc/bitfield.h | |||
@@ -120,10 +120,10 @@ typedef union efx_oword { | |||
120 | * [0,high-low), with garbage in bits [high-low+1,...). | 120 | * [0,high-low), with garbage in bits [high-low+1,...). |
121 | */ | 121 | */ |
122 | #define EFX_EXTRACT_NATIVE(native_element, min, max, low, high) \ | 122 | #define EFX_EXTRACT_NATIVE(native_element, min, max, low, high) \ |
123 | (((low > max) || (high < min)) ? 0 : \ | 123 | ((low) > (max) || (high) < (min) ? 0 : \ |
124 | ((low > min) ? \ | 124 | (low) > (min) ? \ |
125 | ((native_element) >> (low - min)) : \ | 125 | (native_element) >> ((low) - (min)) : \ |
126 | ((native_element) << (min - low)))) | 126 | (native_element) << ((min) - (low))) |
127 | 127 | ||
128 | /* | 128 | /* |
129 | * Extract bit field portion [low,high) from the 64-bit little-endian | 129 | * Extract bit field portion [low,high) from the 64-bit little-endian |
@@ -142,27 +142,27 @@ typedef union efx_oword { | |||
142 | #define EFX_EXTRACT_OWORD64(oword, low, high) \ | 142 | #define EFX_EXTRACT_OWORD64(oword, low, high) \ |
143 | ((EFX_EXTRACT64((oword).u64[0], 0, 63, low, high) | \ | 143 | ((EFX_EXTRACT64((oword).u64[0], 0, 63, low, high) | \ |
144 | EFX_EXTRACT64((oword).u64[1], 64, 127, low, high)) & \ | 144 | EFX_EXTRACT64((oword).u64[1], 64, 127, low, high)) & \ |
145 | EFX_MASK64(high + 1 - low)) | 145 | EFX_MASK64((high) + 1 - (low))) |
146 | 146 | ||
147 | #define EFX_EXTRACT_QWORD64(qword, low, high) \ | 147 | #define EFX_EXTRACT_QWORD64(qword, low, high) \ |
148 | (EFX_EXTRACT64((qword).u64[0], 0, 63, low, high) & \ | 148 | (EFX_EXTRACT64((qword).u64[0], 0, 63, low, high) & \ |
149 | EFX_MASK64(high + 1 - low)) | 149 | EFX_MASK64((high) + 1 - (low))) |
150 | 150 | ||
151 | #define EFX_EXTRACT_OWORD32(oword, low, high) \ | 151 | #define EFX_EXTRACT_OWORD32(oword, low, high) \ |
152 | ((EFX_EXTRACT32((oword).u32[0], 0, 31, low, high) | \ | 152 | ((EFX_EXTRACT32((oword).u32[0], 0, 31, low, high) | \ |
153 | EFX_EXTRACT32((oword).u32[1], 32, 63, low, high) | \ | 153 | EFX_EXTRACT32((oword).u32[1], 32, 63, low, high) | \ |
154 | EFX_EXTRACT32((oword).u32[2], 64, 95, low, high) | \ | 154 | EFX_EXTRACT32((oword).u32[2], 64, 95, low, high) | \ |
155 | EFX_EXTRACT32((oword).u32[3], 96, 127, low, high)) & \ | 155 | EFX_EXTRACT32((oword).u32[3], 96, 127, low, high)) & \ |
156 | EFX_MASK32(high + 1 - low)) | 156 | EFX_MASK32((high) + 1 - (low))) |
157 | 157 | ||
158 | #define EFX_EXTRACT_QWORD32(qword, low, high) \ | 158 | #define EFX_EXTRACT_QWORD32(qword, low, high) \ |
159 | ((EFX_EXTRACT32((qword).u32[0], 0, 31, low, high) | \ | 159 | ((EFX_EXTRACT32((qword).u32[0], 0, 31, low, high) | \ |
160 | EFX_EXTRACT32((qword).u32[1], 32, 63, low, high)) & \ | 160 | EFX_EXTRACT32((qword).u32[1], 32, 63, low, high)) & \ |
161 | EFX_MASK32(high + 1 - low)) | 161 | EFX_MASK32((high) + 1 - (low))) |
162 | 162 | ||
163 | #define EFX_EXTRACT_DWORD(dword, low, high) \ | 163 | #define EFX_EXTRACT_DWORD(dword, low, high) \ |
164 | (EFX_EXTRACT32((dword).u32[0], 0, 31, low, high) & \ | 164 | (EFX_EXTRACT32((dword).u32[0], 0, 31, low, high) & \ |
165 | EFX_MASK32(high + 1 - low)) | 165 | EFX_MASK32((high) + 1 - (low))) |
166 | 166 | ||
167 | #define EFX_OWORD_FIELD64(oword, field) \ | 167 | #define EFX_OWORD_FIELD64(oword, field) \ |
168 | EFX_EXTRACT_OWORD64(oword, EFX_LOW_BIT(field), \ | 168 | EFX_EXTRACT_OWORD64(oword, EFX_LOW_BIT(field), \ |
@@ -442,10 +442,10 @@ typedef union efx_oword { | |||
442 | cpu_to_le32(EFX_INSERT_NATIVE(min, max, low, high, value)) | 442 | cpu_to_le32(EFX_INSERT_NATIVE(min, max, low, high, value)) |
443 | 443 | ||
444 | #define EFX_INPLACE_MASK64(min, max, low, high) \ | 444 | #define EFX_INPLACE_MASK64(min, max, low, high) \ |
445 | EFX_INSERT64(min, max, low, high, EFX_MASK64(high + 1 - low)) | 445 | EFX_INSERT64(min, max, low, high, EFX_MASK64((high) + 1 - (low))) |
446 | 446 | ||
447 | #define EFX_INPLACE_MASK32(min, max, low, high) \ | 447 | #define EFX_INPLACE_MASK32(min, max, low, high) \ |
448 | EFX_INSERT32(min, max, low, high, EFX_MASK32(high + 1 - low)) | 448 | EFX_INSERT32(min, max, low, high, EFX_MASK32((high) + 1 - (low))) |
449 | 449 | ||
450 | #define EFX_SET_OWORD64(oword, low, high, value) do { \ | 450 | #define EFX_SET_OWORD64(oword, low, high, value) do { \ |
451 | (oword).u64[0] = (((oword).u64[0] \ | 451 | (oword).u64[0] = (((oword).u64[0] \ |