Skip to contentSkip to conversation

x86/kernel: use pr_<level>() and dev_<level>

PATCH In review Chen Yucong 4 participants 6 messages Feb 14, 2016 – Feb 16, 2016

Subsystems (13)
x86 ACPI PCI Suspend to RAM +9 more subsystems
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 x86/kernel: use pr_<level>() and dev_<level>

arch/x86/kernel/* use a mixture of printk(KERN_<level> ) and pr_<level>(). This patch converts the bulk of printk(KERN_<level> ) to pr_<level>() and uses dev_dbg() instead of the dev_printk(KERN_DEBUG,). All pr_warning() calls have been replaced with pr_warn().

Not sure what to do about the printk(KERN_DEFAULT) and printk() without a log level.

---
 arch/x86/kernel/acpi/boot.c         | 110 ++++++++++++++++--------------------
 arch/x86/kernel/acpi/cstate.c       |   5 +-
 arch/x86/kernel/acpi/sleep.c        |   2 +-
 arch/x86/kernel/alternative.c       |   8 +--
 arch/x86/kernel/amd_gart_64.c       |  13 ++---
 arch/x86/kernel/apb_timer.c         |  23 ++++----
 arch/x86/kernel/apic/apic.c         |  43 +++++++-------
 arch/x86/kernel/apic/apic_flat_64.c |   4 +-
 arch/x86/kernel/apic/apic_noop.c    |   2 +-
 arch/x86/kernel/apic/bigsmp_32.c    |   5 +-
 arch/x86/kernel/apic/io_apic.c      |  95 +++++++++++++++----------------
 arch/x86/kernel/apic/probe_32.c     |   9 ++-
 arch/x86/kernel/apic/x2apic_phys.c  |   2 +-
 arch/x86/kernel/apic/x2apic_uv_x.c  |   3 +-
 arch/x86/kernel/apm_32.c            |  80 ++++++++++++--------------
 arch/x86/kernel/bootflag.c          |   4 +-
 arch/x86/kernel/check.c             |  11 ++--
 arch/x86/kernel/cpuid.c             |   2 +-
 arch/x86/kernel/crash_dump_32.c     |   6 +-
 arch/x86/kernel/devicetree.c        |   6 +-
 arch/x86/kernel/doublefault.c       |  17 +++---
 arch/x86/kernel/dumpstack.c         |   4 +-
 arch/x86/kernel/e820.c              |  66 +++++++++++-----------
 arch/x86/kernel/early-quirks.c      |  38 +++++--------
 arch/x86/kernel/early_printk.c      |   4 +-
 arch/x86/kernel/fpu/init.c          |   3 +-
 arch/x86/kernel/fpu/xstate.c        |   3 +-
 arch/x86/kernel/hpet.c              |  33 +++++------
 arch/x86/kernel/i8259.c             |   5 +-
 arch/x86/kernel/irq_32.c            |   6 +-
 arch/x86/kernel/jump_label.c        |   4 +-
 arch/x86/kernel/kgdb.c              |   8 +--
 arch/x86/kernel/kprobes/core.c      |  11 ++--
 arch/x86/kernel/kvm.c               |  12 ++--
 arch/x86/kernel/kvmclock.c          |  10 ++--
 arch/x86/kernel/mmconf-fam10h_64.c  |   2 +-
 arch/x86/kernel/module.c            |   4 +-
 arch/x86/kernel/nmi_selftest.c      |  12 ++--
 arch/x86/kernel/paravirt.c          |   2 +-
 arch/x86/kernel/pci-calgary_64.c    |  87 ++++++++++++++--------------
 arch/x86/kernel/pci-iommu_table.c   |   4 +-
 arch/x86/kernel/pci-nommu.c         |   3 +-
 arch/x86/kernel/pci-swiotlb.c       |   3 +-
 arch/x86/kernel/quirks.c            |  48 ++++++++--------
 arch/x86/kernel/rtc.c               |   7 +--
 arch/x86/kernel/setup.c             |  22 ++++----
 arch/x86/kernel/setup_percpu.c      |   2 +-
 arch/x86/kernel/smpboot.c           |   6 +-
 arch/x86/kernel/sysfb_efi.c         |   7 +--
 arch/x86/kernel/sysfb_simplefb.c    |   2 +-
 arch/x86/kernel/tboot.c             |  16 +++---
 arch/x86/kernel/tce_64.c            |   5 +-
 arch/x86/kernel/test_nx.c           |  16 +++---
 arch/x86/kernel/test_rodata.c       |  10 ++--
 arch/x86/kernel/tsc_sync.c          |   6 +-
 arch/x86/kernel/vsmp_64.c           |   2 +-
 arch/x86/pci/mmconfig-shared.c      |  32 +++++------
 arch/x86/pci/mmconfig_64.c          |   4 +-
 58 files changed, 448 insertions(+), 511 deletions(-)
arch/x86/kernel/acpi/boot.c +48 -62
index e759076..cb3afc7 100644
@@ -55,7 +55,8 @@ EXPORT_SYMBOL(acpi_disabled);
 # include <asm/proto.h>
 #endif				/* X86 */
 
-#define PREFIX			"ACPI: "
+#undef pr_fmt
+#define pr_fmt(fmt) "ACPI: " fmt
 
 int acpi_noirq;				/* skip ACPI IRQ initialization */
 int acpi_pci_disabled;		/* skip ACPI PCI scan and IRQ initialization */
@@ -141,14 +142,14 @@ static int __init acpi_parse_madt(struct acpi_table_header *table)
 
 	madt = (struct acpi_table_madt *)table;
 	if (!madt) {
-		printk(KERN_WARNING PREFIX "Unable to map MADT\n");
+		pr_warn("Unable to map MADT\n");
 		return -ENODEV;
 	}
 
 	if (madt->address) {
 		acpi_lapic_addr = (u64) madt->address;
 
-		printk(KERN_DEBUG PREFIX "Local APIC address 0x%08x\n",
+		pr_debug("Local APIC address 0x%08x\n",
 		       madt->address);
 	}
 
@@ -170,7 +171,7 @@ static int acpi_register_lapic(int id, u8 enabled)
 	unsigned int ver = 0;
 
 	if (id >= MAX_LOCAL_APIC) {
-		printk(KERN_INFO PREFIX "skipped apicid that is too big\n");
+		pr_info("skipped apicid that is too big\n");
 		return -EINVAL;
 	}
 
@@ -210,11 +211,11 @@ acpi_parse_x2apic(struct acpi_subtable_header *header, const unsigned long end)
 	 * when we use CPU hotplug.
 	 */
 	if (!apic->apic_id_valid(apic_id) && enabled)
-		printk(KERN_WARNING PREFIX "x2apic entry ignored\n");
+		pr_warn("x2apic entry ignored\n");
 	else
 		acpi_register_lapic(apic_id, enabled);
 #else
-	printk(KERN_WARNING PREFIX "x2apic entry ignored\n");
+	pr_warn("x2apic entry ignored\n");
 #endif
 
 	return 0;
@@ -293,7 +294,7 @@ acpi_parse_x2apic_nmi(struct acpi_subtable_header *header,
 	acpi_table_print_madt_entry(header);
 
 	if (x2apic_nmi->lint != 1)
-		printk(KERN_WARNING PREFIX "NMI not connected to LINT 1!\n");
+		pr_warn("NMI not connected to LINT 1!\n");
 
 	return 0;
 }
@@ -311,7 +312,7 @@ acpi_parse_lapic_nmi(struct acpi_subtable_header * header, const unsigned long e
 	acpi_table_print_madt_entry(header);
 
 	if (lapic_nmi->lint != 1)
-		printk(KERN_WARNING PREFIX "NMI not connected to LINT 1!\n");
+		pr_warn("NMI not connected to LINT 1!\n");
 
 	return 0;
 }
@@ -478,14 +479,14 @@ acpi_parse_int_src_ovr(struct acpi_subtable_header * header,
 
 	if (intsrc->source_irq == 0) {
 		if (acpi_skip_timer_override) {
-			printk(PREFIX "BIOS IRQ0 override ignored.\n");
+			pr_info("BIOS IRQ0 override ignored.\n");
 			return 0;
 		}
 
 		if ((intsrc->global_irq == 2) && acpi_fix_pin2_polarity
 			&& (intsrc->inti_flags & ACPI_MADT_POLARITY_MASK)) {
 			intsrc->inti_flags &= ~ACPI_MADT_POLARITY_MASK;
-			printk(PREFIX "BIOS IRQ0 pin2 override: forcing polarity to high active.\n");
+			pr_info("BIOS IRQ0 pin2 override: forcing polarity to high active.\n");
 		}
 	}
 
@@ -561,7 +562,7 @@ void __init acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger)
 	if (old == new)
 		return;
 
-	printk(PREFIX "setting ELCR to %04x (from %04x)\n", new, old);
+	pr_info("setting ELCR to %04x (from %04x)\n", new, old);
 	outb(new, 0x4d0);
 	outb(new >> 8, 0x4d1);
 }
@@ -717,7 +718,7 @@ int acpi_map_cpu(acpi_handle handle, phys_cpuid_t physid, int *pcpu)
 
 	cpu = acpi_register_lapic(physid, ACPI_MADT_ENABLED);
 	if (cpu < 0) {
-		pr_info(PREFIX "Unable to map lapic to logical cpu number\n");
+		pr_info("Unable to map lapic to logical cpu number\n");
 		return cpu;
 	}
 
@@ -833,8 +834,7 @@ static int __init acpi_parse_hpet(struct acpi_table_header *table)
 	struct acpi_table_hpet *hpet_tbl = (struct acpi_table_hpet *)table;
 
 	if (hpet_tbl->address.space_id != ACPI_SPACE_MEM) {
-		printk(KERN_WARNING PREFIX "HPET timers must be located in "
-		       "memory.\n");
+		pr_warn("HPET timers must be located in memory.\n");
 		return -1;
 	}
 
@@ -846,9 +846,8 @@ static int __init acpi_parse_hpet(struct acpi_table_header *table)
 	 * want to allocate a resource there.
 	 */
 	if (!hpet_address) {
-		printk(KERN_WARNING PREFIX
-		       "HPET id: %#x base: %#lx is invalid\n",
-		       hpet_tbl->id, hpet_address);
+		pr_warn("HPET id: %#x base: %#lx is invalid\n",
+			hpet_tbl->id, hpet_address);
 		return 0;
 	}
 #ifdef CONFIG_X86_64
@@ -859,20 +858,19 @@ static int __init acpi_parse_hpet(struct acpi_table_header *table)
 	 */
 	if (hpet_address == 0xfed0000000000000UL) {
 		if (!hpet_force_user) {
-			printk(KERN_WARNING PREFIX "HPET id: %#x "
+			pr_warn("HPET id: %#x "
 			       "base: 0xfed0000000000000 is bogus\n "
 			       "try hpet=force on the kernel command line to "
 			       "fix it up to 0xfed00000.\n", hpet_tbl->id);
 			hpet_address = 0;
 			return 0;
 		}
-		printk(KERN_WARNING PREFIX
-		       "HPET id: %#x base: 0xfed0000000000000 fixed up "
-		       "to 0xfed00000.\n", hpet_tbl->id);
+		pr_warn("HPET id: %#x base: 0xfed0000000000000 fixed up to 0xfed00000.\n",
+			hpet_tbl->id);
 		hpet_address >>= 32;
 	}
 #endif
-	printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n",
+	pr_info("HPET id: %#x base: %#lx\n",
 	       hpet_tbl->id, hpet_address);
 
 	/*
@@ -935,7 +933,7 @@ static int __init acpi_parse_fadt(struct acpi_table_header *table)
 		pmtmr_ioport = acpi_gbl_FADT.pm_timer_block;
 	}
 	if (pmtmr_ioport)
-		printk(KERN_INFO PREFIX "PM-Timer IO Port: %#x\n",
+		pr_info("PM-Timer IO Port: %#x\n",
 		       pmtmr_ioport);
 #endif
 	return 0;
@@ -962,8 +960,7 @@ static int __init early_acpi_parse_madt_lapic_addr_ovr(void)
 	count = acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE,
 				      acpi_parse_lapic_addr_ovr, 0);
 	if (count < 0) {
-		printk(KERN_ERR PREFIX
-		       "Error parsing LAPIC address override entry\n");
+		pr_err("Error parsing LAPIC address override entry\n");
 		return count;
 	}
 
@@ -990,8 +987,7 @@ static int __init acpi_parse_madt_lapic_entries(void)
 	count = acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE,
 				      acpi_parse_lapic_addr_ovr, 0);
 	if (count < 0) {
-		printk(KERN_ERR PREFIX
-		       "Error parsing LAPIC address override entry\n");
+		pr_err("Error parsing LAPIC address override entry\n");
 		return count;
 	}
 
@@ -1010,8 +1006,7 @@ static int __init acpi_parse_madt_lapic_entries(void)
 				sizeof(struct acpi_table_madt),
 				madt_proc, ARRAY_SIZE(madt_proc), MAX_LOCAL_APIC);
 		if (ret < 0) {
-			printk(KERN_ERR PREFIX
-					"Error parsing LAPIC/X2APIC entries\n");
+			pr_err("Error parsing LAPIC/X2APIC entries\n");
 			return ret;
 		}
 
@@ -1019,11 +1014,11 @@ static int __init acpi_parse_madt_lapic_entries(void)
 		count = madt_proc[1].count;
 	}
 	if (!count && !x2count) {
-		printk(KERN_ERR PREFIX "No LAPIC entries present\n");
+		pr_err("No LAPIC entries present\n");
 		/* TBD: Cleanup to allow fallback to MPS */
 		return -ENODEV;
 	} else if (count < 0 || x2count < 0) {
-		printk(KERN_ERR PREFIX "Error parsing LAPIC entry\n");
+		pr_err("Error parsing LAPIC entry\n");
 		/* TBD: Cleanup to allow fallback to MPS */
 		return count;
 	}
