[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Convert _print_param to a macro
Patchwork
patchwork at emeril.freedesktop.org
Wed Oct 10 09:34:40 UTC 2018
== Series Details ==
Series: drm/i915: Convert _print_param to a macro
URL : https://patchwork.freedesktop.org/series/50789/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip
fb0e5c359f1a drm/i915: Convert _print_param to a macro
-:53: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'p' - possible side-effects?
#53: FILE: drivers/gpu/drm/i915/i915_params.c:173:
+#define _print_param(p, name, type, x) \
+do { \
+ if (!__builtin_strcmp(type, "bool")) \
+ drm_printf(p, "i915.%s=%s\n", name, yesno(*(const bool *)x)); \
+ else if (!__builtin_strcmp(type, "int")) \
+ drm_printf(p, "i915.%s=%d\n", name, *(const int *)x); \
+ else if (!__builtin_strcmp(type, "unsigned int")) \
+ drm_printf(p, "i915.%s=%u\n", name, *(const unsigned int *)x); \
+ else if (!__builtin_strcmp(type, "char *")) \
+ drm_printf(p, "i915.%s=%s\n", name, *(const char **)x); \
+ else \
+ BUILD_BUG(); \
+} while (0)
-:53: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'name' - possible side-effects?
#53: FILE: drivers/gpu/drm/i915/i915_params.c:173:
+#define _print_param(p, name, type, x) \
+do { \
+ if (!__builtin_strcmp(type, "bool")) \
+ drm_printf(p, "i915.%s=%s\n", name, yesno(*(const bool *)x)); \
+ else if (!__builtin_strcmp(type, "int")) \
+ drm_printf(p, "i915.%s=%d\n", name, *(const int *)x); \
+ else if (!__builtin_strcmp(type, "unsigned int")) \
+ drm_printf(p, "i915.%s=%u\n", name, *(const unsigned int *)x); \
+ else if (!__builtin_strcmp(type, "char *")) \
+ drm_printf(p, "i915.%s=%s\n", name, *(const char **)x); \
+ else \
+ BUILD_BUG(); \
+} while (0)
-:53: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'x' - possible side-effects?
#53: FILE: drivers/gpu/drm/i915/i915_params.c:173:
+#define _print_param(p, name, type, x) \
+do { \
+ if (!__builtin_strcmp(type, "bool")) \
+ drm_printf(p, "i915.%s=%s\n", name, yesno(*(const bool *)x)); \
+ else if (!__builtin_strcmp(type, "int")) \
+ drm_printf(p, "i915.%s=%d\n", name, *(const int *)x); \
+ else if (!__builtin_strcmp(type, "unsigned int")) \
+ drm_printf(p, "i915.%s=%u\n", name, *(const unsigned int *)x); \
+ else if (!__builtin_strcmp(type, "char *")) \
+ drm_printf(p, "i915.%s=%s\n", name, *(const char **)x); \
+ else \
+ BUILD_BUG(); \
+} while (0)
total: 0 errors, 0 warnings, 3 checks, 35 lines checked
More information about the Intel-gfx
mailing list