Skip to content

Commit 0afe832

Browse files
committed
Merge branch 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 cleanups from Ingo Molnar: "Misc cleanups" * 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/apm: Fix spelling mistake: "caculate" -> "calculate" x86/mtrr: Rename main.c to mtrr.c and remove duplicate prefixes x86: Remove pr_fmt duplicate logging prefixes x86/early-quirks: Rename duplicate define of dev_err x86/bpf: Clean up non-standard comments, to make the code more readable
2 parents 42964c6 + 844ea8f commit 0afe832

File tree

10 files changed

+188
-155
lines changed

10 files changed

+188
-155
lines changed

arch/x86/events/amd/ibs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,7 @@ static void force_ibs_eilvt_setup(void)
889889
if (!ibs_eilvt_valid())
890890
goto out;
891891

892-
pr_info("IBS: LVT offset %d assigned\n", offset);
892+
pr_info("LVT offset %d assigned\n", offset);
893893

894894
return;
895895
out:

arch/x86/kernel/apm_32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2433,7 +2433,7 @@ MODULE_PARM_DESC(idle_threshold,
24332433
"System idle percentage above which to make APM BIOS idle calls");
24342434
module_param(idle_period, int, 0444);
24352435
MODULE_PARM_DESC(idle_period,
2436-
"Period (in sec/100) over which to caculate the idle percentage");
2436+
"Period (in sec/100) over which to calculate the idle percentage");
24372437
module_param(smp, bool, 0444);
24382438
MODULE_PARM_DESC(smp,
24392439
"Set this to enable APM use on an SMP platform. Use with caution on older systems");

arch/x86/kernel/cpu/mtrr/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
obj-y := main.o if.o generic.o cleanup.o
1+
obj-y := mtrr.o if.o generic.o cleanup.o
22
obj-$(CONFIG_X86_32) += amd.o cyrix.o centaur.o
33

