[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: introduce macros to define register contents (rev2)

Patchwork patchwork at emeril.freedesktop.org
Thu Jan 17 12:54:51 UTC 2019


== Series Details ==

Series: drm/i915: introduce macros to define register contents (rev2)
URL   : https://patchwork.freedesktop.org/series/50513/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
53519fbcbe40 drm/i915/dp: remove PANEL_POWER_OFF macro and its use
b64ca6410c69 drm/i915: introduce _BIT() and _MASK() to define register contents
dc4e11b1eaf0 drm/i915: deprecate _SHIFT in favor of FIELD_GET() and _MASK
9edbb60abd1b drm/i915: introduce _FIELD() to define register field values
-:57: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'x' - possible side-effects?
#57: FILE: drivers/gpu/drm/i915/i915_reg.h:136:
+#define __POWER_OF_2(x)	((x) && (((x) & ((x) - 1)) == 0))

-:67: CHECK:MACRO_ARG_REUSE: Macro argument reuse '__mask' - possible side-effects?
#67: FILE: drivers/gpu/drm/i915/i915_reg.h:146:
+#define _FIELD(__mask, __val)						\
+	((((typeof(__mask))(__val) << __bf_shf(__mask)) & (__mask)) +	\
+	 BUILD_BUG_ON_ZERO(!__builtin_constant_p(__mask)) +		\
+	 BUILD_BUG_ON_ZERO((__mask) == 0 || (__mask) > U32_MAX) +	\
+	 BUILD_BUG_ON_ZERO(!__POWER_OF_2((__mask) + (1ULL << __bf_shf(__mask)))) + \
+	 BUILD_BUG_ON_ZERO(__builtin_choose_expr(__builtin_constant_p(__val), (~((__mask) >> __bf_shf(__mask)) & (__val)), 0)))

-:67: CHECK:MACRO_ARG_REUSE: Macro argument reuse '__val' - possible side-effects?
#67: FILE: drivers/gpu/drm/i915/i915_reg.h:146:
+#define _FIELD(__mask, __val)						\
+	((((typeof(__mask))(__val) << __bf_shf(__mask)) & (__mask)) +	\
+	 BUILD_BUG_ON_ZERO(!__builtin_constant_p(__mask)) +		\
+	 BUILD_BUG_ON_ZERO((__mask) == 0 || (__mask) > U32_MAX) +	\
+	 BUILD_BUG_ON_ZERO(!__POWER_OF_2((__mask) + (1ULL << __bf_shf(__mask)))) + \
+	 BUILD_BUG_ON_ZERO(__builtin_choose_expr(__builtin_constant_p(__val), (~((__mask) >> __bf_shf(__mask)) & (__val)), 0)))

-:72: WARNING:LONG_LINE: line over 100 characters
#72: FILE: drivers/gpu/drm/i915/i915_reg.h:151:
+	 BUILD_BUG_ON_ZERO(__builtin_choose_expr(__builtin_constant_p(__val), (~((__mask) >> __bf_shf(__mask)) & (__val)), 0)))

total: 0 errors, 1 warnings, 3 checks, 100 lines checked



More information about the Intel-gfx mailing list