Skip to content

Commit

Permalink
Merge tag 'printk-for-5.5' of git://git.kernel.org/pub/scm/linux/kern…
Browse files Browse the repository at this point in the history
…el/git/pmladek/printk

Pull printk updates from Petr Mladek:

 - Allow to print symbolic error names via new %pe modifier.

 - Use pr_warn() instead of the remaining pr_warning() calls. Fix
   formatting of the related lines.

 - Add VSPRINTF entry to MAINTAINERS.

* tag 'printk-for-5.5' of git://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk: (32 commits)
  checkpatch: don't warn about new vsprintf pointer extension '%pe'
  MAINTAINERS: Add VSPRINTF
  tools lib api: Renaming pr_warning to pr_warn
  ASoC: samsung: Use pr_warn instead of pr_warning
  lib: cpu_rmap: Use pr_warn instead of pr_warning
  trace: Use pr_warn instead of pr_warning
  dma-debug: Use pr_warn instead of pr_warning
  vgacon: Use pr_warn instead of pr_warning
  fs: afs: Use pr_warn instead of pr_warning
  sh/intc: Use pr_warn instead of pr_warning
  scsi: Use pr_warn instead of pr_warning
  platform/x86: intel_oaktrail: Use pr_warn instead of pr_warning
  platform/x86: asus-laptop: Use pr_warn instead of pr_warning
  platform/x86: eeepc-laptop: Use pr_warn instead of pr_warning
  oprofile: Use pr_warn instead of pr_warning
  of: Use pr_warn instead of pr_warning
  macintosh: Use pr_warn instead of pr_warning
  idsn: Use pr_warn instead of pr_warning
  ide: Use pr_warn instead of pr_warning
  crypto: n2: Use pr_warn instead of pr_warning
  ...
  • Loading branch information
torvalds committed Nov 26, 2019
2 parents 1b96a41 + 1d28122 commit 436b2a8
Show file tree
Hide file tree
Showing 78 changed files with 571 additions and 269 deletions.
12 changes: 12 additions & 0 deletions Documentation/core-api/printk-formats.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,18 @@ has the added benefit of providing a unique identifier. On 64-bit machines
the first 32 bits are zeroed. The kernel will print ``(ptrval)`` until it
gathers enough entropy. If you *really* want the address see %px below.

Error Pointers
--------------

::

%pe -ENOSPC

For printing error pointers (i.e. a pointer for which IS_ERR() is true)
as a symbolic error name. Error values for which no symbolic name is
known are printed in decimal, while a non-ERR_PTR passed as the
argument to %pe gets treated as ordinary %p.

Symbols/Function Pointers
-------------------------

Expand Down
12 changes: 12 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -17474,6 +17474,18 @@ S: Maintained
F: drivers/net/vrf.c
F: Documentation/networking/vrf.txt

VSPRINTF
M: Petr Mladek <[email protected]>
M: Steven Rostedt <[email protected]>
M: Sergey Senozhatsky <[email protected]>
R: Andy Shevchenko <[email protected]>
R: Rasmus Villemoes <[email protected]>
T: git git://git.kernel.org/pub/scm/linux/kernel/git/pmladek/printk.git
S: Maintained
F: lib/vsprintf.c
F: lib/test_printf.c
F: Documentation/core-api/printk-formats.rst