arch/x86/kernel/cpu/mtrr/main.c renamed to arch/x86/kernel/cpu/mtrr/mtrr.c

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ static int have_wrcomb(void)
101101
if (dev->vendor == PCI_VENDOR_ID_SERVERWORKS &&
102102
dev->device == PCI_DEVICE_ID_SERVERWORKS_LE &&
103103
dev->revision <= 5) {
104-
pr_info("mtrr: Serverworks LE rev < 6 detected. Write-combining disabled.\n");
104+
pr_info("Serverworks LE rev < 6 detected. Write-combining disabled.\n");
105105
pci_dev_put(dev);
106106
return 0;
107107
}
@@ -111,7 +111,7 @@ static int have_wrcomb(void)
111111
*/
112112
if (dev->vendor == PCI_VENDOR_ID_INTEL &&
113113
dev->device == PCI_DEVICE_ID_INTEL_82451NX) {
114-
pr_info("mtrr: Intel 450NX MMC detected. Write-combining disabled.\n");
114+
pr_info("Intel 450NX MMC detected. Write-combining disabled.\n");
115115
pci_dev_put(dev);
116116
return 0;
117117
}
@@ -313,24 +313,24 @@ int mtrr_add_page(unsigned long base, unsigned long size,
313313
return error;
314314

315315
if (type >= MTRR_NUM_TYPES) {
316-
pr_warn("mtrr: type: %u invalid\n", type);
316+
pr_warn("type: %u invalid\n", type);
317317
return -EINVAL;
318318
}
319319

320320
/* If the type is WC, check that this processor supports it */
321321
if ((type == MTRR_TYPE_WRCOMB) && !have_wrcomb()) {
322-
pr_warn("mtrr: your processor doesn't support write-combining\n");
322+
pr_warn("your processor doesn't support write-combining\n");
323323
return -ENOSYS;
324324
}
325325

326326
if (!size) {
327-
pr_warn("mtrr: zero sized request\n");
327+
pr_warn("zero sized request\n");
328328
return -EINVAL;
329329
}
330330

331331
if ((base | (base + size - 1)) >>
332332
(boot_cpu_data.x86_phys_bits - PAGE_SHIFT)) {
333-
pr_warn("mtrr: base or size exceeds the MTRR width\n");
333+
pr_warn("base or size exceeds the MTRR width\n");
334334
return -EINVAL;
335335
}
336336

@@ -361,16 +361,15 @@ int mtrr_add_page(unsigned long base, unsigned long size,
361361
} else if (types_compatible(type, ltype))
362362
continue;
363363
}
364-
pr_warn("mtrr: 0x%lx000,0x%lx000 overlaps existing"
365-
" 0x%lx000,0x%lx000\n", base, size, lbase,
364+
pr_warn("0x%lx000,0x%lx000 overlaps existing 0x%lx000,0x%lx000\n", base, size, lbase,
366365
lsize);
367366
goto out;
368367
}
369368
/* New region is enclosed by an existing region */
370369
if (ltype != type) {
371370
if (types_compatible(type, ltype))
372371
continue;
373-
pr_warn("mtrr: type mismatch for %lx000,%lx000 old: %s new: %s\n",
372+
pr_warn("type mismatch for %lx000,%lx000 old: %s new: %s\n",
374373
base, size, mtrr_attrib_to_str(ltype),
375374
mtrr_attrib_to_str(type));
376375
goto out;
@@ -396,7 +395,7 @@ int mtrr_add_page(unsigned long base, unsigned long size,
396395
}
397396
}
398397
} else {
399-
pr_info("mtrr: no more MTRRs available\n");
398+
pr_info("no more MTRRs available\n");
400399
}
401400
error = i;
402401
out:
@@ -408,8 +407,8 @@ int mtrr_add_page(unsigned long base, unsigned long size,
408407
static int mtrr_check(unsigned long base, unsigned long size)
409408
{
410409
if ((base & (PAGE_SIZE - 1)) || (size & (PAGE_SIZE - 1))) {
411-
pr_warn("mtrr: size and base must be multiples of 4 kiB\n");
412-
pr_debug("mtrr: size: 0x%lx base: 0x%lx\n", size, base);
410+
pr_warn("size and base must be multiples of 4 kiB\n");
411+
pr_debug("size: 0x%lx base: 0x%lx\n", size, base);
413412
dump_stack();
414413
return -1;
415414
}
@@ -500,22 +499,22 @@ int mtrr_del_page(int reg, unsigned long base, unsigned long size)
500499
}
501500
}
502501
if (reg < 0) {
503-
pr_debug("mtrr: no MTRR for %lx000,%lx000 found\n",
502+
pr_debug("no MTRR for %lx000,%lx000 found\n",
504503
base, size);
505504
goto out;
506505
}
507506
}
508507
if (reg >= max) {
509-
pr_warn("mtrr: register: %d too big\n", reg);
508+
pr_warn("register: %d too big\n", reg);
510509
goto out;
511510
}
512511
mtrr_if->get(reg, &lbase, &lsize, &ltype);
513512
if (lsize < 1) {
514-
pr_warn("mtrr: MTRR %d not used\n", reg);
513+
pr_warn("MTRR %d not used\n", reg);
515514
goto out;
516515
}
517516
if (mtrr_usage_table[reg] < 1) {
518-
pr_warn("mtrr: reg: %d has count=0\n", reg);
517+
pr_warn("reg: %d has count=0\n", reg);
519518
goto out;
520519
}
521520
if (--mtrr_usage_table[reg] < 1)
@@ -776,7 +775,7 @@ void __init mtrr_bp_init(void)
776775
}
777776

