[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for log2: make is_power_of_2() more generic
Patchwork
patchwork at emeril.freedesktop.org
Thu Mar 30 11:10:03 UTC 2023
== Series Details ==
Series: log2: make is_power_of_2() more generic
URL : https://patchwork.freedesktop.org/series/115863/
State : warning
== Summary ==
Error: dim checkpatch failed
5c5c2de058cb log2: add helper __IS_POWER_OF_2()
-:24: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'n' - possible side-effects?
#24: FILE: include/linux/log2.h:36:
+#define __IS_POWER_OF_2(n) ((n) != 0 && (((n) & ((n) - 1)) == 0))
total: 0 errors, 0 warnings, 1 checks, 16 lines checked
66a1c1b93361 log2: have is_power_of_2() support bigger types than unsigned long
-:28: WARNING:PREFER_DEFINED_ATTRIBUTE_MACRO: Prefer __attribute_const__ over __attribute__((const))
#28: FILE: include/linux/log2.h:38:
+static inline __attribute__((const))
-:34: WARNING:PREFER_DEFINED_ATTRIBUTE_MACRO: Prefer __attribute_const__ over __attribute__((const))
#34: FILE: include/linux/log2.h:44:
+static inline __attribute__((const))
-:52: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'n' - possible side-effects?
#52: FILE: include/linux/log2.h:58:
+#define is_power_of_2(n) \
+ __builtin_choose_expr(sizeof(n) > sizeof(unsigned long), \
+ __is_power_of_2_ull(n), \
+ __is_power_of_2(n))
total: 0 errors, 2 warnings, 1 checks, 33 lines checked
1d19fef56ddc log2: allow use of is_power_of_2() in constant expressions
385585e52a78 drm/i915/reg: use is_power_of_2() from log2.h
More information about the Intel-gfx
mailing list