VT1211 HARDWARE MONITOR DRIVER
M: Juerg Haefliger <[email protected]>
L: [email protected]
Expand Down
4 changes: 2 additions & 2 deletions arch/alpha/kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,7 @@ static void alpha_perf_event_irq_handler(unsigned long la_ptr,
if (unlikely(la_ptr >= alpha_pmu->num_pmcs)) {
/* This should never occur! */
irq_err_count++;
pr_warning("PMI: silly index %ld\n", la_ptr);
pr_warn("PMI: silly index %ld\n", la_ptr);
wrperfmon(PERFMON_CMD_ENABLE, cpuc->idx_mask);
return;
}
Expand All @@ -847,7 +847,7 @@ static void alpha_perf_event_irq_handler(unsigned long la_ptr,
if (unlikely(!event)) {
/* This should never occur! */
irq_err_count++;
pr_warning("PMI: No event at index %d!\n", idx);
pr_warn("PMI: No event at index %d!\n", idx);
wrperfmon(PERFMON_CMD_ENABLE, cpuc->idx_mask);
return;
}
Expand Down
8 changes: 4 additions & 4 deletions arch/arm64/kernel/hw_breakpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ int hw_breakpoint_slots(int type)
case TYPE_DATA:
return get_num_wrps();
default:
pr_warning("unknown slot type: %d\n", type);
pr_warn("unknown slot type: %d\n", type);
return 0;
}
}
Expand Down Expand Up @@ -112,7 +112,7 @@ static u64 read_wb_reg(int reg, int n)
GEN_READ_WB_REG_CASES(AARCH64_DBG_REG_WVR, AARCH64_DBG_REG_NAME_WVR, val);
GEN_READ_WB_REG_CASES(AARCH64_DBG_REG_WCR, AARCH64_DBG_REG_NAME_WCR, val);
default:
pr_warning("attempt to read from unknown breakpoint register %d\n", n);
pr_warn("attempt to read from unknown breakpoint register %d\n", n);
}

return val;
Expand All @@ -127,7 +127,7 @@ static void write_wb_reg(int reg, int n, u64 val)
GEN_WRITE_WB_REG_CASES(AARCH64_DBG_REG_WVR, AARCH64_DBG_REG_NAME_WVR, val);
GEN_WRITE_WB_REG_CASES(AARCH64_DBG_REG_WCR, AARCH64_DBG_REG_NAME_WCR, val);
default:
pr_warning("attempt to write to unknown breakpoint register %d\n", n);
pr_warn("attempt to write to unknown breakpoint register %d\n", n);
}
isb();
}
Expand All @@ -145,7 +145,7 @@ static enum dbg_active_el debug_exception_level(int privilege)
case AARCH64_BREAKPOINT_EL1:
return DBG_ACTIVE_EL1;
default:
pr_warning("invalid breakpoint privilege level %d\n", privilege);
pr_warn("invalid breakpoint privilege level %d\n", privilege);
return -EINVAL;
}
}
Expand Down
11 changes: 5 additions & 6 deletions arch/arm64/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,7 @@ void __cpu_die(unsigned int cpu)
*/
err = op_cpu_kill(cpu);
if (err)
pr_warn("CPU%d may not have shut down cleanly: %d\n",
cpu, err);
pr_warn("CPU%d may not have shut down cleanly: %d\n", cpu, err);
}

/*
Expand Down Expand Up @@ -976,8 +975,8 @@ void smp_send_stop(void)
udelay(1);

if (num_online_cpus() > 1)
pr_warning("SMP: failed to stop secondary CPUs %*pbl\n",
cpumask_pr_args(cpu_online_mask));
pr_warn("SMP: failed to stop secondary CPUs %*pbl\n",
cpumask_pr_args(cpu_online_mask));

sdei_mask_local_cpu();
}
Expand Down Expand Up @@ -1017,8 +1016,8 @@ void crash_smp_send_stop(void)
udelay(1);

if (atomic_read(&waiting_for_crash_ipi) > 0)
pr_warning("SMP: failed to stop secondary CPUs %*pbl\n",
cpumask_pr_args(&mask));
pr_warn("SMP: failed to stop secondary CPUs %*pbl\n",
cpumask_pr_args(&mask));

sdei_mask_local_cpu();
}
Expand Down
2 changes: 1 addition & 1 deletion arch/ia64/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ static void __init setup_crashkernel(unsigned long total, int *n)
}

if (!check_crashkernel_memory(base, size)) {
pr_warning("crashkernel: There would be kdump memory "
pr_warn("crashkernel: There would be kdump memory "
"at %ld GB but this is unusable because it "
"must\nbe below 4 GB. Change the memory "
"configuration of the machine.\n",
Expand Down
4 changes: 2 additions & 2 deletions arch/riscv/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,8 @@ int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab,
/* Ignore unresolved weak symbol */
if (ELF_ST_BIND(sym->st_info) == STB_WEAK)
continue;
pr_warning("%s: Unknown symbol %s\n",
me->name, strtab + sym->st_name);
pr_warn("%s: Unknown symbol %s\n",
me->name, strtab + sym->st_name);
return -ENOENT;
}

