Skip to content

Commit

Permalink
Merge tag 'printk-for-5.5-pr-warning-removal' of git://git.kernel.org…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
torvalds committed Dec 9, 2019
2 parents 316eaf1 + 969bea5 commit 184b8f7
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 17 deletions.
3 changes: 1 addition & 2 deletions include/linux/printk.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,8 @@ extern int kptr_restrict;
printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__)
#define pr_err(fmt, ...) \
printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
#define pr_warning(fmt, ...) \
#define pr_warn(fmt, ...) \
printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
#define pr_warn pr_warning
#define pr_notice(fmt, ...) \
printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
#define pr_info(fmt, ...) \
Expand Down
2 changes: 1 addition & 1 deletion kernel/trace/ring_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -5070,7 +5070,7 @@ static __init int test_ringbuffer(void)
int ret = 0;

if (security_locked_down(LOCKDOWN_TRACEFS)) {
pr_warning("Lockdown is enabled, skipping ring buffer tests\n");
pr_warn("Lockdown is enabled, skipping ring buffer tests\n");
return 0;
}

Expand Down
6 changes: 3 additions & 3 deletions kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -1889,7 +1889,7 @@ int __init register_tracer(struct tracer *type)
}

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

if (security_locked_down(LOCKDOWN_TRACEFS)) {
pr_warning("Tracing disabled due to lockdown\n");
pr_warn("Tracing disabled due to lockdown\n");
return ERR_PTR(-EPERM);
}

Expand Down Expand Up @@ -9244,7 +9244,7 @@ __init static int tracer_alloc_buffers(void)


if (security_locked_down(LOCKDOWN_TRACEFS)) {
pr_warning("Tracing disabled due to lockdown\n");
pr_warn("Tracing disabled due to lockdown\n");
return -EPERM;
}

Expand Down
4 changes: 2 additions & 2 deletions kernel/workqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -4374,8 +4374,8 @@ void destroy_workqueue(struct workqueue_struct *wq)
for_each_pwq(pwq, wq) {
spin_lock_irq(&pwq->pool->lock);
if (WARN_ON(pwq_busy(pwq))) {
pr_warning("%s: %s has the following busy pwq\n",
__func__, wq->name);
pr_warn("%s: %s has the following busy pwq\n",
__func__, wq->name);
show_pwq(pwq);
spin_unlock_irq(&pwq->pool->lock);
mutex_unlock(&wq->mutex);
Expand Down
9 changes: 0 additions & 9 deletions scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -4125,15 +4125,6 @@ sub process {
"Prefer [subsystem eg: netdev]_$level2([subsystem]dev, ... then dev_$level2(dev, ... then pr_$level(... to printk(KERN_$orig ...\n" . $herecurr);
}

if ($line =~ /\bpr_warning\s*\(/) {
if (WARN("PREFER_PR_LEVEL",
"Prefer pr_warn(... to pr_warning(...\n" . $herecurr) &&
$fix) {
$fixed[$fixlinenr] =~
s/\bpr_warning\b/pr_warn/;
}
}

if ($line =~ /\bdev_printk\s*\(\s*KERN_([A-Z]+)/) {
my $orig = $1;
my $level = lc($orig);
Expand Down

0 comments on commit 184b8f7

Please sign in to comment.