Skip to content

Commit

Permalink
drm/i915: nuke local versions of WARN_ON/WARN_ON_ONCE
Browse files Browse the repository at this point in the history
In general, we should avoid redefining kernel macros like this. It can
get confusing, and what gets used will depend on whether the header is
included or not. Moreover, we should prefer drm_WARN_ON() and
drm_WARN_ON_ONCE() anyway, which include the stringified error condition
in the message.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220121132957.3778555-1-jani.nikula@intel.com
  • Loading branch information
Jani Nikula committed Jan 24, 2022
1 parent fe6959a commit 17dd7b8
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions drivers/gpu/drm/i915/i915_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,6 @@ struct timer_list;

#define FDO_BUG_URL "https://gitlab.freedesktop.org/drm/intel/-/wikis/How-to-file-i915-bugs"

#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 case (%s == %ld)\n", \
__stringify(x), (long)(x))

Expand Down

0 comments on commit 17dd7b8

Please sign in to comment.