778777
if (!mtrr_enabled()) {
779-
pr_info("MTRR: Disabled\n");
778+
pr_info("Disabled\n");
780779

781780
/*
782781
* PAT initialization relies on MTRR's rendezvous handler.

arch/x86/kernel/e820.c

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ static void __init __e820__range_add(struct e820_table *table, u64 start, u64 si
155155
int x = table->nr_entries;
156156

157157
if (x >= ARRAY_SIZE(table->entries)) {
158-
pr_err("e820: too many entries; ignoring [mem %#010llx-%#010llx]\n", start, start + size - 1);
158+
pr_err("too many entries; ignoring [mem %#010llx-%#010llx]\n",
159+
start, start + size - 1);
159160
return;
160161
}
161162

@@ -190,9 +191,10 @@ void __init e820__print_table(char *who)
190191
int i;
191192

192193
for (i = 0; i < e820_table->nr_entries; i++) {
193-
pr_info("%s: [mem %#018Lx-%#018Lx] ", who,
194-
e820_table->entries[i].addr,
195-
e820_table->entries[i].addr + e820_table->entries[i].size - 1);
194+
pr_info("%s: [mem %#018Lx-%#018Lx] ",
195+
who,
196+
e820_table->entries[i].addr,
197+
e820_table->entries[i].addr + e820_table->entries[i].size - 1);
196198

197199
e820_print_type(e820_table->entries[i].type);
198200
pr_cont("\n");
@@ -574,7 +576,7 @@ void __init e820__update_table_print(void)
574576
if (e820__update_table(e820_table))
575577
return;
576578

577-
pr_info("e820: modified physical RAM map:\n");
579+
pr_info("modified physical RAM map:\n");
578580
e820__print_table("modified");
579581
}
580582

@@ -636,9 +638,8 @@ __init void e820__setup_pci_gap(void)
636638
if (!found) {
637639
#ifdef CONFIG_X86_64
638640
gapstart = (max_pfn << PAGE_SHIFT) + 1024*1024;
639-
pr_err(
640-
"e820: Cannot find an available gap in the 32-bit address range\n"
641-
"e820: PCI devices with unassigned 32-bit BARs may not work!\n");
641+
pr_err("Cannot find an available gap in the 32-bit address range\n");
642+
pr_err("PCI devices with unassigned 32-bit BARs may not work!\n");
642643
#else
643644
gapstart = 0x10000000;
644645
#endif
@@ -649,7 +650,8 @@ __init void e820__setup_pci_gap(void)
649650
*/
650651
pci_mem_start = gapstart;
651652

652-
pr_info("e820: [mem %#010lx-%#010lx] available for PCI devices\n", gapstart, gapstart + gapsize - 1);
653+
pr_info("[mem %#010lx-%#010lx] available for PCI devices\n",
654+
gapstart, gapstart + gapsize - 1);
653655
}
654656