@@ -1033,7 +1028,7 @@ static int __init acpi_parse_madt_lapic_entries(void)
 	count = acpi_table_parse_madt(ACPI_MADT_TYPE_LOCAL_APIC_NMI,
 				      acpi_parse_lapic_nmi, 0);
 	if (count < 0 || x2count < 0) {
-		printk(KERN_ERR PREFIX "Error parsing LAPIC NMI entry\n");
+		pr_err("Error parsing LAPIC NMI entry\n");
 		/* TBD: Cleanup to allow fallback to MPS */
 		return count;
 	}
@@ -1092,7 +1087,7 @@ static void __init mp_config_acpi_legacy_irqs(void)
 		}
 
 		if (idx != mp_irq_entries) {
-			printk(KERN_DEBUG "ACPI: IRQ%d used by override.\n", i);
+			pr_debug("ACPI: IRQ%d used by override.\n", i);
 			continue;	/* IRQ already used */
 		}
 
@@ -1132,26 +1127,24 @@ static int __init acpi_parse_madt_ioapic_entries(void)
 	 * if "noapic" boot option, don't look for IO-APICs
 	 */
 	if (skip_ioapic_setup) {
-		printk(KERN_INFO PREFIX "Skipping IOAPIC probe "
-		       "due to 'noapic' option.\n");
+		pr_info("Skipping IOAPIC probe due to 'noapic' option.\n");
 		return -ENODEV;
 	}
 
 	count = acpi_table_parse_madt(ACPI_MADT_TYPE_IO_APIC, acpi_parse_ioapic,
 				      MAX_IO_APICS);
 	if (!count) {
-		printk(KERN_ERR PREFIX "No IOAPIC entries present\n");
+		pr_err("No IOAPIC entries present\n");
 		return -ENODEV;
 	} else if (count < 0) {
-		printk(KERN_ERR PREFIX "Error parsing IOAPIC entry\n");
+		pr_err("Error parsing IOAPIC entry\n");
 		return count;
 	}
 
 	count = acpi_table_parse_madt(ACPI_MADT_TYPE_INTERRUPT_OVERRIDE,
 				      acpi_parse_int_src_ovr, nr_irqs);
 	if (count < 0) {
-		printk(KERN_ERR PREFIX
-		       "Error parsing interrupt source overrides entry\n");
+		pr_err("Error parsing interrupt source overrides entry\n");
 		/* TBD: Cleanup to allow fallback to MPS */
 		return count;
 	}
@@ -1170,7 +1163,7 @@ static int __init acpi_parse_madt_ioapic_entries(void)
 	count = acpi_table_parse_madt(ACPI_MADT_TYPE_NMI_SOURCE,
 				      acpi_parse_nmi_src, nr_irqs);
 	if (count < 0) {
-		printk(KERN_ERR PREFIX "Error parsing NMI SRC entry\n");
+		pr_err("Error parsing NMI SRC entry\n");
 		/* TBD: Cleanup to allow fallback to MPS */
 		return count;
 	}
@@ -1203,8 +1196,7 @@ static void __init early_acpi_process_madt(void)
 			/*
 			 * Dell Precision Workstation 410, 610 come here.
 			 */
-			printk(KERN_ERR PREFIX
-			       "Invalid BIOS MADT, disabling ACPI\n");
+			pr_err("Invalid BIOS MADT, disabling ACPI\n");
 			disable_acpi();
 		}
 	}
@@ -1241,8 +1233,7 @@ static void __init acpi_process_madt(void)
 			/*
 			 * Dell Precision Workstation 410, 610 come here.
 			 */
-			printk(KERN_ERR PREFIX
-			       "Invalid BIOS MADT, disabling ACPI\n");
+			pr_err("Invalid BIOS MADT, disabling ACPI\n");
 			disable_acpi();
 		}
 	} else {
@@ -1252,8 +1243,7 @@ static void __init acpi_process_madt(void)
  		 * Boot with "acpi=off" to use MPS on such a system.
  		 */
 		if (smp_found_config) {
-			printk(KERN_WARNING PREFIX
-				"No APIC-table, disabling MPS\n");
+			pr_warn("No APIC-table, disabling MPS\n");
 			smp_found_config = 0;
 		}
 	}
@@ -1263,11 +1253,9 @@ static void __init acpi_process_madt(void)
 	 * processors, where MPS only supports physical.
 	 */
 	if (acpi_lapic && acpi_ioapic)
-		printk(KERN_INFO "Using ACPI (MADT) for SMP configuration "
-		       "information\n");
+		pr_info("Using ACPI (MADT) for SMP configuration information\n");
 	else if (acpi_lapic)
-		printk(KERN_INFO "Using ACPI for processor (LAPIC) "
-		       "configuration information\n");
+		pr_info("Using ACPI for processor (LAPIC) configuration information\n");
 #endif
 	return;
 }
