Skip to content

Commit 184b8f7

Browse files
committed
Merge tag 'printk-for-5.5-pr-warning-removal' of git://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk
Pull pr_warning() removal from Petr Mladek. - Final removal of the unused pr_warning() alias. You're supposed to use just "pr_warn()" in the kernel. * tag 'printk-for-5.5-pr-warning-removal' of git://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk: checkpatch: Drop pr_warning check printk: Drop pr_warning definition Fix up for "printk: Drop pr_warning definition" workqueue: Use pr_warn instead of pr_warning
2 parents 316eaf1 + 969bea5 commit 184b8f7

File tree

5 files changed

+7
-17
lines changed

5 files changed

+7
-17
lines changed

include/linux/printk.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,9 +302,8 @@ extern int kptr_restrict;
302302
printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__)
303303
#define pr_err(fmt, ...) \
304304
printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
305-
#define pr_warning(fmt, ...) \
305+
#define pr_warn(fmt, ...) \
306306
printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
307-
#define pr_warn pr_warning
308307
#define pr_notice(fmt, ...) \
309308
printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
310309
#define pr_info(fmt, ...) \

kernel/trace/ring_buffer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5070,7 +5070,7 @@ static __init int test_ringbuffer(void)
50705070
int ret = 0;
50715071

50725072
if (security_locked_down(LOCKDOWN_TRACEFS)) {
5073-
pr_warning("Lockdown is enabled, skipping ring buffer tests\n");
5073+
pr_warn("Lockdown is enabled, skipping ring buffer tests\n");
50745074
return 0;
50755075
}
50765076

kernel/trace/trace.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1889,7 +1889,7 @@ int __init register_tracer(struct tracer *type)
18891889
}
18901890

18911891
if (security_locked_down(LOCKDOWN_TRACEFS)) {
1892-
pr_warning("Can not register tracer %s due to lockdown\n",
1892+
pr_warn("Can not register tracer %s due to lockdown\n",
18931893
type->name);
18941894
return -EPERM;
18951895
}
@@ -8796,7 +8796,7 @@ struct dentry *tracing_init_dentry(void)
87968796
struct trace_array *tr = &global_trace;
87978797

87988798
if (security_locked_down(LOCKDOWN_TRACEFS)) {
8799-
pr_warning("Tracing disabled due to lockdown\n");
8799+
pr_warn("Tracing disabled due to lockdown\n");
88008800
return ERR_PTR(-EPERM);
88018801
}
88028802

@@ -9244,7 +9244,7 @@ __init static int tracer_alloc_buffers(void)
92449244

92459245

92469246
if (security_locked_down(LOCKDOWN_TRACEFS)) {
9247-
pr_warning("Tracing disabled due to lockdown\n");
9247+
pr_warn("Tracing disabled due to lockdown\n");
92489248
return -EPERM;
92499249
}
92509250

kernel/workqueue.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4374,8 +4374,8 @@ void destroy_workqueue(struct workqueue_struct *wq)
43744374
for_each_pwq(pwq, wq) {
43754375
spin_lock_irq(&pwq->pool->lock);
43764376
if (WARN_ON(pwq_busy(pwq))) {
4377-
pr_warning("%s: %s has the following busy pwq\n",
4378-
__func__, wq->name);
4377+
pr_warn("%s: %s has the following busy pwq\n",
4378+
__func__, wq->name);
43794379
show_pwq(pwq);
43804380
spin_unlock_irq(&pwq->pool->lock);
43814381
mutex_unlock(&wq->mutex);

scripts/checkpatch.pl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4125,15 +4125,6 @@ sub process {
41254125
"Prefer [subsystem eg: netdev]_$level2([subsystem]dev, ... then dev_$level2(dev, ... then pr_$level(... to printk(KERN_$orig ...\n" . $herecurr);
41264126
}
41274127

4128-
if ($line =~ /\bpr_warning\s*\(/) {
4129-
if (WARN("PREFER_PR_LEVEL",
4130-
"Prefer pr_warn(... to pr_warning(...\n" . $herecurr) &&
4131-
$fix) {
4132-
$fixed[$fixlinenr] =~
4133-
s/\bpr_warning\b/pr_warn/;
4134-
}
4135-
}
4136-
41374128
if ($line =~ /\bdev_printk\s*\(\s*KERN_([A-Z]+)/) {
41384129
my $orig = $1;
41394130
my $level = lc($orig);

0 commit comments

Comments
 (0)