Expand Down
2 changes: 1 addition & 1 deletion arch/sh/boards/mach-sdk7786/nmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static int __init nmi_mode_setup(char *str)
nmi_mode = NMI_MODE_ANY;
else {
nmi_mode = NMI_MODE_UNKNOWN;
pr_warning("Unknown NMI mode %s\n", str);
pr_warn("Unknown NMI mode %s\n", str);
}

printk("Set NMI mode to %d\n", nmi_mode);
Expand Down
2 changes: 1 addition & 1 deletion arch/sh/drivers/pci/fixups-sdk7786.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static int __init sdk7786_pci_init(void)

/* Warn about forced rerouting if slot#3 is occupied */
if ((data & PCIECR_PRST3) == 0) {
pr_warning("Unreachable card detected in slot#3\n");
pr_warn("Unreachable card detected in slot#3\n");
return -EBUSY;
}
} else
Expand Down
2 changes: 1 addition & 1 deletion arch/sh/kernel/io_trapped.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ int register_trapped_io(struct trapped_io *tiop)

return 0;
bad:
pr_warning("unable to install trapped io filter\n");
pr_warn("unable to install trapped io filter\n");
return -1;
}
EXPORT_SYMBOL_GPL(register_trapped_io);
Expand Down
2 changes: 1 addition & 1 deletion arch/sh/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ void __init setup_arch(char **cmdline_p)
/* processor boot mode configuration */
int generic_mode_pins(void)
{
pr_warning("generic_mode_pins(): missing mode pin configuration\n");
pr_warn("generic_mode_pins(): missing mode pin configuration\n");
return 0;
}

Expand Down
5 changes: 2 additions & 3 deletions arch/sh/mm/consistent.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ int __init platform_resource_setup_memory(struct platform_device *pdev,

r = pdev->resource + pdev->num_resources - 1;
if (r->flags) {
pr_warning("%s: unable to find empty space for resource\n",
name);
pr_warn("%s: unable to find empty space for resource\n", name);
return -EINVAL;
}

Expand All @@ -54,7 +53,7 @@ int __init platform_resource_setup_memory(struct platform_device *pdev,

buf = dma_alloc_coherent(&pdev->dev, memsize, &dma_handle, GFP_KERNEL);
if (!buf) {
pr_warning("%s: unable to allocate memory\n", name);
pr_warn("%s: unable to allocate memory\n", name);
return -ENOMEM;
}

Expand Down
6 changes: 3 additions & 3 deletions arch/sparc/kernel/smp_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -1673,9 +1673,9 @@ void __init setup_per_cpu_areas(void)
pcpu_alloc_bootmem,
pcpu_free_bootmem);
if (rc)
pr_warning("PERCPU: %s allocator failed (%d), "
"falling back to page size\n",
pcpu_fc_names[pcpu_chosen_fc], rc);
pr_warn("PERCPU: %s allocator failed (%d), "
"falling back to page size\n",
pcpu_fc_names[pcpu_chosen_fc], rc);
}
if (rc < 0)
rc = pcpu_page_first_chunk(PERCPU_MODULE_RESERVE,
Expand Down
12 changes: 5 additions & 7 deletions arch/x86/kernel/amd_gart_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,10 +510,9 @@ static __init unsigned long check_iommu_size(unsigned long aper, u64 aper_size)
iommu_size -= round_up(a, PMD_PAGE_SIZE) - a;

if (iommu_size < 64*1024*1024) {
pr_warning(
"PCI-DMA: Warning: Small IOMMU %luMB."
pr_warn("PCI-DMA: Warning: Small IOMMU %luMB."
" Consider increasing the AGP aperture in BIOS\n",
iommu_size >> 20);
iommu_size >> 20);
}

return iommu_size;
Expand Down Expand Up @@ -665,8 +664,7 @@ static __init int init_amd_gatt(struct agp_kern_info *info)

nommu:
/* Should not happen anymore */
pr_warning("PCI-DMA: More than 4GB of RAM and no IOMMU\n"
"falling back to iommu=soft.\n");
pr_warn("PCI-DMA: More than 4GB of RAM and no IOMMU - falling back to iommu=soft.\n");
return -1;
}