@@ -1275,8 +1263,8 @@ static void __init acpi_process_madt(void)
 static int __init disable_acpi_irq(const struct dmi_system_id *d)
 {
 	if (!acpi_force) {
-		printk(KERN_NOTICE "%s detected: force use of acpi=noirq\n",
-		       d->ident);
+		pr_notice("%s detected: force use of acpi=noirq\n",
+			  d->ident);
 		acpi_noirq_set();
 	}
 	return 0;
@@ -1285,8 +1273,8 @@ static int __init disable_acpi_irq(const struct dmi_system_id *d)
 static int __init disable_acpi_pci(const struct dmi_system_id *d)
 {
 	if (!acpi_force) {
-		printk(KERN_NOTICE "%s detected: force use of pci=noacpi\n",
-		       d->ident);
+		pr_notice("%s detected: force use of pci=noacpi\n",
+			  d->ident);
 		acpi_disable_pci();
 	}
 	return 0;
@@ -1295,11 +1283,10 @@ static int __init disable_acpi_pci(const struct dmi_system_id *d)
 static int __init dmi_disable_acpi(const struct dmi_system_id *d)
 {
 	if (!acpi_force) {
-		printk(KERN_NOTICE "%s detected: acpi off\n", d->ident);
+		pr_notice("%s detected: acpi off\n", d->ident);
 		disable_acpi();
 	} else {
-		printk(KERN_NOTICE
-		       "Warning: DMI blacklist says broken, but acpi forced\n");
+		pr_notice("Warning: DMI blacklist says broken, but acpi forced\n");
 	}
 	return 0;
 }
@@ -1514,9 +1501,9 @@ void __init acpi_boot_table_init(void)
 	 */
 	if (acpi_blacklisted()) {
 		if (acpi_force) {
-			printk(KERN_WARNING PREFIX "acpi=force override\n");
+			pr_warn("acpi=force override\n");
 		} else {
-			printk(KERN_WARNING PREFIX "Disabling ACPI support\n");
+			pr_warn("Disabling ACPI support\n");
 			disable_acpi();
 			return;
 		}
@@ -1630,9 +1617,8 @@ int __init acpi_mps_check(void)
 #if defined(CONFIG_X86_LOCAL_APIC) && !defined(CONFIG_X86_MPPARSE)
 /* mptable code is not built-in*/
 	if (acpi_disabled || acpi_noirq) {
-		printk(KERN_WARNING "MPS support code is not built-in.\n"
-		       "Using acpi=off or acpi=noirq or pci=noacpi "
-		       "may have problem\n");
+		pr_warn("MPS support code is not built-in.\n"
+			"Using acpi=off or acpi=noirq or pci=noacpi may have problem\n");
 		return 1;
 	}
 #endif
arch/x86/kernel/acpi/cstate.c +2 -3
index 4b28159..d94cb2a 100644
@@ -103,9 +103,8 @@ static long acpi_processor_ffh_cstate_probe_cpu(void *_cx)
 
 	if (!mwait_supported[cstate_type]) {
 		mwait_supported[cstate_type] = 1;
-		printk(KERN_DEBUG
-			"Monitor-Mwait will be used to enter C-%d "
-			"state\n", cx->type);
+		pr_debug("Monitor-Mwait will be used to enter C-%d state\n",
+			 cx->type);
 	}
 	snprintf(cx->desc,
 			ACPI_CX_DESC_LEN, "ACPI FFH INTEL MWAIT 0x%x",
arch/x86/kernel/acpi/sleep.c +1 -1
index d1daead..a850963 100644
@@ -48,7 +48,7 @@ int x86_acpi_suspend_lowlevel(void)
 		(struct wakeup_header *) __va(real_mode_header->wakeup_header);
 
 	if (header->signature != WAKEUP_HEADER_SIGNATURE) {
-		printk(KERN_ERR "wakeup header does not match\n");
+		pr_err("wakeup header does not match\n");
 		return -EINVAL;
 	}
 
arch/x86/kernel/alternative.c +4 -4
index 25f9093..0ecb579 100644
@@ -59,7 +59,7 @@ __setup("noreplace-paravirt", setup_noreplace_paravirt);
 #define DPRINTK(fmt, args...)						\
 do {									\
 	if (debug_alternative)						\
-		printk(KERN_DEBUG "%s: " fmt "\n", __func__, ##args);	\
+		pr_debug("%s: " fmt "\n", __func__, ##args);	\
 } while (0)
 
 #define DUMP_BYTES(buf, len, fmt, args...)				\
@@ -70,10 +70,10 @@ do {									\
 		if (!(len))						\
 			break;						\
 									\
-		printk(KERN_DEBUG fmt, ##args);				\
+		pr_debug(fmt, ##args);				\
 		for (j = 0; j < (len) - 1; j++)				\
-			printk(KERN_CONT "%02hhx ", buf[j]);		\
-		printk(KERN_CONT "%02hhx\n", buf[j]);			\
+			pr_cont("%02hhx ", buf[j]);		\
+		pr_cont("%02hhx\n", buf[j]);			\
 	}								\
 } while (0)
 
arch/x86/kernel/amd_gart_64.c +6 -7
index 8e3842f..24fb9cf 100644
@@ -536,10 +536,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;
@@ -691,8 +690,8 @@ 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\n"
+		"falling back to iommu=soft.\n");
 	return -1;
 }
 
@@ -757,8 +756,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;
 	}
arch/x86/kernel/apb_timer.c +11 -12
index 222a570..c5b378a 100644
@@ -90,13 +90,13 @@ static inline void apbt_set_mapping(void)
 	}
 	mtmr = sfi_get_mtmr(APBT_CLOCKEVENT0_NUM);
 	if (mtmr == NULL) {
-		printk(KERN_ERR "Failed to get MTMR %d from SFI\n",
+		pr_err("Failed to get MTMR %d from SFI\n",
 		       APBT_CLOCKEVENT0_NUM);
 		return;
 	}
 	apbt_address = (phys_addr_t)mtmr->phys_addr;
 	if (!apbt_address) {
-		printk(KERN_WARNING "No timer base from SFI, use default\n");
+		pr_warn("No timer base from SFI, use default\n");
 		apbt_address = APBT_DEFAULT_BASE;
 	}
 	apbt_virt_address = ioremap_nocache(apbt_address, APBT_MMAP_SIZE);
@@ -142,7 +142,7 @@ static int __init apbt_clockevent_register(void)
 
 	mtmr = sfi_get_mtmr(APBT_CLOCKEVENT0_NUM);
 	if (mtmr == NULL) {
-		printk(KERN_ERR "Failed to get MTMR %d from SFI\n",
+		pr_err("Failed to get MTMR %d from SFI\n",
 		       APBT_CLOCKEVENT0_NUM);
 		return -ENODEV;
 	}
@@ -157,8 +157,8 @@ static int __init apbt_clockevent_register(void)
 
 	if (intel_mid_timer_options == INTEL_MID_TIMER_LAPIC_APBT) {
 		global_clock_event = &adev->timer->ced;
-		printk(KERN_DEBUG "%s clockevent registered as global\n",
-		       global_clock_event->name);
+		pr_debug("%s clockevent registered as global\n",
+			 global_clock_event->name);
 	}
 
 	dw_apb_clockevent_register(adev->timer);
@@ -196,8 +196,8 @@ void apbt_setup_secondary_clock(void)
 		dw_apb_clockevent_resume(adev->timer);
 	}
 
-	printk(KERN_INFO "Registering CPU %d clockevent device %s, cpu %08x\n",
-	       cpu, adev->name, adev->cpu);
+	pr_info("Registering CPU %d clockevent device %s, cpu %08x\n",
+		cpu, adev->name, adev->cpu);
 
 	apbt_setup_irq(adev);
 	dw_apb_clockevent_register(adev->timer);
@@ -327,7 +327,7 @@ void __init apbt_time_init(void)
 #ifdef CONFIG_SMP
 	/* kernel cmdline disable apb timer, so we will use lapic timers */
 	if (intel_mid_timer_options == INTEL_MID_TIMER_LAPIC_APBT) {
-		printk(KERN_INFO "apbt: disabled per cpu timer\n");
+		pr_info("apbt: disabled per cpu timer\n");
 		return;
 	}
 	pr_debug("%s: %d CPUs online\n", __func__, num_online_cpus());
@@ -346,7 +346,7 @@ void __init apbt_time_init(void)
 		if (p_mtmr)
 			adev->irq = p_mtmr->irq;
 		else
-			printk(KERN_ERR "Failed to get timer for cpu %d\n", i);
+			pr_err("Failed to get timer for cpu %d\n", i);
 		snprintf(adev->name, sizeof(adev->name) - 1, "apbt%d", i);
 	}
 #endif
@@ -400,13 +400,12 @@ unsigned long apbt_quick_calibrate(void)
 
 	shift = 5;
 	if (unlikely(loop >> shift == 0)) {
-		printk(KERN_INFO
-		       "APBT TSC calibration failed, not enough resolution\n");
+		pr_info("APBT TSC calibration failed, not enough resolution\n");
 		return 0;
 	}
 	scale = (int)div_u64((t2 - t1), loop >> shift);
 	khz = (scale * (apbt_freq / 1000)) >> shift;
-	printk(KERN_INFO "TSC freq calculated by APB timer is %lu khz\n", khz);
+	pr_info("TSC freq calculated by APB timer is %lu khz\n", khz);
 	return khz;
 failed:
 	return 0;
arch/x86/kernel/apic/apic.c +20 -23

141 lines not on this page · raw message

arch/x86/kernel/apic/apic_flat_64.c +2 -2
index 9968f30..1af714c 100644
@@ -218,12 +218,12 @@ static int physflat_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
 	 */
 	if (acpi_gbl_FADT.header.revision >= FADT2_REVISION_ID &&
 		(acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL)) {
-		printk(KERN_DEBUG "system APIC only can use physical flat");
+		pr_debug("system APIC only can use physical flat");
 		return 1;
 	}
 
 	if (!strncmp(oem_id, "IBM", 3) && !strncmp(oem_table_id, "EXA", 3)) {
-		printk(KERN_DEBUG "IBM Summit detected, will use apic physical");
+		pr_debug("IBM Summit detected, will use apic physical");
 		return 1;
 	}
 #endif
arch/x86/kernel/apic/apic_noop.c +1 -1
index 331a7a0..80380d4 100644
@@ -94,7 +94,7 @@ static void noop_vector_allocation_domain(int cpu, struct cpumask *retmask,
 					  const struct cpumask *mask)
 {
 	if (cpu != 0)
-		pr_warning("APIC: Vector allocated for non-BSP cpu\n");
+		pr_warn("APIC: Vector allocated for non-BSP cpu\n");
 	cpumask_copy(retmask, cpumask_of(cpu));
 }
 
arch/x86/kernel/apic/bigsmp_32.c +2 -3
index cf9bd89..52f0fb5 100644
@@ -67,8 +67,7 @@ static void bigsmp_init_apic_ldr(void)
 
 static void bigsmp_setup_apic_routing(void)
 {
-	printk(KERN_INFO
-		"Enabling APIC mode:  Physflat.  Using %d I/O APICs\n",
+	pr_info("Enabling APIC mode:  Physflat.  Using %d I/O APICs\n",
 		nr_ioapics);
 }
 
@@ -110,7 +109,7 @@ static int dmi_bigsmp; /* can be set by dmi scanners */
 
 static int hp_ht_bigsmp(const struct dmi_system_id *d)
 {
-	printk(KERN_NOTICE "%s detected: force use of apic=bigsmp\n", d->ident);
+	pr_notice("%s detected: force use of apic=bigsmp\n", d->ident);
 	dmi_bigsmp = 1;
 
 	return 0;
arch/x86/kernel/apic/io_apic.c +47 -48

218 lines not on this page · raw message

arch/x86/kernel/apic/probe_32.c +4 -5
index f316e34..fd2a3dc 100644
@@ -60,8 +60,7 @@ static int default_x86_32_early_logical_apicid(int cpu)
 static void setup_apic_flat_routing(void)
 {
 #ifdef CONFIG_X86_IO_APIC
-	printk(KERN_INFO
-		"Enabling APIC mode:  Flat.  Using %d I/O APICs\n",
+	pr_info("Enabling APIC mode:  Flat.  Using %d I/O APICs\n",
 		nr_ioapics);
 #endif
 }
@@ -202,7 +201,7 @@ void __init generic_apic_probe(void)
 		if (drv == __apicdrivers_end)
 			panic("Didn't find an APIC driver");
 	}
-	printk(KERN_INFO "Using APIC driver %s\n", apic->name);
+	pr_info("Using APIC driver %s\n", apic->name);
 }
 
 /* This function can switch the APIC even after the initial ->probe() */
@@ -218,8 +217,8 @@ int __init default_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
 
 		if (!cmdline_apic) {
 			apic = *drv;
-			printk(KERN_INFO "Switched to APIC driver `%s'.\n",
-			       apic->name);
+			pr_info("Switched to APIC driver `%s'.\n",
+				apic->name);
 		}
 		return 1;
 	}
arch/x86/kernel/apic/x2apic_phys.c +1 -1
index a1242e2..e7b2d58 100644
@@ -24,7 +24,7 @@ static bool x2apic_fadt_phys(void)
 #ifdef CONFIG_ACPI
 	if ((acpi_gbl_FADT.header.revision >= FADT2_REVISION_ID) &&
 		(acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL)) {
-		printk(KERN_DEBUG "System requires x2apic physical mode\n");
+		pr_debug("System requires x2apic physical mode\n");
 		return true;
 	}
 #endif
arch/x86/kernel/apic/x2apic_uv_x.c +1 -2
index 624db005..81a856d 100644
@@ -725,8 +725,7 @@ static __init void uv_rtc_init(void)
 	status = uv_bios_freq_base(BIOS_FREQ_BASE_REALTIME_CLOCK,
 					&ticks_per_sec);
 	if (status != BIOS_STATUS_SUCCESS || ticks_per_sec < 100000) {
-		printk(KERN_WARNING
-			"unable to determine platform RTC clock frequency, "
+		pr_warn("unable to determine platform RTC clock frequency, "
 			"guessing.\n");
 		/* BIOS gives wrong value for clock freq. so guess */
 		sn_rtc_cycles_per_second = 1000000000000UL / 30000UL;
arch/x86/kernel/apm_32.c +36 -44

197 lines not on this page · raw message

arch/x86/kernel/bootflag.c +2 -2
index 52c8e3c..e16e24e 100644
@@ -41,7 +41,7 @@ static void __init sbf_write(u8 v)
 		if (!parity(v))
 			v |= SBF_PARITY;
 
-		printk(KERN_INFO "Simple Boot Flag at 0x%x set to 0x%x\n",
+		pr_info("Simple Boot Flag at 0x%x set to 0x%x\n",
 			sbf_port, v);
 
 		spin_lock_irqsave(&rtc_lock, flags);
@@ -84,7 +84,7 @@ static int __init sbf_init(void)
 
 	v = sbf_read();
 	if (!sbf_value_valid(v)) {
-		printk(KERN_WARNING "Simple Boot Flag value 0x%x read from "
+		pr_warn("Simple Boot Flag value 0x%x read from "
 			"CMOS RAM was invalid\n", v);
 	}
 
arch/x86/kernel/check.c +6 -5
index 145863d..3a54dad 100644
@@ -112,7 +112,8 @@ void __init setup_bios_corruption_check(void)
 	}
 
 	if (num_scan_areas)
-		printk(KERN_INFO "Scanning %d areas for low memory corruption\n", num_scan_areas);
+		pr_info("Scanning %d areas for low memory corruption\n",
+			num_scan_areas);
 }
 
 
@@ -131,8 +132,8 @@ void check_for_bios_corruption(void)
 		for (; size; addr++, size -= sizeof(unsigned long)) {
 			if (!*addr)
 				continue;
-			printk(KERN_ERR "Corrupted low memory at %p (%lx phys) = %08lx\n",
-			       addr, __pa(addr), *addr);
+			pr_err("Corrupted low memory at %p (%lx phys) = %08lx\n",
+				addr, __pa(addr), *addr);
 			corruption = 1;
 			*addr = 0;
 		}
@@ -156,8 +157,8 @@ static int start_periodic_check_for_corruption(void)
 	if (!num_scan_areas || !memory_corruption_check || corruption_check_period == 0)
 		return 0;
 
-	printk(KERN_INFO "Scanning for low memory corruption every %d seconds\n",
-	       corruption_check_period);
+	pr_info("Scanning for low memory corruption every %d seconds\n",
+		corruption_check_period);
 
 	/* First time we run the checks right away */
 	schedule_delayed_work(&bios_check_work, 0);
arch/x86/kernel/cpuid.c +1 -1
index 2836de3..5d0abd0 100644
@@ -165,7 +165,7 @@ static int __init cpuid_init(void)
 
 	if (__register_chrdev(CPUID_MAJOR, 0, NR_CPUS,
 			      "cpu/cpuid", &cpuid_fops)) {
-		printk(KERN_ERR "cpuid: unable to get major %d for cpuid\n",
+		pr_err("cpuid: unable to get major %d for cpuid\n",
 		       CPUID_MAJOR);
 		err = -EBUSY;
 		goto out;
arch/x86/kernel/crash_dump_32.c +2 -4
index 11891ca..0deb4c7 100644
@@ -65,8 +65,7 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
 		kunmap_atomic(vaddr);
 	} else {
 		if (!kdump_buf_page) {
-			printk(KERN_WARNING "Kdump: Kdump buffer page not"
-				" allocated\n");
+			pr_warn("Kdump: Kdump buffer page not allocated\n");
 			kunmap_atomic(vaddr);
 			return -EFAULT;
 		}
@@ -85,8 +84,7 @@ static int __init kdump_buf_page_init(void)
 
 	kdump_buf_page = kmalloc(PAGE_SIZE, GFP_KERNEL);
 	if (!kdump_buf_page) {
-		printk(KERN_WARNING "Kdump: Failed to allocate kdump buffer"
-			 " page\n");
+		pr_warn("Kdump: Failed to allocate kdump buffer page\n");
 		ret = -ENOMEM;
 	}
 
arch/x86/kernel/devicetree.c +3 -3
index 1f4acd6..8468af7 100644
@@ -235,8 +235,8 @@ static void __init dtb_add_ioapic(struct device_node *dn)
 
 	ret = of_address_to_resource(dn, 0, &r);
 	if (ret) {
-		printk(KERN_ERR "Can't obtain address from node %s.\n",
-				dn->full_name);
+		pr_err("Can't obtain address from node %s.\n",
+			dn->full_name);
 		return;
 	}
 	mp_register_ioapic(++ioapic_id, r.start, gsi_top, &cfg);
@@ -253,7 +253,7 @@ static void __init dtb_ioapic_setup(void)
 		of_ioapic = 1;
 		return;
 	}
-	printk(KERN_ERR "Error: No information about IO-APIC in OF.\n");
+	pr_err("Error: No information about IO-APIC in OF.\n");
 }
 #else
 static void __init dtb_ioapic_setup(void) {}
arch/x86/kernel/doublefault.c +9 -8
index f6dfd93..1e94e18 100644
@@ -24,23 +24,24 @@ static void doublefault_fn(void)
 	native_store_gdt(&gdt_desc);
 	gdt = gdt_desc.address;
 
-	printk(KERN_EMERG "PANIC: double fault, gdt at %08lx [%d bytes]\n", gdt, gdt_desc.size);
+	pr_emerg("PANIC: double fault, gdt at %08lx [%d bytes]\n",
+		 gdt, gdt_desc.size);
 
 	if (ptr_ok(gdt)) {
 		gdt += GDT_ENTRY_TSS << 3;
 		tss = get_desc_base((struct desc_struct *)gdt);
-		printk(KERN_EMERG "double fault, tss at %08lx\n", tss);
+		pr_emerg("double fault, tss at %08lx\n", tss);
 
 		if (ptr_ok(tss)) {
 			struct x86_hw_tss *t = (struct x86_hw_tss *)tss;
 
-			printk(KERN_EMERG "eip = %08lx, esp = %08lx\n",
-			       t->ip, t->sp);
+			pr_emerg("eip = %08lx, esp = %08lx\n",
+				 t->ip, t->sp);
 
-			printk(KERN_EMERG "eax = %08lx, ebx = %08lx, ecx = %08lx, edx = %08lx\n",
-				t->ax, t->bx, t->cx, t->dx);
-			printk(KERN_EMERG "esi = %08lx, edi = %08lx\n",
-				t->si, t->di);
+			pr_emerg("eax = %08lx, ebx = %08lx, ecx = %08lx, edx = %08lx\n",
+				 t->ax, t->bx, t->cx, t->dx);
+			pr_emerg("esi = %08lx, edi = %08lx\n",
+				 t->si, t->di);
 		}
 	}
 
arch/x86/kernel/dumpstack.c +2 -2
index 32e5699..993706a 100644
@@ -285,12 +285,12 @@ int __die(const char *str, struct pt_regs *regs, long err)
 		sp = kernel_stack_pointer(regs);
 		savesegment(ss, ss);
 	}
-	printk(KERN_EMERG "EIP: [<%08lx>] ", regs->ip);
+	pr_emerg("EIP: [<%08lx>] ", regs->ip);
 	print_symbol("%s", regs->ip);
 	printk(" SS:ESP %04x:%08lx\n", ss, sp);
 #else
 	/* Executive summary in case the oops scrolled away */
-	printk(KERN_ALERT "RIP ");
+	pr_alert("RIP ");
 	printk_address(regs->ip);
 	printk(" RSP <%016lx>\n", regs->sp);
 #endif
arch/x86/kernel/e820.c +32 -34

177 lines not on this page · raw message

arch/x86/kernel/early-quirks.c +14 -24
index bca14c8..e843f15 100644
@@ -33,13 +33,10 @@ static void __init fix_hypertransport_config(int num, int slot, int func)
 	 */
 	htcfg = read_pci_config(num, slot, func, 0x68);
 	if (htcfg & (1 << 18)) {
-		printk(KERN_INFO "Detected use of extended apic ids "
-				 "on hypertransport bus\n");
+		pr_info("Detected use of extended apic ids on hypertransport bus\n");
 		if ((htcfg & (1 << 17)) == 0) {
-			printk(KERN_INFO "Enabling hypertransport extended "
-					 "apic interrupt broadcast\n");
-			printk(KERN_INFO "Note this is a bios bug, "
-					 "please contact your hw vendor\n");
+			pr_info("Enabling hypertransport extended apic interrupt broadcast\n");
+			pr_info("Note this is a bios bug, please contact your hw vendor\n");
 			htcfg |= (1 << 17);
 			write_pci_config(num, slot, func, 0x68, htcfg);
 		}
@@ -53,9 +50,7 @@ static void __init via_bugs(int  num, int slot, int func)
 #ifdef CONFIG_GART_IOMMU
 	if ((max_pfn > MAX_DMA32_PFN ||  force_iommu) &&
 	    !gart_iommu_aperture_allowed) {
-		printk(KERN_INFO
-		       "Looks like a VIA chipset. Disabling IOMMU."
-		       " Override with iommu=allowed\n");
+		pr_info("Looks like a VIA chipset. Disabling IOMMU. Override with iommu=allowed\n");
 		gart_iommu_aperture_disabled = 1;
 	}
 #endif
@@ -87,11 +82,8 @@ static void __init nvidia_bugs(int num, int slot, int func)
 
 	if (acpi_table_parse(ACPI_SIG_HPET, nvidia_hpet_check)) {
 		acpi_skip_timer_override = 1;
-		printk(KERN_INFO "Nvidia board "
-		       "detected. Ignoring ACPI "
-		       "timer override.\n");
-		printk(KERN_INFO "If you got timer trouble "
-			"try acpi_use_timer_override\n");
+		pr_info("Nvidia board detected. Ignoring ACPI timer override.\n");
+		pr_info("If you got timer trouble try acpi_use_timer_override\n");
 	}
 #endif
 #endif
@@ -137,10 +129,9 @@ static void __init ati_bugs(int num, int slot, int func)
 	}
 
 	if (acpi_skip_timer_override) {
-		printk(KERN_INFO "SB4X0 revision 0x%x\n", d);
-		printk(KERN_INFO "Ignoring ACPI timer override.\n");
-		printk(KERN_INFO "If you got timer trouble "
-		       "try acpi_use_timer_override\n");
+		pr_info("SB4X0 revision 0x%x\n", d);
+		pr_info("Ignoring ACPI timer override.\n");
+		pr_info("If you got timer trouble try acpi_use_timer_override\n");
 	}
 }
 
@@ -179,10 +170,9 @@ static void __init ati_bugs_contd(int num, int slot, int func)
 		acpi_skip_timer_override = 1;
 
 	if (acpi_skip_timer_override) {
-		printk(KERN_INFO "SB600 revision 0x%x\n", rev);
-		printk(KERN_INFO "Ignoring ACPI timer override.\n");
-		printk(KERN_INFO "If you got timer trouble "
-		       "try acpi_use_timer_override\n");
+		pr_info("SB600 revision 0x%x\n", rev);
+		pr_info("Ignoring ACPI timer override.\n");
+		pr_info("If you got timer trouble try acpi_use_timer_override\n");
 	}
 }
 #else
@@ -569,8 +559,8 @@ static void __init intel_graphics_stolen(int num, int slot, int func)
 			size = stolen_funcs->size(num, slot, func);
 			start = stolen_funcs->base(num, slot, func, size);
 			if (size && start) {
-				printk(KERN_INFO "Reserving Intel graphics stolen memory at 0x%x-0x%x\n",
-				       start, start + (u32)size - 1);
+				pr_info("Reserving Intel graphics stolen memory at 0x%x-0x%x\n",
+					start, start + (u32)size - 1);
 				/* Mark this space as reserved */
 				e820_add_region(start, size, E820_RESERVED);
 				sanitize_e820_map(e820.map,
arch/x86/kernel/early_printk.c +2 -2
index 21bf924..be6dcb0 100644
@@ -319,8 +319,8 @@ static struct console early_serial_console = {
 static void early_console_register(struct console *con, int keep_early)
 {
 	if (con->index != -1) {
-		printk(KERN_CRIT "ERROR: earlyprintk= %s already used\n",
-		       con->name);
+		pr_crit("ERROR: earlyprintk= %s already used\n",
+			con->name);
 		return;
 	}
 	early_console = con;
arch/x86/kernel/fpu/init.c +2 -1
index 6d9f0a7..66d1b87 100644
@@ -339,7 +339,8 @@ static void __init fpu__init_system_ctx_switch(void)
 	if (eagerfpu == ENABLE)
 		setup_force_cpu_cap(X86_FEATURE_EAGER_FPU);
 
-	printk(KERN_INFO "x86/fpu: Using '%s' FPU context switches.\n", eagerfpu == ENABLE ? "eager" : "lazy");
+	pr_info("x86/fpu: Using '%s' FPU context switches.\n",
+		eagerfpu == ENABLE ? "eager" : "lazy");
 }
 
 /*
arch/x86/kernel/fpu/xstate.c +2 -1
index d425cda5..4fb56f9 100644
@@ -222,7 +222,8 @@ static void __init setup_xstate_features(void)
 			"x86/fpu: misordered xstate at %d\n", last_good_offset);
 		last_good_offset = xstate_offsets[i];
 
-		printk(KERN_INFO "x86/fpu: xstate_offset[%d]: %4d, xstate_sizes[%d]: %4d\n", i, ebx, i, eax);
+		pr_info("x86/fpu: xstate_offset[%d]: %4d, xstate_sizes[%d]: %4d\n",
+			i, ebx, i, eax);
 	}
 }
 
arch/x86/kernel/hpet.c +15 -18
index be0ebbb..c70b365 100644
@@ -139,30 +139,30 @@ EXPORT_SYMBOL_GPL(is_hpet_enabled);
 static void _hpet_print_config(const char *function, int line)
 {
 	u32 i, timers, l, h;
-	printk(KERN_INFO "hpet: %s(%d):\n", function, line);
+	pr_info("hpet: %s(%d):\n", function, line);
 	l = hpet_readl(HPET_ID);
 	h = hpet_readl(HPET_PERIOD);
 	timers = ((l & HPET_ID_NUMBER) >> HPET_ID_NUMBER_SHIFT) + 1;
-	printk(KERN_INFO "hpet: ID: 0x%x, PERIOD: 0x%x\n", l, h);
+	pr_info("hpet: ID: 0x%x, PERIOD: 0x%x\n", l, h);
 	l = hpet_readl(HPET_CFG);
 	h = hpet_readl(HPET_STATUS);
-	printk(KERN_INFO "hpet: CFG: 0x%x, STATUS: 0x%x\n", l, h);
+	pr_info("hpet: CFG: 0x%x, STATUS: 0x%x\n", l, h);
 	l = hpet_readl(HPET_COUNTER);
 	h = hpet_readl(HPET_COUNTER+4);
-	printk(KERN_INFO "hpet: COUNTER_l: 0x%x, COUNTER_h: 0x%x\n", l, h);
+	pr_info("hpet: COUNTER_l: 0x%x, COUNTER_h: 0x%x\n", l, h);
 
 	for (i = 0; i < timers; i++) {
 		l = hpet_readl(HPET_Tn_CFG(i));
 		h = hpet_readl(HPET_Tn_CFG(i)+4);
-		printk(KERN_INFO "hpet: T%d: CFG_l: 0x%x, CFG_h: 0x%x\n",
+		pr_info("hpet: T%d: CFG_l: 0x%x, CFG_h: 0x%x\n",
 		       i, l, h);
 		l = hpet_readl(HPET_Tn_CMP(i));
 		h = hpet_readl(HPET_Tn_CMP(i)+4);
-		printk(KERN_INFO "hpet: T%d: CMP_l: 0x%x, CMP_h: 0x%x\n",
+		pr_info("hpet: T%d: CMP_l: 0x%x, CMP_h: 0x%x\n",
 		       i, l, h);
 		l = hpet_readl(HPET_Tn_ROUTE(i));
 		h = hpet_readl(HPET_Tn_ROUTE(i)+4);
-		printk(KERN_INFO "hpet: T%d ROUTE_l: 0x%x, ROUTE_h: 0x%x\n",
+		pr_info("hpet: T%d ROUTE_l: 0x%x, ROUTE_h: 0x%x\n",
 		       i, l, h);
 	}
 }
@@ -289,7 +289,7 @@ static void hpet_legacy_clockevent_register(void)
 	clockevents_config_and_register(&hpet_clockevent, hpet_freq,
 					HPET_MIN_PROG_DELTA, 0x7FFFFFFF);
 	global_clock_event = &hpet_clockevent;
-	printk(KERN_DEBUG "hpet clockevent registered\n");
+	pr_debug("hpet clockevent registered\n");
 }
 
 static int hpet_set_periodic(struct clock_event_device *evt, int timer)
@@ -526,8 +526,8 @@ static irqreturn_t hpet_interrupt_handler(int irq, void *data)
 	struct clock_event_device *hevt = &dev->evt;
 
 	if (!hevt->event_handler) {
-		printk(KERN_INFO "Spurious HPET timer interrupt on HPET timer %d\n",
-				dev->num);
+		pr_info("Spurious HPET timer interrupt on HPET timer %d\n",
+			dev->num);
 		return IRQ_HANDLED;
 	}
 
@@ -547,7 +547,7 @@ static int hpet_setup_irq(struct hpet_dev *dev)
 	irq_set_affinity(dev->irq, cpumask_of(dev->cpu));
 	enable_irq(dev->irq);
 
-	printk(KERN_DEBUG "hpet: %s irq %d for MSI\n",
+	pr_debug("hpet: %s irq %d for MSI\n",
 			 dev->name, dev->irq);
 
 	return 0;
@@ -646,7 +646,7 @@ static void hpet_msi_capability_lookup(unsigned int start_timer)
 			break;
 	}
 
-	printk(KERN_INFO "HPET: %d timers in total, %d timers will be used for per-cpu timer\n",
+	pr_info("HPET: %d timers in total, %d timers will be used for per-cpu timer\n",
 		num_timers, num_timers_used);
 }
 
@@ -800,8 +800,7 @@ static int hpet_clocksource_register(void)
 	} while ((now - start) < 200000UL);
 
 	if (t1 == hpet_readl(HPET_COUNTER)) {
-		printk(KERN_WARNING
-		       "HPET counter not counting. HPET disabled\n");
+		pr_warn("HPET counter not counting. HPET disabled\n");
 		return -ENODEV;
 	}
 
@@ -845,9 +844,7 @@ int __init hpet_enable(void)
 	 */
 	for (i = 0; hpet_readl(HPET_CFG) == 0xFFFFFFFF; i++) {
 		if (i == 1000) {
-			printk(KERN_WARNING
-			       "HPET config register value = 0xFFFFFFFF. "
-			       "Disabling HPET\n");
+			pr_warn("HPET config register value = 0xFFFFFFFF. Disabling HPET\n");
 			goto out_nohpet;
 		}
 	}
@@ -1231,7 +1228,7 @@ static void hpet_rtc_timer_reinit(void)
 		if (hpet_rtc_flags & RTC_PIE)
 			hpet_pie_count += lost_ints;
 		if (printk_ratelimit())
-			printk(KERN_WARNING "hpet1: lost %d rtc interrupts\n",
+			pr_warn("hpet1: lost %d rtc interrupts\n",
 				lost_ints);
 	}
 }
arch/x86/kernel/i8259.c +2 -3
index be22f5a..c069219 100644
@@ -204,8 +204,7 @@ spurious_8259A_irq:
 		 * lets ACK and report it. [once per IRQ]
 		 */
 		if (!(spurious_irq_mask & irqmask)) {
-			printk(KERN_DEBUG
-			       "spurious 8259A interrupt: IRQ%d.\n", irq);
+			pr_debug("spurious 8259A interrupt: IRQ%d.\n", irq);
 			spurious_irq_mask |= irqmask;
 		}
 		atomic_inc(&irq_err_count);
@@ -313,7 +312,7 @@ static int probe_8259A(void)
 	outb(probe_val, PIC_MASTER_IMR);
 	new_val = inb(PIC_MASTER_IMR);
 	if (new_val != probe_val) {
-		printk(KERN_INFO "Using NULL legacy PIC\n");
+		pr_info("Using NULL legacy PIC\n");
 		legacy_pic = &null_legacy_pic;
 	}
 
arch/x86/kernel/irq_32.c +3 -3
index 38da8f2..3b3b230 100644
@@ -38,7 +38,7 @@ static int check_stack_overflow(void)
 
 static void print_stack_overflow(void)
 {
-	printk(KERN_WARNING "low stack detected by irq handler\n");
+	pr_warn("low stack detected by irq handler\n");
 	dump_stack();
 	if (sysctl_panic_on_stackoverflow)
 		panic("low stack detected by irq handler - check messages\n");
@@ -124,8 +124,8 @@ void irq_ctx_init(int cpu)
 					       THREAD_SIZE_ORDER));
 	per_cpu(softirq_stack, cpu) = irqstk;
 
-	printk(KERN_DEBUG "CPU %u irqstacks, hard=%p soft=%p\n",
-	       cpu, per_cpu(hardirq_stack, cpu),  per_cpu(softirq_stack, cpu));
+	pr_debug("CPU %u irqstacks, hard=%p soft=%p\n",
+		 cpu, per_cpu(hardirq_stack, cpu), per_cpu(softirq_stack, cpu));
 }
 
 void do_softirq_own_stack(void)
arch/x86/kernel/jump_label.c +2 -2
index e565e0e..c4c705b 100644
@@ -31,8 +31,8 @@ static void bug_at(unsigned char *ip, int line)
 	 * Something went wrong. Crash the box, as something could be
 	 * corrupting the kernel.
 	 */
-	pr_warning("Unexpected op at %pS [%p] (%02x %02x %02x %02x %02x) %s:%d\n",
-	       ip, ip, ip[0], ip[1], ip[2], ip[3], ip[4], __FILE__, line);
+	pr_warn("Unexpected op at %pS [%p] (%02x %02x %02x %02x %02x) %s:%d\n",
+		ip, ip, ip[0], ip[1], ip[2], ip[3], ip[4], __FILE__, line);
 	BUG();
 }
 
arch/x86/kernel/kgdb.c +4 -4
index 44256a6..d13f181 100644
@@ -300,7 +300,7 @@ kgdb_remove_hw_break(unsigned long addr, int len, enum kgdb_bptype bptype)
 		return -1;
 
 	if (hw_break_release_slot(i)) {
-		printk(KERN_ERR "Cannot remove hw breakpoint at %lx\n", addr);
+		pr_err("Cannot remove hw breakpoint at %lx\n", addr);
 		return -1;
 	}
 	breakinfo[i].enabled = 0;
@@ -327,7 +327,7 @@ static void kgdb_remove_all_hw_break(void)
 			early_dr7 &= ~encode_dr7(i, breakinfo[i].len,
 						 breakinfo[i].type);
 		else if (hw_break_release_slot(i))
-			printk(KERN_ERR "KGDB: hw bpt remove failed %lx\n",
+			pr_err("KGDB: hw bpt remove failed %lx\n",
 			       breakinfo[i].addr);
 		breakinfo[i].enabled = 0;
 	}
@@ -498,7 +498,7 @@ single_step_cont(struct pt_regs *regs, struct die_args *args)
 	 * Single step exception from kernel space to user space so
 	 * eat the exception and continue the process:
 	 */
-	printk(KERN_ERR "KGDB: trap/step from kernel to user space, "
+	pr_err("KGDB: trap/step from kernel to user space, "
 			"resuming...\n");
 	kgdb_arch_handle_exception(args->trapnr, args->signr,
 				   args->err, "c", "", regs);
@@ -675,7 +675,7 @@ void kgdb_arch_late(void)
 			continue;
 		breakinfo[i].pev = register_wide_hw_breakpoint(&attr, NULL, NULL);
 		if (IS_ERR((void * __force)breakinfo[i].pev)) {
-			printk(KERN_ERR "kgdb: Could not allocate hw"
+			pr_err("kgdb: Could not allocate hw"
 			       "breakpoints\nDisabling the kernel debugger\n");
 			breakinfo[i].pev = NULL;
 			kgdb_arch_exit();
arch/x86/kernel/kprobes/core.c +5 -6
index 1deffe6..7d738d6 100644
@@ -581,8 +581,8 @@ static int reenter_kprobe(struct kprobe *p, struct pt_regs *regs,
 		 * Raise a BUG or we'll continue in an endless reentering loop
 		 * and eventually a stack overflow.
 		 */
-		printk(KERN_WARNING "Unrecoverable kprobe detected at %p.\n",
-		       p->addr);
+		pr_warn("Unrecoverable kprobe detected at %p.\n",
+			p->addr);
 		dump_kprobe(p);
 		BUG();
 	default:
@@ -1092,12 +1092,11 @@ int longjmp_break_handler(struct kprobe *p, struct pt_regs *regs)
 	    (addr < (u8 *) jprobe_return_end)) {
 		if (stack_addr(regs) != saved_sp) {
 			struct pt_regs *saved_regs = &kcb->jprobe_saved_regs;
-			printk(KERN_ERR
-			       "current sp %p does not match saved sp %p\n",
+			pr_err("current sp %p does not match saved sp %p\n",
 			       stack_addr(regs), saved_sp);
-			printk(KERN_ERR "Saved registers for jprobe %p\n", jp);
+			pr_err("Saved registers for jprobe %p\n", jp);
 			show_regs(saved_regs);
-			printk(KERN_ERR "Current registers\n");
+			pr_err("Current registers\n");
 			show_regs(regs);
 			BUG();
 		}
arch/x86/kernel/kvm.c +6 -6
index 47190bd..1cc3176 100644
@@ -344,8 +344,8 @@ static void kvm_guest_cpu_init(void)
 #endif
 		wrmsrl(MSR_KVM_ASYNC_PF_EN, pa | KVM_ASYNC_PF_ENABLED);
 		__this_cpu_write(apf_reason.enabled, 1);
-		printk(KERN_INFO"KVM setup async PF for cpu %d\n",
-		       smp_processor_id());
+		pr_info("KVM setup async PF for cpu %d\n",
+			smp_processor_id());
 	}
 
 	if (kvm_para_has_feature(KVM_FEATURE_PV_EOI)) {
@@ -370,8 +370,8 @@ static void kvm_pv_disable_apf(void)
 	wrmsrl(MSR_KVM_ASYNC_PF_EN, 0);
 	__this_cpu_write(apf_reason.enabled, 0);
 
-	printk(KERN_INFO"Unregister pv shared memory for cpu %d\n",
-	       smp_processor_id());
+	pr_info("Unregister pv shared memory for cpu %d\n",
+		smp_processor_id());
 }
 
 static void kvm_pv_guest_cpu_reboot(void *unused)
@@ -692,7 +692,7 @@ static struct dentry *kvm_init_debugfs(void)
 {
 	d_kvm_debug = debugfs_create_dir("kvm-guest", NULL);
 	if (!d_kvm_debug)
-		printk(KERN_WARNING "Could not create 'kvm' debugfs directory\n");
+		pr_warn("Could not create 'kvm' debugfs directory\n");
 
 	return d_kvm_debug;
 }
@@ -883,7 +883,7 @@ static __init int kvm_spinlock_init_jump(void)
 		return 0;
 
 	static_key_slow_inc(&paravirt_ticketlocks_enabled);
-	printk(KERN_INFO "KVM setup paravirtual spinlock\n");
+	pr_info("KVM setup paravirtual spinlock\n");
 
 	return 0;
 }
arch/x86/kernel/kvmclock.c +5 -5
index 72cef58..553f9bd 100644
@@ -114,8 +114,8 @@ static inline void kvm_sched_clock_init(bool stable)
 	pv_time_ops.sched_clock = kvm_sched_clock_read;
 	set_sched_clock_stable();
 
-	printk(KERN_INFO "kvm-clock: using sched offset of %llu cycles\n",
-			kvm_sched_clock_offset);
+	pr_info("kvm-clock: using sched offset of %llu cycles\n",
+		kvm_sched_clock_offset);
 
 	BUILD_BUG_ON(sizeof(kvm_sched_clock_offset) >
 	         sizeof(((struct pvclock_vcpu_time_info *)NULL)->system_time));
@@ -195,8 +195,8 @@ int kvm_register_clock(char *txt)
 	low = (int)slow_virt_to_phys(src) | 1;
 	high = ((u64)slow_virt_to_phys(src) >> 32);
 	ret = native_write_msr_safe(msr_kvm_system_time, low, high);
-	printk(KERN_INFO "kvm-clock: cpu %d, msr %x:%x, %s\n",
-	       cpu, high, low, txt);
+	pr_info("kvm-clock: cpu %d, msr %x:%x, %s\n",
+		cpu, high, low, txt);
 
 	return ret;
 }
@@ -263,7 +263,7 @@ void __init kvmclock_init(void)
 	} else if (!(kvmclock && kvm_para_has_feature(KVM_FEATURE_CLOCKSOURCE)))
 		return;
 
-	printk(KERN_INFO "kvm-clock: Using msrs %x and %x",
+	pr_info("kvm-clock: Using msrs %x and %x",
 		msr_kvm_system_time, msr_kvm_wall_clock);
 
 	mem = memblock_alloc(size, PAGE_SIZE);
arch/x86/kernel/mmconf-fam10h_64.c +1 -1
index f4c886d..1e49af9 100644
@@ -205,7 +205,7 @@ void fam10h_check_enable_mmcfg(void)
 		return;
 	}
 
-	printk(KERN_INFO "Enable MMCONFIG on AMD Family 10h\n");
+	pr_info("Enable MMCONFIG on AMD Family 10h\n");
 	val &= ~((FAM10H_MMIO_CONF_BASE_MASK<<FAM10H_MMIO_CONF_BASE_SHIFT) |
 	     (FAM10H_MMIO_CONF_BUSRANGE_MASK<<FAM10H_MMIO_CONF_BUSRANGE_SHIFT));
 	val |= fam10h_pci_mmconf_base | (8 << FAM10H_MMIO_CONF_BUSRANGE_SHIFT) |
arch/x86/kernel/module.c +2 -2
index 005c03e..3edc48d 100644
@@ -37,12 +37,12 @@
 
 #if 0
 #define DEBUGP(fmt, ...)				\
-	printk(KERN_DEBUG fmt, ##__VA_ARGS__)
+	pr_debug(fmt, ##__VA_ARGS__)
 #else
 #define DEBUGP(fmt, ...)				\
 do {							\
 	if (0)						\
-		printk(KERN_DEBUG fmt, ##__VA_ARGS__);	\
+		pr_debug(fmt, ##__VA_ARGS__);	\
 } while (0)
 #endif
 
arch/x86/kernel/nmi_selftest.c +6 -6
index 6d9582e..14a678d 100644
@@ -119,15 +119,15 @@ static void __init dotest(void (*testcase_fn)(void), int expected)
 		unexpected_testcase_failures++;
 
 		if (nmi_fail == FAILURE)
-			printk(KERN_CONT "FAILED |");
+			pr_cont("FAILED |");
 		else if (nmi_fail == TIMEOUT)
-			printk(KERN_CONT "TIMEOUT|");
+			pr_cont("TIMEOUT|");
 		else
-			printk(KERN_CONT "ERROR  |");
+			pr_cont("ERROR  |");
 		dump_stack();
 	} else {
 		testcase_successes++;
-		printk(KERN_CONT "  ok  |");
+		pr_cont("  ok  |");
 	}
 	testcase_total++;
 
@@ -152,10 +152,10 @@ void __init nmi_selftest(void)
 
 	print_testname("remote IPI");
 	dotest(remote_ipi, SUCCESS);
-	printk(KERN_CONT "\n");
+	pr_cont("\n");
 	print_testname("local IPI");
 	dotest(local_ipi, SUCCESS);
-	printk(KERN_CONT "\n");
+	pr_cont("\n");
 
 	cleanup_nmi_testsuite();
 
arch/x86/kernel/paravirt.c +1 -1
index f08ac28..938fff9 100644
@@ -67,7 +67,7 @@ u64 _paravirt_ident_64(u64 x)
 
 void __init default_banner(void)
 {
-	printk(KERN_INFO "Booting paravirtualized kernel on %s\n",
+	pr_info("Booting paravirtualized kernel on %s\n",
 	       pv_info.name);
 }
 
arch/x86/kernel/pci-calgary_64.c +41 -46

214 lines not on this page · raw message

arch/x86/kernel/pci-iommu_table.c +2 -2
index 35ccf75..79149db 100644
@@ -56,7 +56,7 @@ void __init check_iommu_entries(struct iommu_table_entry *start,
 		q = find_dependents_of(start, finish, p);
 		x = find_dependents_of(start, finish, q);
 		if (p == x) {
-			printk(KERN_ERR "CYCLIC DEPENDENCY FOUND! %pS depends on %pS and vice-versa. BREAKING IT.\n",
+			pr_err("CYCLIC DEPENDENCY FOUND! %pS depends on %pS and vice-versa. BREAKING IT.\n",
 			       p->detect, q->detect);
 			/* Heavy handed way..*/
 			x->depend = 0;
@@ -66,7 +66,7 @@ void __init check_iommu_entries(struct iommu_table_entry *start,
 	for (p = start; p < finish; p++) {
 		q = find_dependents_of(p, finish, p);
 		if (q && q > p) {
-			printk(KERN_ERR "EXECUTION ORDER INVALID! %pS should be called before %pS!\n",
+			pr_err("EXECUTION ORDER INVALID! %pS should be called before %pS!\n",
 			       p->detect, q->detect);
 		}
 	}
arch/x86/kernel/pci-nommu.c +1 -2
index da15918..4c365495 100644
@@ -16,8 +16,7 @@ check_addr(char *name, struct device *hwdev, dma_addr_t bus, size_t size)
 {
 	if (hwdev && !dma_capable(hwdev, bus, size)) {
 		if (*hwdev->dma_mask >= DMA_BIT_MASK(32))
-			printk(KERN_ERR
-			    "nommu_%s: overflow %Lx+%zu of device mask %Lx\n",
+			pr_err("nommu_%s: overflow %Lx+%zu of device mask %Lx\n",
 				name, (long long)bus, size,
 				(long long)*hwdev->dma_mask);
 		return 0;
arch/x86/kernel/pci-swiotlb.c +1 -2
index 7c577a1..2cad97b 100644
@@ -112,8 +112,7 @@ void __init pci_swiotlb_late_init(void)
 	if (!swiotlb)
 		swiotlb_free();
 	else {
-		printk(KERN_INFO "PCI-DMA: "
-		       "Using software bounce buffering for IO (SWIOTLB)\n");
+		pr_info("PCI-DMA: Using software bounce buffering for IO (SWIOTLB)\n");
 		swiotlb_print_info();
 	}
 }
arch/x86/kernel/quirks.c +23 -25

169 lines not on this page · raw message

arch/x86/kernel/rtc.c +3 -4
index 4af8d06..0ff3fbc 100644
@@ -48,11 +48,10 @@ int mach_set_rtc_mmss(const struct timespec *now)
 	if (!rtc_valid_tm(&tm)) {
 		retval = set_rtc_time(&tm);
 		if (retval)
-			printk(KERN_ERR "%s: RTC write failed with error %d\n",
-			       __func__, retval);
+			pr_err("%s: RTC write failed with error %d\n",
+				__func__, retval);
 	} else {
-		printk(KERN_ERR
-		       "%s: Invalid RTC value: write of %lx to RTC failed\n",
+		pr_err("%s: Invalid RTC value: write of %lx to RTC failed\n",
 			__func__, nowtime);
 		retval = -EINVAL;
 	}
arch/x86/kernel/setup.c +11 -11
index aa52c10..c0d783d 100644
@@ -338,12 +338,12 @@ static void __init relocate_initrd(void)
 	memblock_reserve(relocated_ramdisk, area_size);
 	initrd_start = relocated_ramdisk + PAGE_OFFSET;
 	initrd_end   = initrd_start + ramdisk_size;
-	printk(KERN_INFO "Allocated new RAMDISK: [mem %#010llx-%#010llx]\n",
+	pr_info("Allocated new RAMDISK: [mem %#010llx-%#010llx]\n",
 	       relocated_ramdisk, relocated_ramdisk + ramdisk_size - 1);
 
 	copy_from_early_mem((void *)initrd_start, ramdisk_image, ramdisk_size);
 
-	printk(KERN_INFO "Move RAMDISK from [mem %#010llx-%#010llx] to"
+	pr_info("Move RAMDISK from [mem %#010llx-%#010llx] to"
 		" [mem %#010llx-%#010llx]\n",
 		ramdisk_image, ramdisk_image + ramdisk_size - 1,
 		relocated_ramdisk, relocated_ramdisk + ramdisk_size - 1);
@@ -382,7 +382,7 @@ static void __init reserve_initrd(void)
 		       "disabling initrd (%lld needed, %lld available)\n",
 		       ramdisk_size, mapped_size>>1);
 
-	printk(KERN_INFO "RAMDISK: [mem %#010llx-%#010llx]\n", ramdisk_image,
+	pr_info("RAMDISK: [mem %#010llx-%#010llx]\n", ramdisk_image,
 			ramdisk_end - 1);
 
 	if (pfn_range_is_mapped(PFN_DOWN(ramdisk_image),
@@ -457,7 +457,7 @@ static void __init e820_reserve_setup_data(void)
 
 	sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map);
 	memcpy(&e820_saved, &e820, sizeof(struct e820map));
-	printk(KERN_INFO "extended physical RAM map:\n");
+	pr_info("extended physical RAM map:\n");
 	e820_print_map("reserve setup_data");
 }
 
@@ -713,7 +713,7 @@ static void __init trim_snb_memory(void)
 	if (!snb_gfx_workaround_needed())
 		return;
 
-	printk(KERN_DEBUG "reserving inaccessible SNB gfx pages\n");
+	pr_debug("reserving inaccessible SNB gfx pages\n");
 
 	/*
 	 * Reserve all memory below the 1 MB mark that has not
@@ -723,8 +723,8 @@ static void __init trim_snb_memory(void)
 	
 	for (i = 0; i < ARRAY_SIZE(bad_pages); i++) {
 		if (memblock_reserve(bad_pages[i], PAGE_SIZE))
-			printk(KERN_WARNING "failed to reserve 0x%08lx\n",
-			       bad_pages[i]);
+			pr_warn("failed to reserve 0x%08lx\n",
+				bad_pages[i]);
 	}
 }
 
@@ -881,7 +881,7 @@ void __init setup_arch(char **cmdline_p)
 	 */
 	__flush_tlb_all();
 #else
-	printk(KERN_INFO "Command line: %s\n", boot_command_line);
+	pr_info("Command line: %s\n", boot_command_line);
 #endif
 
 	/*
@@ -1030,7 +1030,7 @@ void __init setup_arch(char **cmdline_p)
 		e820_update_range(0x70000000ULL, 0x40000ULL, E820_RAM,
 				  E820_RESERVED);
 		sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map);
-		printk(KERN_INFO "fixed physical RAM map:\n");
+		pr_info("fixed physical RAM map:\n");
 		e820_print_map("bad_ppro");
 	}
 #else
@@ -1107,8 +1107,8 @@ void __init setup_arch(char **cmdline_p)
 #endif
 
 #ifdef CONFIG_X86_32
-	printk(KERN_DEBUG "initial memory mapped: [mem 0x00000000-%#010lx]\n",
-			(max_pfn_mapped<<PAGE_SHIFT) - 1);
+	pr_debug("initial memory mapped: [mem 0x00000000-%#010lx]\n",
+		 (max_pfn_mapped<<PAGE_SHIFT) - 1);
 #endif
 
 	reserve_real_mode();
arch/x86/kernel/setup_percpu.c +1 -1
index e4fcb87..ce3527b 100644
@@ -206,7 +206,7 @@ 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",
+			pr_warn("%s allocator failed (%d), falling back to page size\n",
 				   pcpu_fc_names[pcpu_chosen_fc], rc);
 	}
 	if (rc < 0)
arch/x86/kernel/smpboot.c +3 -3
index 24d57f7..f0907e4 100644
@@ -692,7 +692,7 @@ void smp_announce(void)
 {
 	int num_nodes = num_online_nodes();
 
-	printk(KERN_INFO "x86: Booted up %d node%s, %d CPUs\n",
+	pr_info("x86: Booted up %d node%s, %d CPUs\n",
 	       num_nodes, (num_nodes > 1 ? "s" : ""), num_online_cpus());
 }
 
@@ -710,7 +710,7 @@ static void announce_cpu(int cpu, int apicid)
 		node_width = num_digits(num_possible_nodes()) + 1; /* + '#' */
 
 	if (cpu == 1)
-		printk(KERN_INFO "x86: Booting SMP configuration:\n");
+		pr_info("x86: Booting SMP configuration:\n");
 
 	if (system_state == SYSTEM_BOOTING) {
 		if (node != current_node) {
@@ -718,7 +718,7 @@ static void announce_cpu(int cpu, int apicid)
 				pr_cont("\n");
 			current_node = node;
 
-			printk(KERN_INFO ".... node %*s#%d, CPUs:  ",
+			pr_info(".... node %*s#%d, CPUs:  ",
 			       node_width - num_digits(node), " ", node);
 		}
 
arch/x86/kernel/sysfb_efi.c +3 -4
index b285d4e..c659998 100644
@@ -142,10 +142,9 @@ static int __init efifb_set_system(const struct dmi_system_id *id)
 		return 0;
 	}
 
-	printk(KERN_INFO "efifb: dmi detected %s - framebuffer at 0x%08x "
-			 "(%dx%d, stride %d)\n", id->ident,
-			 screen_info.lfb_base, screen_info.lfb_width,
-			 screen_info.lfb_height, screen_info.lfb_linelength);
+	pr_info("efifb: dmi detected %s - framebuffer at 0x%08x (%dx%d, stride %d)\n",
+		id->ident, screen_info.lfb_base, screen_info.lfb_width,
+		screen_info.lfb_height, screen_info.lfb_linelength);
 
 	return 1;
 }
arch/x86/kernel/sysfb_simplefb.c +1 -1
index 764a29f..c5b64cd 100644
@@ -73,7 +73,7 @@ __init int create_simplefb(const struct screen_info *si,
 	len = mode->height * mode->stride;
 	len = PAGE_ALIGN(len);
 	if (len > (u64)si->lfb_size << 16) {
-		printk(KERN_WARNING "sysfb: VRAM smaller than advertised\n");
+		pr_warn("sysfb: VRAM smaller than advertised\n");
 		return -EINVAL;
 	}
 
arch/x86/kernel/tboot.c +8 -8
index 91a4496..27b0452 100644
@@ -70,13 +70,13 @@ void __init tboot_probe(void)
 	 */
 	if (!e820_any_mapped(boot_params.tboot_addr,
 			     boot_params.tboot_addr, E820_RESERVED)) {
-		pr_warning("non-0 tboot_addr but it is not of type E820_RESERVED\n");
+		pr_warn("non-0 tboot_addr but it is not of type E820_RESERVED\n");
 		return;
 	}
 
 	/* only a natively booted kernel should be using TXT */
 	if (paravirt_enabled()) {
-		pr_warning("non-0 tboot_addr but pv_ops is enabled\n");
+		pr_warn("non-0 tboot_addr but pv_ops is enabled\n");
 		return;
 	}
 
@@ -84,13 +84,13 @@ void __init tboot_probe(void)
 	set_fixmap(FIX_TBOOT_BASE, boot_params.tboot_addr);
 	tboot = (struct tboot *)fix_to_virt(FIX_TBOOT_BASE);
 	if (memcmp(&tboot_uuid, &tboot->uuid, sizeof(tboot->uuid))) {
-		pr_warning("tboot at 0x%llx is invalid\n",
+		pr_warn("tboot at 0x%llx is invalid\n",
 			   boot_params.tboot_addr);
 		tboot = NULL;
 		return;
 	}
 	if (tboot->version < 5) {
-		pr_warning("tboot version is invalid: %u\n", tboot->version);
+		pr_warn("tboot version is invalid: %u\n", tboot->version);
 		tboot = NULL;
 		return;
 	}
@@ -293,7 +293,7 @@ static int tboot_sleep(u8 sleep_state, u32 pm1a_control, u32 pm1b_control)
 
 	if (sleep_state >= ACPI_S_STATE_COUNT ||
 	    acpi_shutdown_map[sleep_state] == -1) {
-		pr_warning("unsupported sleep state 0x%x\n", sleep_state);
+		pr_warn("unsupported sleep state 0x%x\n", sleep_state);
 		return -1;
 	}
 
@@ -306,7 +306,7 @@ static int tboot_extended_sleep(u8 sleep_state, u32 val_a, u32 val_b)
 	if (!tboot_enabled())
 		return 0;
 
-	pr_warning("tboot is not able to suspend on platforms with reduced hardware sleep (ACPIv5)");
+	pr_warn("tboot is not able to suspend on platforms with reduced hardware sleep (ACPIv5)");
 	return -ENODEV;
 }
 
@@ -324,7 +324,7 @@ static int tboot_wait_for_aps(int num_aps)
 	}
 
 	if (timeout)
-		pr_warning("tboot wait for APs timeout\n");
+		pr_warn("tboot wait for APs timeout\n");
 
 	return !(atomic_read((atomic_t *)&tboot->num_in_wfs) == num_aps);
 }
@@ -526,7 +526,7 @@ int tboot_force_iommu(void)
 		return 0;
 
 	if (no_iommu || swiotlb || dmar_disabled)
-		pr_warning("Forcing Intel-IOMMU to enabled\n");
+		pr_warn("Forcing Intel-IOMMU to enabled\n");
 
 	dmar_disabled = 0;
 #ifdef CONFIG_SWIOTLB
arch/x86/kernel/tce_64.c +2 -3
index ab40954..e1a9034 100644
@@ -113,7 +113,7 @@ static int tce_table_setparms(struct pci_dev *dev, struct iommu_table *tbl)
 	bitmapsz = tbl->it_size / BITS_PER_BYTE;
 	bmppages = __get_free_pages(GFP_KERNEL, get_order(bitmapsz));
 	if (!bmppages) {
-		printk(KERN_ERR "Calgary: cannot allocate bitmap\n");
+		pr_err("Calgary: cannot allocate bitmap\n");
 		ret = -ENOMEM;
 		goto done;
 	}
@@ -138,14 +138,13 @@ int __init build_tce_table(struct pci_dev *dev, void __iomem *bbar)
 	int ret;
 
 	if (pci_iommu(dev->bus)) {
-		printk(KERN_ERR "Calgary: dev %p has sysdata->iommu %p\n",
+		pr_err("Calgary: dev %p has sysdata->iommu %p\n",
 		       dev, pci_iommu(dev->bus));
 		BUG();
 	}
 
 	tbl = kzalloc(sizeof(struct iommu_table), GFP_KERNEL);
 	if (!tbl) {
-		printk(KERN_ERR "Calgary: error allocating iommu_table\n");
 		ret = -ENOMEM;
 		goto done;
 	}
arch/x86/kernel/test_nx.c +8 -8
index 3f92ce0..9bc948c 100644
@@ -54,8 +54,8 @@ static void fudze_exception_table(void *marker, void *new)
 	 * table.
 	 */
 	if (mod->num_exentries > 1) {
-		printk(KERN_ERR "test_nx: too many exception table entries!\n");
-		printk(KERN_ERR "test_nx: test results are not reliable.\n");
+		pr_err("test_nx: too many exception table entries!\n");
+		pr_err("test_nx: test results are not reliable.\n");
 		return;
 	}
 	extable = (struct exception_table_entry *)mod->extable;
@@ -115,11 +115,11 @@ static int test_NX(void)
 
 	test_data = 0xC3;
 
-	printk(KERN_INFO "Testing NX protection\n");
+	pr_info("Testing NX protection\n");
 
 	/* Test 1: check if the stack is not executable */
 	if (test_address(&stackcode)) {
-		printk(KERN_ERR "test_nx: stack was executable\n");
+		pr_err("test_nx: stack was executable\n");
 		ret = -ENODEV;
 	}
 
@@ -131,7 +131,7 @@ static int test_NX(void)
 	heap[0] = 0xC3; /* opcode for "ret" */
 
 	if (test_address(heap)) {
-		printk(KERN_ERR "test_nx: heap was executable\n");
+		pr_err("test_nx: heap was executable\n");
 		ret = -ENODEV;
 	}
 	kfree(heap);
@@ -145,10 +145,10 @@ static int test_NX(void)
 #ifdef CONFIG_DEBUG_RODATA
 	/* Test 3: Check if the .rodata section is executable */
 	if (rodata_test_data != 0xC3) {
-		printk(KERN_ERR "test_nx: .rodata marker has invalid value\n");
+		pr_err("test_nx: .rodata marker has invalid value\n");
 		ret = -ENODEV;
 	} else if (test_address(&rodata_test_data)) {
-		printk(KERN_ERR "test_nx: .rodata section is executable\n");
+		pr_err("test_nx: .rodata section is executable\n");
 		ret = -ENODEV;
 	}
 #endif
@@ -156,7 +156,7 @@ static int test_NX(void)
 #if 0
 	/* Test 4: Check if the .data section of a module is executable */
 	if (test_address(&test_data)) {
-		printk(KERN_ERR "test_nx: .data section is executable\n");
+		pr_err("test_nx: .data section is executable\n");
 		ret = -ENODEV;
 	}
 
arch/x86/kernel/test_rodata.c +5 -5
index 5ecbfe5..e578b83 100644
@@ -22,7 +22,7 @@ int rodata_test(void)
 	/* test 1: read the value */
 	/* If this test fails, some previous testrun has clobbered the state */
 	if (!rodata_test_data) {
-		printk(KERN_ERR "rodata_test: test 1 fails (start data)\n");
+		pr_err("rodata_test: test 1 fails (start data)\n");
 		return -ENODEV;
 	}
 
@@ -50,25 +50,25 @@ int rodata_test(void)
 
 
 	if (!result) {
-		printk(KERN_ERR "rodata_test: test data was not read only\n");
+		pr_err("rodata_test: test data was not read only\n");
 		return -ENODEV;
 	}
 
 	/* test 3: check the value hasn't changed */
 	/* If this test fails, we managed to overwrite the data */
 	if (!rodata_test_data) {
-		printk(KERN_ERR "rodata_test: Test 3 fails (end data)\n");
+		pr_err("rodata_test: Test 3 fails (end data)\n");
 		return -ENODEV;
 	}
 	/* test 4: check if the rodata section is 4Kb aligned */
 	start = (unsigned long)__start_rodata;
 	end = (unsigned long)__end_rodata;
 	if (start & (PAGE_SIZE - 1)) {
-		printk(KERN_ERR "rodata_test: .rodata is not 4k aligned\n");
+		pr_err("rodata_test: .rodata is not 4k aligned\n");
 		return -ENODEV;
 	}
 	if (end & (PAGE_SIZE - 1)) {
-		printk(KERN_ERR "rodata_test: .rodata end is not 4k aligned\n");
+		pr_err("rodata_test: .rodata end is not 4k aligned\n");
 		return -ENODEV;
 	}
 
arch/x86/kernel/tsc_sync.c +3 -3
index 78083bf..39419df 100644
@@ -156,10 +156,10 @@ void check_tsc_sync_source(int cpu)
 		cpu_relax();
 
 	if (nr_warps) {
-		pr_warning("TSC synchronization [CPU#%d -> CPU#%d]:\n",
+		pr_warn("TSC synchronization [CPU#%d -> CPU#%d]:\n",
 			smp_processor_id(), cpu);
-		pr_warning("Measured %Ld cycles TSC warp between CPUs, "
-			   "turning off TSC clock.\n", max_warp);
+		pr_warn("Measured %lld cycles TSC warp between CPUs, turning off TSC clock.\n",
+			max_warp);
 		mark_tsc_unstable("check_tsc_sync_source failed");
 	} else {
 		pr_debug("TSC synchronization [CPU#%d -> CPU#%d]: passed\n",
arch/x86/kernel/vsmp_64.c +1 -1
index b034b1b..f4b8927 100644
@@ -97,7 +97,7 @@ static void __init set_vsmp_pv_ops(void)
 	address = early_ioremap(cfg, 8);
 	cap = readl(address);
 	ctl = readl(address + 4);
-	printk(KERN_INFO "vSMP CTL: capabilities:0x%08x  control:0x%08x\n",
+	pr_info("vSMP CTL: capabilities:0x%08x  control:0x%08x\n",
 	       cap, ctl);
 
 	/* If possible, let the vSMP foundation route the interrupt optimally */
arch/x86/pci/mmconfig-shared.c +14 -18
index dd30b7e..d398568 100644
@@ -22,7 +22,7 @@
 #include <asm/pci_x86.h>
 #include <asm/acpi.h>
 
-#define PREFIX "PCI: "
+#define pr_fmt(fmt) "PCI: " fmt
 
 /* Indicate if the mmcfg resources have been placed into the resource table. */
 static bool pci_mmcfg_running_state;
@@ -104,10 +104,8 @@ static struct pci_mmcfg_region *__init pci_mmconfig_add(int segment, int start,
 		list_add_sorted(new);
 		mutex_unlock(&pci_mmcfg_lock);
 
-		pr_info(PREFIX
-		       "MMCONFIG for domain %04x [bus %02x-%02x] at %pR "
-		       "(base %#lx)\n",
-		       segment, start, end, &new->res, (unsigned long)addr);
+		pr_info("MMCONFIG for domain %04x [bus %02x-%02x] at %pR (base %#lx)\n",
+			segment, start, end, &new->res, (unsigned long)addr);
 	}
 
 	return new;
@@ -364,7 +362,7 @@ static int __init pci_mmcfg_check_hostbridge(void)
 			name = pci_mmcfg_probes[i].probe();
 
 		if (name)
-			pr_info(PREFIX "%s with MMCONFIG support\n", name);
+			pr_info("%s with MMCONFIG support\n", name);
 	}
 
 	/* some end_bus_number is crazy, fix it */
@@ -465,8 +463,8 @@ static int __ref is_mmconf_reserved(check_reserved_t is_reserved,
 		dev_info(dev, "MMCONFIG at %pR reserved in %s\n",
 			 &cfg->res, method);
 	else
-		pr_info(PREFIX "MMCONFIG at %pR reserved in %s\n",
-		       &cfg->res, method);
+		pr_info("MMCONFIG at %pR reserved in %s\n",
+			&cfg->res, method);
 
 	if (old_size != size) {
 		/* update end_bus */
@@ -484,9 +482,7 @@ static int __ref is_mmconf_reserved(check_reserved_t is_reserved,
 				"at %pR (base %#lx) (size reduced!)\n",
 				&cfg->res, (unsigned long) cfg->address);
 		else
-			pr_info(PREFIX
-				"MMCONFIG for %04x [bus%02x-%02x] "
-				"at %pR (base %#lx) (size reduced!)\n",
+			pr_info("MMCONFIG for %04x [bus%02x-%02x] at %pR (base %#lx) (size reduced!)\n",
 				cfg->segment, cfg->start_bus, cfg->end_bus,
 				&cfg->res, (unsigned long) cfg->address);
 	}
@@ -507,7 +503,7 @@ static int __ref pci_mmcfg_check_reserved(struct device *dev,
 				 "ACPI motherboard resources\n",
 				 &cfg->res);
 		else
-			pr_info(FW_INFO PREFIX
+			pr_info(FW_INFO
 			       "MMCONFIG at %pR not reserved in "
 			       "ACPI motherboard resources\n",
 			       &cfg->res);
@@ -536,7 +532,7 @@ static void __init pci_mmcfg_reject_broken(int early)
 
 	list_for_each_entry(cfg, &pci_mmcfg_list, list) {
 		if (pci_mmcfg_check_reserved(NULL, cfg, early) == 0) {
-			pr_info(PREFIX "not using MMCONFIG\n");
+			pr_info("not using MMCONFIG\n");
 			free_all_mmcfg();
 			return;
 		}
@@ -560,9 +556,9 @@ static int __init acpi_mcfg_check_entry(struct acpi_table_mcfg *mcfg,
 			return 0;
 	}
 
-	pr_err(PREFIX "MCFG region for %04x [bus %02x-%02x] at %#llx "
-	       "is above 4GB, ignored\n", cfg->pci_segment,
-	       cfg->start_bus_number, cfg->end_bus_number, cfg->address);
+	pr_err("MCFG region for %04x [bus %02x-%02x] at %#llx is above 4GB, ignored\n",
+		cfg->pci_segment, cfg->start_bus_number, cfg->end_bus_number,
+		cfg->address);
 	return -EINVAL;
 }
 
@@ -587,7 +583,7 @@ static int __init pci_parse_mcfg(struct acpi_table_header *header)
 		i -= sizeof(struct acpi_mcfg_allocation);
 	}
 	if (entries == 0) {
-		pr_err(PREFIX "MMCONFIG has no entries\n");
+		pr_err("MMCONFIG has no entries\n");
 		return -ENODEV;
 	}
 
@@ -601,7 +597,7 @@ static int __init pci_parse_mcfg(struct acpi_table_header *header)
 
 		if (pci_mmconfig_add(cfg->pci_segment, cfg->start_bus_number,
 				   cfg->end_bus_number, cfg->address) == NULL) {
-			pr_warn(PREFIX "no memory for MCFG entries\n");
+			pr_warn("no memory for MCFG entries\n");
 			free_all_mmcfg();
 			return -ENOMEM;
 		}
arch/x86/pci/mmconfig_64.c +2 -2
index bea5249..5fd3871 100644
@@ -13,7 +13,7 @@
 #include <asm/e820.h>
 #include <asm/pci_x86.h>
 
-#define PREFIX "PCI: "
+#define pr_fmt(fmt) "PCI: " fmt
 
 static char __iomem *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn)
 {
@@ -137,7 +137,7 @@ int pci_mmcfg_arch_map(struct pci_mmcfg_region *cfg)
 {
 	cfg->virt = mcfg_ioremap(cfg);
 	if (!cfg->virt) {
-		pr_err(PREFIX "can't map MMCONFIG at %pR\n", &cfg->res);
+		pr_err("can't map MMCONFIG at %pR\n", &cfg->res);
 		return -ENOMEM;
 	}
 
Signature · 1 line
1.8.3.1
#1 lore raw
reproduce:

Hi Chen,

[auto build test WARNING on tip/x86/core]
[also build test WARNING on v4.5-rc3 next-20160212]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url:    https://github.com/0day-ci/linux/commits/Chen-Yucong/x86-kernel-use-pr_-level-and-dev_-level/20160214-121236
config: x86_64-randconfig-x012-201607 (attached as .config)
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All warnings (new ones prefixed by >>):

>> arch/x86/pci/mmconfig-shared.c:25:0: warning: "pr_fmt" redefined
    #define pr_fmt(fmt) "PCI: " fmt
    ^
   In file included from include/linux/kernel.h:13:0,
                    from include/linux/list.h:8,
                    from include/linux/pci.h:25,
                    from arch/x86/pci/mmconfig-shared.c:13:
   include/linux/printk.h:236:0: note: this is the location of the previous definition
    #define pr_fmt(fmt) fmt
    ^

vim +/pr_fmt +25 arch/x86/pci/mmconfig-shared.c

     9	 * Per-architecture code takes care of the mappings and accesses
    10	 * themselves.
    11	 */
    12	
    13	#include <linux/pci.h>
    14	#include <linux/init.h>
    15	#include <linux/sfi_acpi.h>
    16	#include <linux/bitmap.h>
    17	#include <linux/dmi.h>
    18	#include <linux/slab.h>
    19	#include <linux/mutex.h>
    20	#include <linux/rculist.h>
    21	#include <asm/e820.h>
    22	#include <asm/pci_x86.h>
    23	#include <asm/acpi.h>
    24	
  > 25	#define pr_fmt(fmt) "PCI: " fmt
    26	
    27	/* Indicate if the mmcfg resources have been placed into the resource table. */
    28	static bool pci_mmcfg_running_state;
    29	static bool pci_mmcfg_arch_init_failed;
    30	static DEFINE_MUTEX(pci_mmcfg_lock);
    31	
    32	LIST_HEAD(pci_mmcfg_list);
    33	

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

#2 lore raw
In reply to Chen Yucong
reproduce:

Hi Chen,

[auto build test WARNING on tip/x86/core]
[also build test WARNING on v4.5-rc3 next-20160212]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url:    https://github.com/0day-ci/linux/commits/Chen-Yucong/x86-kernel-use-pr_-level-and-dev_-level/20160214-121236
config: x86_64-allmodconfig (attached as .config)
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All warnings (new ones prefixed by >>):

>> arch/x86/pci/mmconfig_64.c:16:0: warning: "pr_fmt" redefined
    #define pr_fmt(fmt) "PCI: " fmt
    ^
   In file included from include/linux/kernel.h:13:0,
                    from include/linux/list.h:8,
                    from include/linux/pci.h:25,
                    from arch/x86/pci/mmconfig_64.c:8:
   include/linux/printk.h:236:0: note: this is the location of the previous definition
    #define pr_fmt(fmt) fmt
    ^

vim +/pr_fmt +16 arch/x86/pci/mmconfig_64.c

     1	/*
     2	 * mmconfig.c - Low-level direct PCI config space access via MMCONFIG
     3	 *
     4	 * This is an 64bit optimized version that always keeps the full mmconfig
     5	 * space mapped. This allows lockless config space operation.
     6	 */
     7	
     8	#include <linux/pci.h>
     9	#include <linux/init.h>
    10	#include <linux/acpi.h>
    11	#include <linux/bitmap.h>
    12	#include <linux/rcupdate.h>
    13	#include <asm/e820.h>
    14	#include <asm/pci_x86.h>
    15	
  > 16	#define pr_fmt(fmt) "PCI: " fmt
    17	
    18	static char __iomem *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn)
    19	{
    20		struct pci_mmcfg_region *cfg = pci_mmconfig_lookup(seg, bus);
    21	
    22		if (cfg && cfg->virt)
    23			return cfg->virt + (PCI_MMCFG_BUS_OFFSET(bus) | (devfn << 12));
    24		return NULL;

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

maintainer
#3 lore raw
In reply to Chen Yucong
Quoted 7 lines · Chen Yucong

arch/x86/kernel/* use a mixture of printk(KERN_<level> ) and pr_<level>(). This patch converts the bulk of printk(KERN_<level> ) to pr_<level>() and uses dev_dbg() instead of the dev_printk(KERN_DEBUG,). All pr_warning() calls have been replaced with pr_warn().

Not sure what to do about the printk(KERN_DEFAULT) and printk() without a log level.

...

Quoted 17 lines
arch/x86/kernel/alternative.c +1 -1
index 25f9093..0ecb579 100644
@@ -59,7 +59,7 @@ __setup("noreplace-paravirt", setup_noreplace_paravirt);
 #define DPRINTK(fmt, args...)						\
 do {									\
 	if (debug_alternative)						\
-		printk(KERN_DEBUG "%s: " fmt "\n", __func__, ##args);	\
+		pr_debug("%s: " fmt "\n", __func__, ##args);	\
 } while (0)
 
 #define DUMP_BYTES(buf, len, fmt, args...)				\
@@ -70,10 +70,10 @@ do {									\
 		if (!(len))						\
 			break;						\
 									\

arch/x86/kernel/alternative.c do { \ · line 79

Quoted 10 lines
arch/x86/kernel/alternative.c +3 -3
-		printk(KERN_DEBUG fmt, ##args);				\
+		pr_debug(fmt, ##args);				\
 		for (j = 0; j < (len) - 1; j++)				\
-			printk(KERN_CONT "%02hhx ", buf[j]);		\
-		printk(KERN_CONT "%02hhx\n", buf[j]);			\
+			pr_cont("%02hhx ", buf[j]);		\
+		pr_cont("%02hhx\n", buf[j]);			\
 	}								\
 } while (0)
 

NAK the hell out of that hunk!

Did you actually look at how pr_debug() is defined?

Yeah, I don't think so. With your change, when I boot with "debug-alternative" I get:

...

[    0.064005] Last level dTLB entries: 4KB 512, 2MB 255, 4MB 127, 1GB 0
[    0.068005] e9 d5 3e d3 00
[    0.072004] e9 e8 92 21 ff
[    0.075003] eb 11 0f 1f 00
[    0.077906] e8 c5 b6 30 00
[    0.084009] f3 48 0f b8 c7
[    0.091241] f3 48 0f b8 c7
[    0.094259] e8 d9 b5 30 00
[    0.097611] f3 48 0f b8 c7
[    0.100004] f3 48 0f b8 c7
[    0.103067] 90 90 90
[    0.105575] 0f ae f0
[    0.108004] 0f ae f0
[    0.112007] 90 90 90
[    0.114331] 0f ae f0
[    0.116004] 0f ae f0
[    0.118365] e8 07 21 62 ff

How is that useful?!

Please stop for a second with those senseless conversions and think first. Try the change you're doing in kvm, take a look at what it affects and think hard whether it makes any sense at all. Only if it does, *then* send out the patch.

I'm willing to bet that *all* pr_debug* conversions below are wrong too.

Geez :(

Signature · 4 lines
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.
#4 lore raw
Quoted 22 lines · Borislav Petkov
Quoted 4 lines
arch/x86/kernel/alternative.c +0 -0
@@ -70,10 +70,10 @@ do {									\
 		if (!(len))						\
 			break;						\
 									\

arch/x86/kernel/alternative.c do { \ · line 79

Quoted 10 lines
arch/x86/kernel/alternative.c +3 -3
-		printk(KERN_DEBUG fmt, ##args);				\
+		pr_debug(fmt, ##args);				\
 		for (j = 0; j < (len) - 1; j++)				\
-			printk(KERN_CONT "%02hhx ", buf[j]);		\
-		printk(KERN_CONT "%02hhx\n", buf[j]);			\
+			pr_cont("%02hhx ", buf[j]);		\
+		pr_cont("%02hhx\n", buf[j]);			\
 	}								\
 } while (0)
 

NAK the hell out of that hunk!

Did you actually look at how pr_debug() is defined?

Yeah, I don't think so. With your change, when I boot with "debug-alternative" I get:

Quoted 7 lines

...

[    0.064005] Last level dTLB entries: 4KB 512, 2MB 255, 4MB 127, 1GB 0
[    0.068005] e9 d5 3e d3 00
[    0.072004] e9 e8 92 21 ff
[    0.075003] eb 11 0f 1f 00
[    0.077906] e8 c5 b6 30 00
[    0.084009] f3 48 0f b8 c7

Hm, so I suspect the other patch I already applied is buggy as well?

triton:~/tip> git log -1 -p 1b74dde7c47c | grep KERN_DEBUG
- printk(KERN_DEBUG "tseg: %010llx\n", tseg);
- printk(KERN_DEBUG "CPU%d: Thermal monitoring handled by SMI\n", cpu);
-#define Dprintk(x...) do { if (debug_print) printk(KERN_DEBUG x); } while (0)
- printk(KERN_DEBUG "After WB checking\n");
- printk(KERN_DEBUG "MTRR MAP PFN: %016llx - %016llx\n",
- printk(KERN_DEBUG "After UC checking\n");
- printk(KERN_DEBUG "MTRR MAP PFN: %016llx - %016llx\n",
- printk(KERN_DEBUG "After sorting\n");
- printk(KERN_DEBUG "MTRR MAP PFN: %016llx - %016llx\n",
- printk(KERN_DEBUG "reg %d, base: %ld%cB, range: %ld%cB, type %s\n",
- printk(KERN_DEBUG "original variable MTRRs\n");
- printk(KERN_DEBUG "New variable MTRRs\n");
- printk(KERN_DEBUG "New variable MTRRs\n");
- printk(KERN_DEBUG "Failed to setup IBS LVT offset, "
- printk(KERN_DEBUG "No CPU node configured for IBS\n");
- printk(KERN_DEBUG "No EILVT entry available\n");

Thanks,

Ingo

maintainer
#5 lore raw
Quoted 1 line · Ingo Molnar

Hm, so I suspect the other patch I already applied is buggy as well?

Yap.

pr_debug() is ugly to use:

/* If you are writing a driver, please use dev_dbg instead */ #if defined(CONFIG_DYNAMIC_DEBUG)
/* dynamic_pr_debug() uses pr_fmt() internally so we don't need it here */

#define pr_debug(fmt, ...) \
        dynamic_pr_debug(fmt, ##__VA_ARGS__)
#elif defined(DEBUG)
#define pr_debug(fmt, ...) \
        printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
#else
#define pr_debug(fmt, ...) \
        no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)

#endif

so in the !CONFIG_DYNAMIC_DEBUG case, you want to boot with "ignore_loglevel" and see all those debug statements but that can't work because you have to rebuild and slap a

#define DEBUG

somewhere *before* all includes.

Which is clearly dumb.

FWIW, that pr_debug() should have been defined without the defined(DEBUG) conditional in order to be an equivalent conversion like the rest of the pr_* gunk.

I propose we add

pr_debug_i_mean_it()

and use *that* instead. :-)

Signature · 4 lines
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.