655657
/*
@@ -711,7 +713,7 @@ void __init e820__memory_setup_extended(u64 phys_addr, u32 data_len)
711713
memcpy(e820_table_firmware, e820_table, sizeof(*e820_table_firmware));
712714

713715
early_memunmap(sdata, data_len);
714-
pr_info("e820: extended physical RAM map:\n");
716+
pr_info("extended physical RAM map:\n");
715717
e820__print_table("extended");
716718
}
717719

@@ -780,7 +782,7 @@ u64 __init e820__memblock_alloc_reserved(u64 size, u64 align)
780782
addr = __memblock_alloc_base(size, align, MEMBLOCK_ALLOC_ACCESSIBLE);
781783
if (addr) {
782784
e820__range_update_kexec(addr, size, E820_TYPE_RAM, E820_TYPE_RESERVED);
783-
pr_info("e820: update e820_table_kexec for e820__memblock_alloc_reserved()\n");
785+
pr_info("update e820_table_kexec for e820__memblock_alloc_reserved()\n");
784786
e820__update_table_kexec();
785787
}
786788

@@ -830,8 +832,8 @@ static unsigned long __init e820_end_pfn(unsigned long limit_pfn, enum e820_type
830832
if (last_pfn > max_arch_pfn)
831833
last_pfn = max_arch_pfn;
832834

833-
pr_info("e820: last_pfn = %#lx max_arch_pfn = %#lx\n",
834-
last_pfn, max_arch_pfn);
835+
pr_info("last_pfn = %#lx max_arch_pfn = %#lx\n",
836+
last_pfn, max_arch_pfn);
835837
return last_pfn;
836838
}
837839

@@ -1005,7 +1007,7 @@ void __init e820__finish_early_params(void)
10051007
if (e820__update_table(e820_table) < 0)
10061008
early_panic("Invalid user supplied memory map");
10071009

1008-
pr_info("e820: user-defined physical RAM map:\n");
1010+
pr_info("user-defined physical RAM map:\n");
10091011
e820__print_table("user");
10101012
}
10111013
}
@@ -1238,7 +1240,7 @@ void __init e820__memory_setup(void)
12381240
memcpy(e820_table_kexec, e820_table, sizeof(*e820_table_kexec));
12391241
memcpy(e820_table_firmware, e820_table, sizeof(*e820_table_firmware));
12401242

1241-
pr_info("e820: BIOS-provided physical RAM map:\n");
1243+
pr_info("BIOS-provided physical RAM map:\n");
12421244
e820__print_table(who);
12431245
}
12441246

arch/x86/kernel/early-quirks.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
#include <asm/irq_remapping.h>
2929
#include <asm/early_ioremap.h>
3030

31-
#define dev_err(msg) pr_err("pci 0000:%02x:%02x.%d: %s", bus, slot, func, msg)
32-
3331
static void __init fix_hypertransport_config(int num, int slot, int func)
3432
{
3533
u32 htcfg;
@@ -617,7 +615,8 @@ static void __init apple_airport_reset(int bus, int slot, int func)
617615

618616
pmcsr = read_pci_config_16(bus, slot, func, BCM4331_PM_CAP + PCI_PM_CTRL);
619617
if ((pmcsr & PCI_PM_CTRL_STATE_MASK) != PCI_D0) {
620-
dev_err("Cannot power up Apple AirPort card\n");
618+
pr_err("pci 0000:%02x:%02x.%d: Cannot power up Apple AirPort card\n",
619+
bus, slot, func);
621620
return;
622621
}
623622
}
@@ -628,7 +627,8 @@ static void __init apple_airport_reset(int bus, int slot, int func)
628627

629628
mmio = early_ioremap(addr, BCM4331_MMIO_SIZE);
630629
if (!mmio) {
631-
dev_err("Cannot iomap Apple AirPort card\n");
630+
pr_err("pci 0000:%02x:%02x.%d: Cannot iomap Apple AirPort card\n",
631+
bus, slot, func);
632632
return;
633633
}
634634

arch/x86/kernel/hpet.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -975,8 +975,7 @@ int __init hpet_enable(void)
975975
cfg &= ~(HPET_CFG_ENABLE | HPET_CFG_LEGACY);
976976
hpet_writel(cfg, HPET_CFG);
977977
if (cfg)
978-
pr_warn("HPET: Unrecognized bits %#x set in global cfg\n",
979-
cfg);
978+
pr_warn("Unrecognized bits %#x set in global cfg\n", cfg);
980979

981980
for (i = 0; i <= last; ++i) {
982981
cfg = hpet_readl(HPET_Tn_CFG(i));
@@ -988,7 +987,7 @@ int __init hpet_enable(void)
988987
| HPET_TN_64BIT_CAP | HPET_TN_32BIT | HPET_TN_ROUTE
989988
| HPET_TN_FSB | HPET_TN_FSB_CAP);
990989
if (cfg)
991-
pr_warn("HPET: Unrecognized bits %#x set in cfg#%u\n",
990+
pr_warn("Unrecognized bits %#x set in cfg#%u\n",
992991
cfg, i);
993992
}
994993
hpet_print_config();

arch/x86/kernel/uprobes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,8 +1083,8 @@ arch_uretprobe_hijack_return_addr(unsigned long trampoline_vaddr, struct pt_regs
10831083
return orig_ret_vaddr;
10841084

10851085
if (nleft != rasize) {
1086-
pr_err("uprobe: return address clobbered: pid=%d, %%sp=%#lx, "
1087-
"%%ip=%#lx\n", current->pid, regs->sp, regs->ip);
1086+
pr_err("return address clobbered: pid=%d, %%sp=%#lx, %%ip=%#lx\n",
1087+
current->pid, regs->sp, regs->ip);
10881088

10891089
force_sig_info(SIGSEGV, SEND_SIG_FORCED, current);
10901090
}

arch/x86/mm/numa.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,13 @@ static int __init numa_add_memblk_to(int nid, u64 start, u64 end,
136136

137137
/* whine about and ignore invalid blks */
138138
if (start > end || nid < 0 || nid >= MAX_NUMNODES) {
139-
pr_warning("NUMA: Warning: invalid memblk node %d [mem %#010Lx-%#010Lx]\n",
140-
nid, start, end - 1);
139+
pr_warn("Warning: invalid memblk node %d [mem %#010Lx-%#010Lx]\n",
140+
nid, start, end - 1);
141141
return 0;
142142
}
143143

