Skip to content

Commit a395d6a

Browse files
JoePerchestorvalds
authored andcommitted
kernel/...: convert pr_warning to pr_warn
Use the more common logging method with the eventual goal of removing pr_warning altogether. Miscellanea: - Realign arguments - Coalesce formats - Add missing space between a few coalesced formats Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> [kernel/power/suspend.c] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 20d7a35 commit a395d6a

File tree

13 files changed

+52
-60
lines changed

13 files changed

+52
-60
lines changed

kernel/irq/manage.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,8 +1322,8 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
13221322

13231323
if (nmsk != omsk)
13241324
/* hope the handler works with current trigger mode */
1325-
pr_warning("irq %d uses trigger mode %u; requested %u\n",
1326-
irq, nmsk, omsk);
1325+
pr_warn("irq %d uses trigger mode %u; requested %u\n",
1326+
irq, nmsk, omsk);
13271327
}
13281328

13291329
*old_ptr = new;

kernel/power/suspend.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,7 @@ static int enter_state(suspend_state_t state)
473473
if (state == PM_SUSPEND_FREEZE) {
474474
#ifdef CONFIG_PM_DEBUG
475475
if (pm_test_level != TEST_NONE && pm_test_level <= TEST_CPUS) {
476-
pr_warning("PM: Unsupported test mode for suspend to idle,"
477-
"please choose none/freezer/devices/platform.\n");
476+
pr_warn("PM: Unsupported test mode for suspend to idle, please choose none/freezer/devices/platform.\n");
478477
return -EAGAIN;
479478
}
480479
#endif

kernel/time/tick-sched.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ static int __init tick_nohz_full_setup(char *str)
378378
{
379379
alloc_bootmem_cpumask_var(&tick_nohz_full_mask);
380380
if (cpulist_parse(str, tick_nohz_full_mask) < 0) {
381-
pr_warning("NOHZ: Incorrect nohz_full cpumask\n");
381+
pr_warn("NO_HZ: Incorrect nohz_full cpumask\n");
382382
free_bootmem_cpumask_var(tick_nohz_full_mask);
383383
return 1;
384384
}
@@ -446,8 +446,7 @@ void __init tick_nohz_init(void)
446446
* interrupts to avoid circular dependency on the tick
447447
*/
448448
if (!arch_irq_work_has_interrupt()) {
449-
pr_warning("NO_HZ: Can't run full dynticks because arch doesn't "
450-
"support irq work self-IPIs\n");
449+
pr_warn("NO_HZ: Can't run full dynticks because arch doesn't support irq work self-IPIs\n");
451450
cpumask_clear(tick_nohz_full_mask);
452451
cpumask_copy(housekeeping_mask, cpu_possible_mask);
453452
tick_nohz_full_running = false;
@@ -457,7 +456,8 @@ void __init tick_nohz_init(void)
457456
cpu = smp_processor_id();
458457

459458
if (cpumask_test_cpu(cpu, tick_nohz_full_mask)) {
460-
pr_warning("NO_HZ: Clearing %d from nohz_full range for timekeeping\n", cpu);
459+
pr_warn("NO_HZ: Clearing %d from nohz_full range for timekeeping\n",
460+
cpu);
461461
cpumask_clear_cpu(cpu, tick_nohz_full_mask);
462462
}
463463

kernel/trace/blktrace.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,12 +1437,12 @@ static struct trace_event trace_blk_event = {
14371437
static int __init init_blk_tracer(void)
14381438
{
14391439
if (!register_trace_event(&trace_blk_event)) {
1440-
pr_warning("Warning: could not register block events\n");
1440+
pr_warn("Warning: could not register block events\n");
14411441
return 1;
14421442
}
14431443

14441444
if (register_tracer(&blk_tracer) != 0) {
1445-
pr_warning("Warning: could not register the block tracer\n");
1445+
pr_warn("Warning: could not register the block tracer\n");
14461446
unregister_trace_event(&trace_blk_event);
14471447
return 1;
14481448
}

kernel/trace/ftrace.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,8 +1058,7 @@ static __init void ftrace_profile_tracefs(struct dentry *d_tracer)
10581058
entry = tracefs_create_file("function_profile_enabled", 0644,
10591059
d_tracer, NULL, &ftrace_profile_fops);
10601060
if (!entry)
1061-
pr_warning("Could not create tracefs "
1062-
"'function_profile_enabled' entry\n");
1061+
pr_warn("Could not create tracefs 'function_profile_enabled' entry\n");
10631062
}
10641063

10651064
#else /* CONFIG_FUNCTION_PROFILER */
@@ -2314,8 +2313,8 @@ unsigned long ftrace_get_addr_curr(struct dyn_ftrace *rec)
23142313
if (rec->flags & FTRACE_FL_TRAMP_EN) {
23152314
ops = ftrace_find_tramp_ops_curr(rec);
23162315
if (FTRACE_WARN_ON(!ops)) {
2317-
pr_warning("Bad trampoline accounting at: %p (%pS)\n",
2318-
(void *)rec->ip, (void *)rec->ip);
2316+
pr_warn("Bad trampoline accounting at: %p (%pS)\n",
2317+
(void *)rec->ip, (void *)rec->ip);
23192318
/* Ftrace is shutting down, return anything */
23202319
return (unsigned long)FTRACE_ADDR;
23212320
}

kernel/trace/trace.c

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2071,20 +2071,20 @@ void trace_printk_init_buffers(void)
20712071

20722072
/* trace_printk() is for debug use only. Don't use it in production. */
20732073

2074-
pr_warning("\n");
2075-
pr_warning("**********************************************************\n");
2076-
pr_warning("** NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE **\n");
2077-
pr_warning("** **\n");
2078-
pr_warning("** trace_printk() being used. Allocating extra memory. **\n");
2079-
pr_warning("** **\n");
2080-
pr_warning("** This means that this is a DEBUG kernel and it is **\n");
2081-
pr_warning("** unsafe for production use. **\n");
2082-
pr_warning("** **\n");
2083-
pr_warning("** If you see this message and you are not debugging **\n");
2084-
pr_warning("** the kernel, report this immediately to your vendor! **\n");
2085-
pr_warning("** **\n");
2086-
pr_warning("** NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE **\n");
2087-
pr_warning("**********************************************************\n");
2074+
pr_warn("\n");
2075+
pr_warn("**********************************************************\n");
2076+
pr_warn("** NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE **\n");
2077+
pr_warn("** **\n");
2078+
pr_warn("** trace_printk() being used. Allocating extra memory. **\n");
2079+
pr_warn("** **\n");
2080+
pr_warn("** This means that this is a DEBUG kernel and it is **\n");
2081+
pr_warn("** unsafe for production use. **\n");
2082+
pr_warn("** **\n");
2083+
pr_warn("** If you see this message and you are not debugging **\n");
2084+
pr_warn("** the kernel, report this immediately to your vendor! **\n");
2085+
pr_warn("** **\n");
2086+
pr_warn("** NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE **\n");
2087+
pr_warn("**********************************************************\n");
20882088

20892089
/* Expand the buffers to set size */
20902090
tracing_update_buffers();
@@ -4101,7 +4101,7 @@ trace_insert_enum_map_file(struct module *mod, struct trace_enum_map **start,
41014101
*/
41024102
map_array = kmalloc(sizeof(*map_array) * (len + 2), GFP_KERNEL);
41034103
if (!map_array) {
4104-
pr_warning("Unable to allocate trace enum mapping\n");
4104+
pr_warn("Unable to allocate trace enum mapping\n");
41054105
return;
41064106
}
41074107

@@ -6131,7 +6131,7 @@ tracing_init_tracefs_percpu(struct trace_array *tr, long cpu)
61316131
snprintf(cpu_dir, 30, "cpu%ld", cpu);
61326132
d_cpu = tracefs_create_dir(cpu_dir, d_percpu);
61336133
if (!d_cpu) {
6134-
pr_warning("Could not create tracefs '%s' entry\n", cpu_dir);
6134+
pr_warn("Could not create tracefs '%s' entry\n", cpu_dir);
61356135
return;
61366136
}
61376137

@@ -6318,7 +6318,7 @@ struct dentry *trace_create_file(const char *name,
63186318

63196319
ret = tracefs_create_file(name, mode, parent, data, fops);
63206320
if (!ret)
6321-
pr_warning("Could not create tracefs '%s' entry\n", name);
6321+
pr_warn("Could not create tracefs '%s' entry\n", name);
63226322

63236323
return ret;
63246324
}
@@ -6337,7 +6337,7 @@ static struct dentry *trace_options_init_dentry(struct trace_array *tr)
63376337

63386338
tr->options = tracefs_create_dir("options", d_tracer);
63396339
if (!tr->options) {
6340-
pr_warning("Could not create tracefs directory 'options'\n");
6340+
pr_warn("Could not create tracefs directory 'options'\n");
63416341
return NULL;
63426342
}
63436343

@@ -7248,8 +7248,8 @@ __init static int tracer_alloc_buffers(void)
72487248
if (trace_boot_clock) {
72497249
ret = tracing_set_clock(&global_trace, trace_boot_clock);
72507250
if (ret < 0)
7251-
pr_warning("Trace clock %s not defined, going back to default\n",
7252-
trace_boot_clock);
7251+
pr_warn("Trace clock %s not defined, going back to default\n",
7252+
trace_boot_clock);
72537253
}
72547254

72557255
/*

kernel/trace/trace_functions_graph.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1350,7 +1350,7 @@ void graph_trace_open(struct trace_iterator *iter)
13501350
out_err_free:
13511351
kfree(data);
13521352
out_err:
1353-
pr_warning("function graph tracer: not enough memory\n");
1353+
pr_warn("function graph tracer: not enough memory\n");
13541354
}
13551355

13561356
void graph_trace_close(struct trace_iterator *iter)
@@ -1468,12 +1468,12 @@ static __init int init_graph_trace(void)
14681468
max_bytes_for_cpu = snprintf(NULL, 0, "%d", nr_cpu_ids - 1);
14691469

14701470
if (!register_trace_event(&graph_trace_entry_event)) {
1471-
pr_warning("Warning: could not register graph trace events\n");
1471+
pr_warn("Warning: could not register graph trace events\n");
14721472
return 1;
14731473
}
14741474

14751475
if (!register_trace_event(&graph_trace_ret_event)) {
1476-
pr_warning("Warning: could not register graph trace events\n");
1476+
pr_warn("Warning: could not register graph trace events\n");
14771477
return 1;
14781478
}
14791479

kernel/trace/trace_kprobe.c

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -459,16 +459,14 @@ static int __register_trace_kprobe(struct trace_kprobe *tk)
459459
if (ret == 0)
460460
tk->tp.flags |= TP_FLAG_REGISTERED;
461461
else {
462-
pr_warning("Could not insert probe at %s+%lu: %d\n",
463-
trace_kprobe_symbol(tk), trace_kprobe_offset(tk), ret);
462+
pr_warn("Could not insert probe at %s+%lu: %d\n",
463+
trace_kprobe_symbol(tk), trace_kprobe_offset(tk), ret);
464464
if (ret == -ENOENT && trace_kprobe_is_on_module(tk)) {
465-
pr_warning("This probe might be able to register after"
466-
"target module is loaded. Continue.\n");
465+
pr_warn("This probe might be able to register after target module is loaded. Continue.\n");
467466
ret = 0;
468467
} else if (ret == -EILSEQ) {
469-
pr_warning("Probing address(0x%p) is not an "
470-
"instruction boundary.\n",
471-
tk->rp.kp.addr);
468+
pr_warn("Probing address(0x%p) is not an instruction boundary.\n",
469+
tk->rp.kp.addr);
472470
ret = -EINVAL;
473471
}
474472
}
@@ -529,7 +527,7 @@ static int register_trace_kprobe(struct trace_kprobe *tk)
529527
/* Register new event */
530528
ret = register_kprobe_event(tk);
531529
if (ret) {
532-
pr_warning("Failed to register probe event(%d)\n", ret);
530+
pr_warn("Failed to register probe event(%d)\n", ret);
533531
goto end;
534532
}
535533

@@ -564,10 +562,9 @@ static int trace_kprobe_module_callback(struct notifier_block *nb,
564562
__unregister_trace_kprobe(tk);
565563
ret = __register_trace_kprobe(tk);
566564
if (ret)
567-
pr_warning("Failed to re-register probe %s on"
568-
"%s: %d\n",
569-
trace_event_name(&tk->tp.call),
570-
mod->name, ret);
565+
pr_warn("Failed to re-register probe %s on %s: %d\n",
566+
trace_event_name(&tk->tp.call),
567+
mod->name, ret);
571568
}
572569
}
573570
mutex_unlock(&probe_lock);
@@ -1336,16 +1333,14 @@ static __init int init_kprobe_trace(void)
13361333

13371334
/* Event list interface */
13381335
if (!entry)
1339-
pr_warning("Could not create tracefs "
1340-
"'kprobe_events' entry\n");
1336+
pr_warn("Could not create tracefs 'kprobe_events' entry\n");
13411337

13421338
/* Profile interface */
13431339
entry = tracefs_create_file("kprobe_profile", 0444, d_tracer,
13441340
NULL, &kprobe_profile_ops);
13451341

13461342
if (!entry)
1347-
pr_warning("Could not create tracefs "
1348-
"'kprobe_profile' entry\n");
1343+
pr_warn("Could not create tracefs 'kprobe_profile' entry\n");
13491344
return 0;
13501345
}
13511346
fs_initcall(init_kprobe_trace);

kernel/trace/trace_mmiotrace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ static ssize_t mmio_read(struct trace_iterator *iter, struct file *filp,
146146
/* XXX: This is later than where events were lost. */
147147
trace_seq_printf(s, "MARK 0.000000 Lost %lu events.\n", n);
148148
if (!overrun_detected)
149-
pr_warning("mmiotrace has lost events.\n");
149+
pr_warn("mmiotrace has lost events\n");
150150
overrun_detected = true;
151151
goto print_out;
152152
}

kernel/trace/trace_probe.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -636,8 +636,8 @@ ssize_t traceprobe_probes_write(struct file *file, const char __user *buffer,
636636
*tmp = '\0';
637637
size = tmp - kbuf + 1;
638638
} else if (done + size < count) {
639-
pr_warning("Line length is too long: "
640-
"Should be less than %d.", WRITE_BUFSIZE);
639+
pr_warn("Line length is too long: Should be less than %d\n",
640+
WRITE_BUFSIZE);
641641
ret = -EINVAL;
642642
goto out;
643643
}

kernel/trace/trace_stat.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,7 @@ static int tracing_stat_init(void)
281281

282282
stat_dir = tracefs_create_dir("trace_stat", d_tracing);
283283
if (!stat_dir)
284-
pr_warning("Could not create tracefs "
285-
"'trace_stat' entry\n");
284+
pr_warn("Could not create tracefs 'trace_stat' entry\n");
286285
return 0;
287286
}
288287

kernel/trace/trace_uprobe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ static int register_trace_uprobe(struct trace_uprobe *tu)
334334

335335
ret = register_uprobe_event(tu);
336336
if (ret) {
337-
pr_warning("Failed to register probe event(%d)\n", ret);
337+
pr_warn("Failed to register probe event(%d)\n", ret);
338338
goto end;
339339
}
340340

kernel/tracepoint.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ static __init int init_tracepoints(void)
491491

492492
ret = register_module_notifier(&tracepoint_module_nb);
493493
if (ret)
494-
pr_warning("Failed to register tracepoint module enter notifier\n");
494+
pr_warn("Failed to register tracepoint module enter notifier\n");
495495

496496
return ret;
497497
}

0 commit comments

Comments
 (0)