Skip to content

Commit a5d3244

Browse files
committed
x86/gart: Replace printk() with pr_info()
Replace printk() with pr_info(), pr_err(), etc. Define pr_fmt() to prefix output with "AGP: ". No functional change except the addition of "AGP: " prefix in dmesg output. Signed-off-by: Bjorn Helgaas <[email protected]>
1 parent adc429d commit a5d3244

File tree

1 file changed

+26
-28
lines changed

1 file changed

+26
-28
lines changed

arch/x86/kernel/aperture_64.c

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
*
1111
* Copyright 2002 Andi Kleen, SuSE Labs.
1212
*/
13+
#define pr_fmt(fmt) "AGP: " fmt
14+
1315
#include <linux/kernel.h>
1416
#include <linux/types.h>
1517
#include <linux/init.h>
@@ -75,14 +77,13 @@ static u32 __init allocate_aperture(void)
7577
addr = memblock_find_in_range(GART_MIN_ADDR, GART_MAX_ADDR,
7678
aper_size, aper_size);
7779
if (!addr) {
78-
printk(KERN_ERR
79-
"Cannot allocate aperture memory hole (%lx,%uK)\n",
80-
addr, aper_size>>10);
80+
pr_err("Cannot allocate aperture memory hole (%lx,%uK)\n",
81+
addr, aper_size>>10);
8182
return 0;
8283
}
8384
memblock_reserve(addr, aper_size);
84-
printk(KERN_INFO "Mapping aperture over %d KB of RAM @ %lx\n",
85-
aper_size >> 10, addr);
85+
pr_info("Mapping aperture over %d KB of RAM @ %lx\n", aper_size >> 10,
86+
addr);
8687
register_nosave_region(addr >> PAGE_SHIFT,
8788
(addr+aper_size) >> PAGE_SHIFT);
8889

@@ -126,10 +127,10 @@ static u32 __init read_agp(int bus, int slot, int func, int cap, u32 *order)
126127
u64 aper;
127128
u32 old_order;
128129

129-
printk(KERN_INFO "AGP bridge at %02x:%02x:%02x\n", bus, slot, func);
130+
pr_info("AGP bridge at %02x:%02x:%02x\n", bus, slot, func);
130131
apsizereg = read_pci_config_16(bus, slot, func, cap + 0x14);
131132
if (apsizereg == 0xffffffff) {
132-
printk(KERN_ERR "APSIZE in AGP bridge unreadable\n");
133+
pr_err("APSIZE in AGP bridge unreadable\n");
133134
return 0;
134135
}
135136

@@ -153,16 +154,16 @@ static u32 __init read_agp(int bus, int slot, int func, int cap, u32 *order)
153154
* On some sick chips, APSIZE is 0. It means it wants 4G
154155
* so let double check that order, and lets trust AMD NB settings:
155156
*/
156-
printk(KERN_INFO "Aperture from AGP @ %Lx old size %u MB\n",
157-
aper, 32 << old_order);
157+
pr_info("Aperture from AGP @ %Lx old size %u MB\n",
158+
aper, 32 << old_order);
158159
if (aper + (32ULL<<(20 + *order)) > 0x100000000ULL) {
159-
printk(KERN_INFO "Aperture size %u MB (APSIZE %x) is not right, using settings from NB\n",
160-
32 << *order, apsizereg);
160+
pr_info("Aperture size %u MB (APSIZE %x) is not right, using settings from NB\n",
161+
32 << *order, apsizereg);
161162
*order = old_order;
162163
}
163164

164-
printk(KERN_INFO "Aperture from AGP @ %Lx size %u MB (APSIZE %x)\n",
165-
aper, 32 << *order, apsizereg);
165+
pr_info("Aperture from AGP @ %Lx size %u MB (APSIZE %x)\n", aper,
166+
32 << *order, apsizereg);
166167

167168
if (!aperture_valid(aper, (32*1024*1024) << *order, 32<<20))
168169
return 0;
@@ -218,7 +219,7 @@ static u32 __init search_agp_bridge(u32 *order, int *valid_agp)
218219
}
219220
}
220221
}
221-
printk(KERN_INFO "No AGP bridge found\n");
222+
pr_info("No AGP bridge found\n");
222223

223224
return 0;
224225
}
@@ -310,7 +311,7 @@ void __init early_gart_iommu_check(void)
310311
if (e820_any_mapped(aper_base, aper_base + aper_size,
311312
E820_RAM)) {
312313
/* reserve it, so we can reuse it in second kernel */
313-
printk(KERN_INFO "update e820 for GART\n");
314+
pr_info("update e820 for GART\n");
314315
e820_add_region(aper_base, aper_size, E820_RESERVED);
315316
update_e820();
316317
}
@@ -354,7 +355,7 @@ int __init gart_iommu_hole_init(void)
354355
!early_pci_allowed())
355356
return -ENODEV;
356357

357-
printk(KERN_INFO "Checking aperture...\n");
358+
pr_info("Checking aperture...\n");
358359

359360
if (!fallback_aper_force)
360361
agp_aper_base = search_agp_bridge(&agp_aper_order, &valid_agp);
@@ -395,8 +396,8 @@ int __init gart_iommu_hole_init(void)
395396
aper_base = read_pci_config(bus, slot, 3, AMD64_GARTAPERTUREBASE) & 0x7fff;
396397
aper_base <<= 25;
397398

398-
printk(KERN_INFO "Node %d: aperture @ %Lx size %u MB\n",
399-
node, aper_base, aper_size >> 20);
399+
pr_info("Node %d: aperture @ %Lx size %u MB\n",
400+
node, aper_base, aper_size >> 20);
400401
node++;
401402

402403
if (!aperture_valid(aper_base, aper_size, 64<<20)) {
@@ -407,9 +408,9 @@ int __init gart_iommu_hole_init(void)
407408
if (!no_iommu &&
408409
max_pfn > MAX_DMA32_PFN &&
409410
!printed_gart_size_msg) {
410-
printk(KERN_ERR "you are using iommu with agp, but GART size is less than 64M\n");
411-
printk(KERN_ERR "please increase GART size in your BIOS setup\n");
412-
printk(KERN_ERR "if BIOS doesn't have that option, contact your HW vendor!\n");
411+
pr_err("you are using iommu with agp, but GART size is less than 64M\n");
412+
pr_err("please increase GART size in your BIOS setup\n");
413+
pr_err("if BIOS doesn't have that option, contact your HW vendor!\n");
413414
printed_gart_size_msg = 1;
414415
}
415416
} else {
@@ -446,13 +447,10 @@ int __init gart_iommu_hole_init(void)
446447
force_iommu ||
447448
valid_agp ||
448449
fallback_aper_force) {
449-
printk(KERN_INFO
450-
"Your BIOS doesn't leave a aperture memory hole\n");
451-
printk(KERN_INFO
452-
"Please enable the IOMMU option in the BIOS setup\n");
453-
printk(KERN_INFO
454-
"This costs you %d MB of RAM\n",
455-
32 << fallback_aper_order);
450+
pr_info("Your BIOS doesn't leave a aperture memory hole\n");
451+
pr_info("Please enable the IOMMU option in the BIOS setup\n");
452+
pr_info("This costs you %d MB of RAM\n",
453+
32 << fallback_aper_order);
456454

457455
aper_order = fallback_aper_order;
458456
aper_alloc = allocate_aperture();

0 commit comments

Comments
 (0)