144144
if (mi->nr_blks >= NR_NODE_MEMBLKS) {
145-
pr_err("NUMA: too many memblk ranges\n");
145+
pr_err("too many memblk ranges\n");
146146
return -EINVAL;
147147
}
148148

@@ -267,14 +267,14 @@ int __init numa_cleanup_meminfo(struct numa_meminfo *mi)
267267
*/
268268
if (bi->end > bj->start && bi->start < bj->end) {
269269
if (bi->nid != bj->nid) {
270-
pr_err("NUMA: node %d [mem %#010Lx-%#010Lx] overlaps with node %d [mem %#010Lx-%#010Lx]\n",
270+
pr_err("node %d [mem %#010Lx-%#010Lx] overlaps with node %d [mem %#010Lx-%#010Lx]\n",
271271
bi->nid, bi->start, bi->end - 1,
272272
bj->nid, bj->start, bj->end - 1);
273273
return -EINVAL;
274274
}
275-
pr_warning("NUMA: Warning: node %d [mem %#010Lx-%#010Lx] overlaps with itself [mem %#010Lx-%#010Lx]\n",
276-
bi->nid, bi->start, bi->end - 1,
277-
bj->start, bj->end - 1);
275+
pr_warn("Warning: node %d [mem %#010Lx-%#010Lx] overlaps with itself [mem %#010Lx-%#010Lx]\n",
276+
bi->nid, bi->start, bi->end - 1,
277+
bj->start, bj->end - 1);
278278
}
279279

280280
/*
@@ -364,7 +364,7 @@ static int __init numa_alloc_distance(void)
364364
phys = memblock_find_in_range(0, PFN_PHYS(max_pfn_mapped),
365365
size, PAGE_SIZE);
366366
if (!phys) {
367-
pr_warning("NUMA: Warning: can't allocate distance table!\n");
367+
pr_warn("Warning: can't allocate distance table!\n");
368368
/* don't retry until explicitly reset */
369369
numa_distance = (void *)1LU;
370370
return -ENOMEM;
@@ -410,14 +410,14 @@ void __init numa_set_distance(int from, int to, int distance)
410410

411411
if (from >= numa_distance_cnt || to >= numa_distance_cnt ||
412412
from < 0 || to < 0) {
413-
pr_warn_once("NUMA: Warning: node ids are out of bound, from=%d to=%d distance=%d\n",
414-
from, to, distance);
413+
pr_warn_once("Warning: node ids are out of bound, from=%d to=%d distance=%d\n",
414+
from, to, distance);
415415
return;
416416
}
417417

418418
if ((u8)distance != distance ||
419419
(from == to && distance != LOCAL_DISTANCE)) {
420-
pr_warn_once("NUMA: Warning: invalid distance parameter, from=%d to=%d distance=%d\n",
420+
pr_warn_once("Warning: invalid distance parameter, from=%d to=%d distance=%d\n",
421421
from, to, distance);
422422
return;
423423
}

0 commit comments

Comments
 (0)