Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915: remove __i915_printk()

With the previous cleanups, the last remaining user of __i915_printk()
is i915_probe_error(). Switch that to use drm_dbg() and drm_err()
instead, dropping the request to report bugs in the few remaining
specific cases.

It's not common for drivers to log bug filing requests to begin with,
but these cases are in init, which is most likely to be tested in CI and
least likely to be hit by end users anyway.

Acked-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/be9baeab281f75999e96cc7ad1c06c6680494bc1.1722951405.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>

+6 -48
-41
drivers/gpu/drm/i915/i915_utils.c
··· 11 11 #include "i915_reg.h" 12 12 #include "i915_utils.h" 13 13 14 - #define FDO_BUG_MSG "Please file a bug on drm/i915; see " FDO_BUG_URL " for details." 15 - 16 - void 17 - __i915_printk(struct drm_i915_private *dev_priv, const char *level, 18 - const char *fmt, ...) 19 - { 20 - static bool shown_bug_once; 21 - struct device *kdev = dev_priv->drm.dev; 22 - bool is_error = level[1] <= KERN_ERR[1]; 23 - bool is_debug = level[1] == KERN_DEBUG[1]; 24 - struct va_format vaf; 25 - va_list args; 26 - 27 - if (is_debug && !drm_debug_enabled(DRM_UT_DRIVER)) 28 - return; 29 - 30 - va_start(args, fmt); 31 - 32 - vaf.fmt = fmt; 33 - vaf.va = &args; 34 - 35 - if (is_error) 36 - dev_printk(level, kdev, "%pV", &vaf); 37 - else 38 - dev_printk(level, kdev, "[" DRM_NAME ":%ps] %pV", 39 - __builtin_return_address(0), &vaf); 40 - 41 - va_end(args); 42 - 43 - if (is_error && !shown_bug_once) { 44 - /* 45 - * Ask the user to file a bug report for the error, except 46 - * if they may have caused the bug by fiddling with unsafe 47 - * module parameters. 48 - */ 49 - if (!test_taint(TAINT_USER)) 50 - dev_notice(kdev, "%s", FDO_BUG_MSG); 51 - shown_bug_once = true; 52 - } 53 - } 54 - 55 14 void add_taint_for_CI(struct drm_i915_private *i915, unsigned int taint) 56 15 { 57 16 drm_notice(&i915->drm, "CI tainted: %#x by %pS\n",
+6 -7
drivers/gpu/drm/i915/i915_utils.h
··· 45 45 #define MISSING_CASE(x) WARN(1, "Missing case (%s == %ld)\n", \ 46 46 __stringify(x), (long)(x)) 47 47 48 - void __printf(3, 4) 49 - __i915_printk(struct drm_i915_private *dev_priv, const char *level, 50 - const char *fmt, ...); 51 - 52 48 #if IS_ENABLED(CONFIG_DRM_I915_DEBUG) 53 49 54 50 int __i915_inject_probe_error(struct drm_i915_private *i915, int err, ··· 62 66 63 67 #define i915_inject_probe_failure(i915) i915_inject_probe_error((i915), -ENODEV) 64 68 65 - #define i915_probe_error(i915, fmt, ...) \ 66 - __i915_printk(i915, i915_error_injected() ? KERN_DEBUG : KERN_ERR, \ 67 - fmt, ##__VA_ARGS__) 69 + #define i915_probe_error(i915, fmt, ...) ({ \ 70 + if (i915_error_injected()) \ 71 + drm_dbg(&(i915)->drm, fmt, ##__VA_ARGS__); \ 72 + else \ 73 + drm_err(&(i915)->drm, fmt, ##__VA_ARGS__); \ 74 + }) 68 75 69 76 #define range_overflows(start, size, max) ({ \ 70 77 typeof(start) start__ = (start); \