drm/i915: Move WARN_ON/MISSING_CASE macros to i915_utils.h
Subsystems (2)
PATCH 1/1 drm/i915: Move WARN_ON/MISSING_CASE macros to i915_utils.h
We can't sometimes use these macros in other headers due to include and definition order. As i915_utils.h already contains other helper macros move these macros there.
--- drivers/gpu/drm/i915/i915_drv.h | 18 ------------------ drivers/gpu/drm/i915/i915_utils.h | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 18 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +0 -18
@@ -82,24 +82,6 @@#define DRIVER_DATE "20170320"#define DRIVER_TIMESTAMP 1489994464 -#undef WARN_ON -/* Many gcc seem to no see through this and fall over :( */ -#if 0 -#define WARN_ON (x) ({ \ - bool __i915_warn_cond = (x); \ - if (__builtin_constant_p(__i915_warn_cond)) \ - BUILD_BUG_ON(__i915_warn_cond); \ - WARN(__i915_warn_cond, "WARN_ON(" #x ")"); }) -#else -#define WARN_ON (x) WARN((x), "%s", "WARN_ON(" __stringify(x) ")") -#endif - -#undef WARN_ON_ONCE -#define WARN_ON_ONCE (x) WARN_ONCE((x), "%s", "WARN_ON_ONCE(" __stringify(x) ")") - -#define MISSING_CASE (x) WARN(1, "Missing switch case (%lu) in %s\n", \ - (long) (x), __func__); -/* Use I915_STATE_WARN(x) and I915_STATE_WARN_ON() (rather than WARN() and * WARN_ON()) for hw state sanity checks to check for unexpected conditions * which may not necessarily be a user visible problem. This will either
drivers/gpu/drm/i915/i915_utils.h +18 -0
@@ -25,6 +25,24 @@#ifndef __I915_UTILS_H#define __I915_UTILS_H +#undef WARN_ON +/* Many gcc seem to no see through this and fall over :( */ +#if 0 +#define WARN_ON (x) ({ \ + bool __i915_warn_cond = (x); \ + if (__builtin_constant_p(__i915_warn_cond)) \ + BUILD_BUG_ON(__i915_warn_cond); \ + WARN(__i915_warn_cond, "WARN_ON(" #x ")"); }) +#else +#define WARN_ON (x) WARN((x), "%s", "WARN_ON(" __stringify(x) ")") +#endif + +#undef WARN_ON_ONCE +#define WARN_ON_ONCE (x) WARN_ONCE((x), "%s", "WARN_ON_ONCE(" __stringify(x) ")") + +#define MISSING_CASE (x) WARN(1, "Missing switch case (%lu) in %s\n", \ + (long) (x), __func__); +#if GCC_VERSION >=70000 #define add_overflows (A ,B ) \ __builtin_add_overflow_p((A), (B), (typeof((A) + (B)))0)
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 7 lines · Michal Wajdeczko
We can't sometimes use these macros in other headers due to include and definition order. As
i915_utils.halready contains other helper macros move these macros there.Signed-off-by Michal Wajdeczko <[email protected]>Cc Joonas Lahtinen <[email protected]>Cc Chris Wilson <[email protected]>
Regards, Joonas
Signature · 7 lines
Joonas Lahtinen Open Source Technology Center Intel Corporation _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: failure for drm/i915: Move WARN_ON/MISSING_CASE macros to i915_utils.h
In reply to Michal Wajdeczko== Series Details ==
== Series Details ==
Series: drm/i915: Move WARN_ON/MISSING_CASE macros to i915_utils.h
URL : https://patchwork.freedesktop.org/series/21993/
State : failure
== Summary ==
Series 21993v1 drm/i915: Move WARN_ON/MISSING_CASE macros to i915_utils.h
https://patchwork.freedesktop.org/api/1.0/series/21993/revisions/1/mbox/
Test kms_pipe_crc_basic:
Subgroup read-crc-pipe-c-frame-sequence:
pass -> FAIL (fi-skl-6700hq)fi-bdw-5557u total:278 pass:267 dwarn:0 dfail:0 fail:0 skip:11 time: 461s fi-bdw-gvtdvm total:278 pass:256 dwarn:8 dfail:0 fail:0 skip:14 time: 452s fi-bsw-n3050 total:278 pass:239 dwarn:0 dfail:0 fail:0 skip:39 time: 585s fi-bxt-j4205 total:278 pass:259 dwarn:0 dfail:0 fail:0 skip:19 time: 536s fi-bxt-t5700 total:278 pass:258 dwarn:0 dfail:0 fail:0 skip:20 time: 571s fi-byt-j1900 total:278 pass:251 dwarn:0 dfail:0 fail:0 skip:27 time: 509s fi-byt-n2820 total:278 pass:247 dwarn:0 dfail:0 fail:0 skip:31 time: 504s fi-hsw-4770 total:278 pass:262 dwarn:0 dfail:0 fail:0 skip:16 time: 434s fi-hsw-4770r total:278 pass:262 dwarn:0 dfail:0 fail:0 skip:16 time: 432s fi-ilk-650 total:278 pass:228 dwarn:0 dfail:0 fail:0 skip:50 time: 444s fi-ivb-3520m total:278 pass:260 dwarn:0 dfail:0 fail:0 skip:18 time: 521s fi-ivb-3770 total:278 pass:260 dwarn:0 dfail:0 fail:0 skip:18 time: 501s fi-kbl-7500u total:278 pass:260 dwarn:0 dfail:0 fail:0 skip:18 time: 483s fi-kbl-7560u total:278 pass:268 dwarn:0 dfail:0 fail:0 skip:10 time: 593s fi-skl-6260u total:278 pass:268 dwarn:0 dfail:0 fail:0 skip:10 time: 479s fi-skl-6700hq total:278 pass:260 dwarn:0 dfail:0 fail:1 skip:17 time: 596s fi-skl-6700k total:278 pass:256 dwarn:4 dfail:0 fail:0 skip:18 time: 491s fi-skl-6770hq total:278 pass:268 dwarn:0 dfail:0 fail:0 skip:10 time: 534s fi-skl-gvtdvm total:278 pass:265 dwarn:0 dfail:0 fail:0 skip:13 time: 462s fi-snb-2520m total:278 pass:250 dwarn:0 dfail:0 fail:0 skip:28 time: 549s fi-snb-2600 total:278 pass:249 dwarn:0 dfail:0 fail:0 skip:29 time: 437s
2b51c2073441cc5b3b18c7e0e8716cbf3736e873 drm-tip: 2017y-03m-28d-08h-54m-35s UTC integration manifest 5402f7b drm/i915: Move WARN_ON/MISSING_CASE macros to i915_utils.h
== Logs ==
For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_4322/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: ✗ Fi.CI.BAT: failure for drm/i915: Move WARN_ON/MISSING_CASE macros to i915_utils.h
Quoted 6 lines · Patchwork
== Series Details ==
Series: drm/i915: Move WARN_ON/MISSING_CASE macros to
i915_utils.h
URL : https://patchwork.freedesktop.org/series/21993/
State : failure
Quoted 8 lines
== Summary ==
Series 21993v1 drm/i915: Move WARN_ON/MISSING_CASE macros to
i915_utils.h
https://patchwork.freedesktop.org/api/1.0/series/21993/revisions/1/mbox/Test
kms_pipe_crc_basic:Subgroup read-crc-pipe-c-frame-sequence: pass -> FAIL (fi-skl-6700hq)
This failure is unrelated to the patch.
-Michal
Quoted 23 lines
fi-bdw-5557u total:278 pass:267 dwarn:0 dfail:0 fail:0 skip:11 time: 461s fi-bdw-gvtdvm total:278 pass:256 dwarn:8 dfail:0 fail:0 skip:14 time: 452s fi-bsw-n3050 total:278 pass:239 dwarn:0 dfail:0 fail:0 skip:39 time: 585s fi-bxt-j4205 total:278 pass:259 dwarn:0 dfail:0 fail:0 skip:19 time: 536s fi-bxt-t5700 total:278 pass:258 dwarn:0 dfail:0 fail:0 skip:20 time: 571s fi-byt-j1900 total:278 pass:251 dwarn:0 dfail:0 fail:0 skip:27 time: 509s fi-byt-n2820 total:278 pass:247 dwarn:0 dfail:0 fail:0 skip:31 time: 504s fi-hsw-4770 total:278 pass:262 dwarn:0 dfail:0 fail:0 skip:16 time: 434s fi-hsw-4770r total:278 pass:262 dwarn:0 dfail:0 fail:0 skip:16 time: 432s fi-ilk-650 total:278 pass:228 dwarn:0 dfail:0 fail:0 skip:50 time: 444s fi-ivb-3520m total:278 pass:260 dwarn:0 dfail:0 fail:0 skip:18 time: 521s fi-ivb-3770 total:278 pass:260 dwarn:0 dfail:0 fail:0 skip:18 time: 501s fi-kbl-7500u total:278 pass:260 dwarn:0 dfail:0 fail:0 skip:18 time: 483s fi-kbl-7560u total:278 pass:268 dwarn:0 dfail:0 fail:0 skip:10 time: 593s fi-skl-6260u total:278 pass:268 dwarn:0 dfail:0 fail:0 skip:10 time: 479s fi-skl-6700hq total:278 pass:260 dwarn:0 dfail:0 fail:1 skip:17 time: 596s fi-skl-6700k total:278 pass:256 dwarn:4 dfail:0 fail:0 skip:18 time: 491s fi-skl-6770hq total:278 pass:268 dwarn:0 dfail:0 fail:0 skip:10 time: 534s fi-skl-gvtdvm total:278 pass:265 dwarn:0 dfail:0 fail:0 skip:13 time: 462s fi-snb-2520m total:278 pass:250 dwarn:0 dfail:0 fail:0 skip:28 time: 549s fi-snb-2600 total:278 pass:249 dwarn:0 dfail:0 fail:0 skip:29 time: 437s
Quoted 6 lines
2b51c2073441cc5b3b18c7e0e8716cbf3736e873drm-tip: 2017y-03m-28d-08h-54m-35s UTC integration manifest 5402f7b drm/i915: Move WARN_ON/MISSING_CASE macros toi915_utils.h== Logs ==
For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_4322/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 7 lines · Michal Wajdeczko
We can't sometimes use these macros in other headers due to include and definition order. As
i915_utils.halready contains other helper macros move these macros there.Signed-off-by Michal Wajdeczko <[email protected]>Cc Joonas Lahtinen <[email protected]>Cc Chris Wilson <[email protected]>
Cleanup up a couple of checkpatch warnings -- there was a a trailing ';' for MISSING_CASE, so no longer the pure move :-p
Pushed, thanks for the patch.
-Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx