Skip to content

Commit 372f244

Browse files
committed
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 <[email protected]> Reviewed-by: Andi Shyti <[email protected]> Reviewed-by: Jonathan Cavitt <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/be9baeab281f75999e96cc7ad1c06c6680494bc1.1722951405.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <[email protected]>
1 parent 94a438a commit 372f244

File tree

2 files changed

+6
-48
lines changed

2 files changed

+6
-48
lines changed

drivers/gpu/drm/i915/i915_utils.c

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -11,47 +11,6 @@
1111
#include "i915_reg.h"
1212
#include "i915_utils.h"
1313

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-
5514
void add_taint_for_CI(struct drm_i915_private *i915, unsigned int taint)
5615
{
5716
drm_notice(&i915->drm, "CI tainted: %#x by %pS\n",

drivers/gpu/drm/i915/i915_utils.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ struct timer_list;
4545
#define MISSING_CASE(x) WARN(1, "Missing case (%s == %ld)\n", \
4646
__stringify(x), (long)(x))
4747

48-
void __printf(3, 4)
49-
__i915_printk(struct drm_i915_private *dev_priv, const char *level,
50-
const char *fmt, ...);
51-
5248
#if IS_ENABLED(CONFIG_DRM_I915_DEBUG)
5349

5450
int __i915_inject_probe_error(struct drm_i915_private *i915, int err,
@@ -66,9 +62,12 @@ bool i915_error_injected(void);
6662

6763
#define i915_inject_probe_failure(i915) i915_inject_probe_error((i915), -ENODEV)
6864

69-
#define i915_probe_error(i915, fmt, ...) \
70-
__i915_printk(i915, i915_error_injected() ? KERN_DEBUG : KERN_ERR, \
71-
fmt, ##__VA_ARGS__)
65+
#define i915_probe_error(i915, fmt, ...) ({ \
66+
if (i915_error_injected()) \
67+
drm_dbg(&(i915)->drm, fmt, ##__VA_ARGS__); \
68+
else \
69+
drm_err(&(i915)->drm, fmt, ##__VA_ARGS__); \
70+
})
7271

7372
#define range_overflows(start, size, max) ({ \
7473
typeof(start) start__ = (start); \

0 commit comments

Comments
 (0)