History

include/linux/log2.h: add missing () around n in roundup_pow_of_two()

Otherwise gcc generates warnings if the expression is complicated.

Jason Gunthorpe committed 6 years ago

Commit 428fc0a1 parent e5a59d31 file · +1 −1Browse files

Showing the changes to include/linux (1 of 1 file). Show all

Unified · Split

include/linux/log2.h+1−1
@@ -173,7 +173,7 @@ unsigned long __rounddown_pow_of_two(unsigned long n) · 172 unmodified lines
173173 #define roundup_pow_of_two(n) \
174174 ( \
175175 __builtin_constant_p(n) ? ( \
176− (n == 1) ? 1 : \
176+ ((n) == 1) ? 1 : \
177177 (1UL << (ilog2((n) - 1) + 1)) \
178178 ) : \
179179 __roundup_pow_of_two(n) \