Expand Down Expand Up @@ -733,8 +731,8 @@ int __init gart_iommu_init(void)
!gart_iommu_aperture ||
(no_agp && init_amd_gatt(&info) < 0)) {
if (max_pfn > MAX_DMA32_PFN) {
pr_warning("More than 4GB of memory but GART IOMMU not available.\n");
pr_warning("falling back to iommu=soft.\n");
pr_warn("More than 4GB of memory but GART IOMMU not available.\n");
pr_warn("falling back to iommu=soft.\n");
}
return 0;
}
Expand Down
41 changes: 19 additions & 22 deletions arch/x86/kernel/apic/apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -780,8 +780,8 @@ calibrate_by_pmtimer(long deltapm, long *delta, long *deltatsc)

res = (((u64)deltapm) * mult) >> 22;
do_div(res, 1000000);
pr_warning("APIC calibration not consistent "
"with PM-Timer: %ldms instead of 100ms\n",(long)res);
pr_warn("APIC calibration not consistent "
"with PM-Timer: %ldms instead of 100ms\n", (long)res);

/* Correct the lapic counter value */
res = (((u64)(*delta)) * pm_100ms);
Expand Down Expand Up @@ -977,7 +977,7 @@ static int __init calibrate_APIC_clock(void)
*/
if (lapic_timer_period < (1000000 / HZ)) {
local_irq_enable();
pr_warning("APIC frequency too slow, disabling apic timer\n");
pr_warn("APIC frequency too slow, disabling apic timer\n");
return -1;
}

Expand Down Expand Up @@ -1021,7 +1021,7 @@ static int __init calibrate_APIC_clock(void)
local_irq_enable();

if (levt->features & CLOCK_EVT_FEAT_DUMMY) {
pr_warning("APIC timer disabled due to verification failure\n");
pr_warn("APIC timer disabled due to verification failure\n");
return -1;
}

