Skip to content

Commit e8fa04f

Browse files
mashirochenkernelgregkh
authored andcommitted
staging: rtl8723bs: wrap complex macros with parentheses
Fix "COMPLEX_MACRO" errors reported by checkpatch.pl by wrapping macro values in parentheses to ensure correct operator precedence. Signed-off-by: Mashiro Chen <mashiro.chen@mailbox.org> Reviewed-by: Luka Gejak <luka.gejak@linux.dev> Link: https://patch.msgid.link/20260330114232.91431-3-mashiro.chen@mailbox.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent e2b69a0 commit e8fa04f

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

drivers/staging/rtl8723bs/include/basic_types.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,25 +129,25 @@
129129
* Set subfield of little-endian 4-byte value to specified value.
130130
*/
131131
#define SET_BITS_TO_LE_4BYTE(__pstart, __bitoffset, __bitlen, __val) \
132-
*((u32 *)(__pstart)) = \
132+
(*((u32 *)(__pstart)) = \
133133
( \
134134
LE_BITS_CLEARED_TO_4BYTE(__pstart, __bitoffset, __bitlen) | \
135135
((((u32)__val) & BIT_LEN_MASK_32(__bitlen)) << (__bitoffset)) \
136-
)
136+
))
137137

138138
#define SET_BITS_TO_LE_2BYTE(__pstart, __bitoffset, __bitlen, __val) \
139-
*((u16 *)(__pstart)) = \
139+
(*((u16 *)(__pstart)) = \
140140
( \
141141
LE_BITS_CLEARED_TO_2BYTE(__pstart, __bitoffset, __bitlen) | \
142142
((((u16)__val) & BIT_LEN_MASK_16(__bitlen)) << (__bitoffset)) \
143-
)
143+
))
144144

145145
#define SET_BITS_TO_LE_1BYTE(__pstart, __bitoffset, __bitlen, __val) \
146-
*((u8 *)(__pstart)) = EF1BYTE \
146+
(*((u8 *)(__pstart)) = EF1BYTE \
147147
( \
148148
LE_BITS_CLEARED_TO_1BYTE(__pstart, __bitoffset, __bitlen) | \
149149
((((u8)__val) & BIT_LEN_MASK_8(__bitlen)) << (__bitoffset)) \
150-
)
150+
))
151151

152152
#define LE_BITS_CLEARED_TO_1BYTE_8BIT(__pStart, __BitOffset, __BitLen) \
153153
(\

0 commit comments

Comments
 (0)