Skip to content

Commit e6d8c84

Browse files
JoePerchesKAGA-KOKO
authored andcommitted
x86/mtrr: Rename main.c to mtrr.c and remove duplicate prefixes
Kbuild uses the first file as the name for KBUILD_MODNAME. mtrr uses main.c as its first file, so rename that file to mtrr.c and fixup the Makefile. Remove the now duplicate "mtrr: " prefixes from the logging calls. Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Link: https://lkml.kernel.org/r/ae1fa81a0d1fad87571967b91ea90f70f486e853.1525964384.git.joe@perches.com
1 parent 1de392f commit e6d8c84

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

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
@@ -100,7 +100,7 @@ static int have_wrcomb(void)
100100
if (dev->vendor == PCI_VENDOR_ID_SERVERWORKS &&
101101
dev->device == PCI_DEVICE_ID_SERVERWORKS_LE &&
102102
dev->revision <= 5) {
103-
pr_info("mtrr: Serverworks LE rev < 6 detected. Write-combining disabled.\n");
103+
pr_info("Serverworks LE rev < 6 detected. Write-combining disabled.\n");
104104
pci_dev_put(dev);
105105
return 0;
106106
}
@@ -110,7 +110,7 @@ static int have_wrcomb(void)
110110
*/
111111
if (dev->vendor == PCI_VENDOR_ID_INTEL &&
112112
dev->device == PCI_DEVICE_ID_INTEL_82451NX) {
113-
pr_info("mtrr: Intel 450NX MMC detected. Write-combining disabled.\n");
113+
pr_info("Intel 450NX MMC detected. Write-combining disabled.\n");
114114
pci_dev_put(dev);
115115
return 0;
116116
}
@@ -312,24 +312,24 @@ int mtrr_add_page(unsigned long base, unsigned long size,
312312
return error;
313313

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

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

325325
if (!size) {
326-
pr_warn("mtrr: zero sized request\n");
326+
pr_warn("zero sized request\n");
327327
return -EINVAL;
328328
}
329329

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

@@ -360,16 +360,15 @@ int mtrr_add_page(unsigned long base, unsigned long size,
360360
} else if (types_compatible(type, ltype))
361361
continue;
362362
}
363-
pr_warn("mtrr: 0x%lx000,0x%lx000 overlaps existing"
364-
" 0x%lx000,0x%lx000\n", base, size, lbase,
363+
pr_warn("0x%lx000,0x%lx000 overlaps existing 0x%lx000,0x%lx000\n", base, size, lbase,
365364
lsize);
366365
goto out;
367366
}
368367
/* New region is enclosed by an existing region */
369368
if (ltype != type) {
370369
if (types_compatible(type, ltype))
371370
continue;
372-
pr_warn("mtrr: type mismatch for %lx000,%lx000 old: %s new: %s\n",
371+
pr_warn("type mismatch for %lx000,%lx000 old: %s new: %s\n",
373372
base, size, mtrr_attrib_to_str(ltype),
374373
mtrr_attrib_to_str(type));
375374
goto out;
@@ -395,7 +394,7 @@ int mtrr_add_page(unsigned long base, unsigned long size,
395394
}
396395
}
397396
} else {
398-
pr_info("mtrr: no more MTRRs available\n");
397+
pr_info("no more MTRRs available\n");
399398
}
400399
error = i;
401400
out:
@@ -407,8 +406,8 @@ int mtrr_add_page(unsigned long base, unsigned long size,
407406
static int mtrr_check(unsigned long base, unsigned long size)
408407
{
409408
if ((base & (PAGE_SIZE - 1)) || (size & (PAGE_SIZE - 1))) {
410-
pr_warn("mtrr: size and base must be multiples of 4 kiB\n");
411-
pr_debug("mtrr: size: 0x%lx base: 0x%lx\n", size, base);
409+
pr_warn("size and base must be multiples of 4 kiB\n");
410+
pr_debug("size: 0x%lx base: 0x%lx\n", size, base);
412411
dump_stack();
413412
return -1;
414413
}
@@ -499,22 +498,22 @@ int mtrr_del_page(int reg, unsigned long base, unsigned long size)
499498
}
500499
}
501500
if (reg < 0) {
502-
pr_debug("mtrr: no MTRR for %lx000,%lx000 found\n",
501+
pr_debug("no MTRR for %lx000,%lx000 found\n",
503502
base, size);
504503
goto out;
505504
}
506505
}
507506
if (reg >= max) {
508-
pr_warn("mtrr: register: %d too big\n", reg);
507+
pr_warn("register: %d too big\n", reg);
509508
goto out;
510509
}
511510
mtrr_if->get(reg, &lbase, &lsize, &ltype);
512511
if (lsize < 1) {
513-
pr_warn("mtrr: MTRR %d not used\n", reg);
512+
pr_warn("MTRR %d not used\n", reg);
514513
goto out;
515514
}
516515
if (mtrr_usage_table[reg] < 1) {
517-
pr_warn("mtrr: reg: %d has count=0\n", reg);
516+
pr_warn("reg: %d has count=0\n", reg);
518517
goto out;
519518
}
520519
if (--mtrr_usage_table[reg] < 1)
@@ -775,7 +774,7 @@ void __init mtrr_bp_init(void)
775774
}
776775

777776
if (!mtrr_enabled()) {
778-
pr_info("MTRR: Disabled\n");
777+
pr_info("Disabled\n");
779778

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

0 commit comments

Comments
 (0)