Expand Down Expand Up @@ -1095,8 +1095,8 @@ static void local_apic_timer_interrupt(void)
* spurious.
*/
if (!evt->event_handler) {
pr_warning("Spurious LAPIC timer interrupt on cpu %d\n",
smp_processor_id());
pr_warn("Spurious LAPIC timer interrupt on cpu %d\n",
smp_processor_id());
/* Switch it off */
lapic_timer_shutdown(evt);
return;
Expand Down Expand Up @@ -1811,11 +1811,11 @@ static int __init setup_nox2apic(char *str)
int apicid = native_apic_msr_read(APIC_ID);

if (apicid >= 255) {
pr_warning("Apicid: %08x, cannot enforce nox2apic\n",
apicid);
pr_warn("Apicid: %08x, cannot enforce nox2apic\n",
apicid);
return 0;
}
pr_warning("x2apic already enabled.\n");
pr_warn("x2apic already enabled.\n");
__x2apic_disable();
}
setup_clear_cpu_cap(X86_FEATURE_X2APIC);
Expand Down Expand Up @@ -1983,7 +1983,7 @@ static int __init apic_verify(void)
*/
features = cpuid_edx(1);
if (!(features & (1 << X86_FEATURE_APIC))) {
pr_warning("Could not enable APIC!\n");
pr_warn("Could not enable APIC!\n");
return -1;
}
set_cpu_cap(&boot_cpu_data, X86_FEATURE_APIC);
Expand Down Expand Up @@ -2410,9 +2410,8 @@ int generic_processor_info(int apicid, int version)
disabled_cpu_apicid == apicid) {
int thiscpu = num_processors + disabled_cpus;

pr_warning("APIC: Disabling requested cpu."
" Processor %d/0x%x ignored.\n",
thiscpu, apicid);
pr_warn("APIC: Disabling requested cpu."
" Processor %d/0x%x ignored.\n", thiscpu, apicid);

disabled_cpus++;
return -ENODEV;
Expand All @@ -2426,8 +2425,7 @@ int generic_processor_info(int apicid, int version)
apicid != boot_cpu_physical_apicid) {
int thiscpu = max + disabled_cpus - 1;

pr_warning(
"APIC: NR_CPUS/possible_cpus limit of %i almost"
pr_warn("APIC: NR_CPUS/possible_cpus limit of %i almost"
" reached. Keeping one slot for boot cpu."
" Processor %d/0x%x ignored.\n", max, thiscpu, apicid);

Expand All @@ -2438,9 +2436,8 @@ int generic_processor_info(int apicid, int version)
if (num_processors >= nr_cpu_ids) {
int thiscpu = max + disabled_cpus;

pr_warning("APIC: NR_CPUS/possible_cpus limit of %i "
"reached. Processor %d/0x%x ignored.\n",
max, thiscpu, apicid);
pr_warn("APIC: NR_CPUS/possible_cpus limit of %i reached. "
"Processor %d/0x%x ignored.\n", max, thiscpu, apicid);

disabled_cpus++;
return -EINVAL;
Expand Down Expand Up @@ -2470,13 +2467,13 @@ int generic_processor_info(int apicid, int version)
* Validate version
*/
if (version == 0x0) {
pr_warning("BIOS bug: APIC version is 0 for CPU %d/0x%x, fixing up to 0x10\n",
cpu, apicid);
pr_warn("BIOS bug: APIC version is 0 for CPU %d/0x%x, fixing up to 0x10\n",
cpu, apicid);
version = 0x10;
}

if (version != boot_cpu_apic_version) {
pr_warning("BIOS bug: APIC version mismatch, boot CPU: %x, CPU %d: version %x\n",
pr_warn("BIOS bug: APIC version mismatch, boot CPU: %x, CPU %d: version %x\n",
boot_cpu_apic_version, cpu, version);
}

Expand Down Expand Up @@ -2845,7 +2842,7 @@ static int __init apic_set_verbosity(char *arg)
apic_verbosity = APIC_VERBOSE;
#ifdef CONFIG_X86_64
else {
pr_warning("APIC Verbosity level %s not recognised"
pr_warn("APIC Verbosity level %s not recognised"
" use apic=verbose or apic=debug\n", arg);
return -EINVAL;
}
Expand Down
4 changes: 2 additions & 2 deletions arch/x86/kernel/setup_percpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ void __init setup_per_cpu_areas(void)
pcpu_cpu_distance,
pcpu_fc_alloc, pcpu_fc_free);
if (rc < 0)
pr_warning("%s allocator failed (%d), falling back to page size\n",
pcpu_fc_names[pcpu_chosen_fc], rc);
pr_warn("%s allocator failed (%d), falling back to page size\n",
pcpu_fc_names[pcpu_chosen_fc], rc);
}
if (rc < 0)
rc = pcpu_page_first_chunk(PERCPU_FIRST_CHUNK_RESERVE,
Expand Down
Loading

0 comments on commit 436b2a8

Please sign in to comment.