Skip to content

Commit 4eee1e7

Browse files
committed
m68k/sun3x: Modernize printing of kernel messages
- Convert from printk() to pr_*(), - Remove #undef DEBUG, - Drop useless Warning prefix, - Use TABs for indentation while at it. Signed-off-by: Geert Uytterhoeven <[email protected]>
1 parent 56bbd86 commit 4eee1e7

File tree

3 files changed

+22
-31
lines changed

3 files changed

+22
-31
lines changed

arch/m68k/include/asm/sun3xflop.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ static unsigned char sun3x_82072_fd_inb(int port)
4848
// udelay(5);
4949
switch(port & 7) {
5050
default:
51-
printk("floppy: Asked to read unknown port %d\n", port);
51+
pr_crit("floppy: Asked to read unknown port %d\n", port);
5252
panic("floppy: Port bolixed.");
5353
case 4: /* FD_STATUS */
5454
return (*sun3x_fdc.status_r) & ~STATUS_DMA;
@@ -70,7 +70,7 @@ static void sun3x_82072_fd_outb(unsigned char value, int port)
7070
// udelay(5);
7171
switch(port & 7) {
7272
default:
73-
printk("floppy: Asked to write to unknown port %d\n", port);
73+
pr_crit("floppy: Asked to write to unknown port %d\n", port);
7474
panic("floppy: Port bolixed.");
7575
case 2: /* FD_DOR */
7676
/* Oh geese, 82072 on the Sun has no DOR register,
@@ -127,7 +127,7 @@ asmlinkage irqreturn_t sun3xflop_hardint(int irq, void *dev_id)
127127
return IRQ_HANDLED;
128128
}
129129

130-
// printk("doing pdma\n");// st %x\n", sun_fdc->status_82072);
130+
// pr_info("doing pdma\n");// st %x\n", sun_fdc->status_82072);
131131

132132
#ifdef TRACE_FLPY_INT
133133
if(!calls)
@@ -171,7 +171,7 @@ asmlinkage irqreturn_t sun3xflop_hardint(int irq, void *dev_id)
171171
#ifdef TRACE_FLPY_INT
172172
calls++;
173173
#endif
174-
// printk("st=%02x\n", st);
174+
// pr_info("st=%02x\n", st);
175175
if(st == 0x20)
176176
return IRQ_HANDLED;
177177
if(!(st & 0x20)) {
@@ -180,9 +180,9 @@ asmlinkage irqreturn_t sun3xflop_hardint(int irq, void *dev_id)
180180
doing_pdma = 0;
181181

182182
#ifdef TRACE_FLPY_INT
183-
printk("count=%x, residue=%x calls=%d bytes=%x dma_wait=%d\n",
184-
virtual_dma_count, virtual_dma_residue, calls, bytes,
185-
dma_wait);
183+
pr_info("count=%x, residue=%x calls=%d bytes=%x dma_wait=%d\n",
184+
virtual_dma_count, virtual_dma_residue, calls, bytes,
185+
dma_wait);
186186
calls = 0;
187187
dma_wait=0;
188188
#endif

arch/m68k/sun3x/dvma.c

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,17 @@ static volatile unsigned long *iommu_pte = (unsigned long *)SUN3X_IOMMU;
5858
((addr & 0x03c00000) >> \
5959
(DVMA_PAGE_SHIFT+4)))
6060

61-
#undef DEBUG
62-
6361
#ifdef DEBUG
6462
/* code to print out a dvma mapping for debugging purposes */
6563
void dvma_print (unsigned long dvma_addr)
6664
{
6765

68-
unsigned long index;
69-
70-
index = dvma_addr >> DVMA_PAGE_SHIFT;
71-
72-
printk("idx %lx dvma_addr %08lx paddr %08lx\n", index, dvma_addr,
73-
dvma_entry_paddr(index));
66+
unsigned long index;
7467

68+
index = dvma_addr >> DVMA_PAGE_SHIFT;
7569

70+
pr_info("idx %lx dvma_addr %08lx paddr %08lx\n", index, dvma_addr,
71+
dvma_entry_paddr(index));
7672
}
7773
#endif
7874

@@ -91,10 +87,7 @@ inline int dvma_map_cpu(unsigned long kaddr,
9187

9288
end = PAGE_ALIGN(vaddr + len);
9389

94-
#ifdef DEBUG
95-
printk("dvma: mapping kern %08lx to virt %08lx\n",
96-
kaddr, vaddr);
97-
#endif
90+
pr_debug("dvma: mapping kern %08lx to virt %08lx\n", kaddr, vaddr);
9891
pgd = pgd_offset_k(vaddr);
9992

10093
do {
@@ -126,10 +119,8 @@ inline int dvma_map_cpu(unsigned long kaddr,
126119
end3 = end2;
127120

128121
do {
129-
#ifdef DEBUG
130-
printk("mapping %08lx phys to %08lx\n",
131-
__pa(kaddr), vaddr);
132-
#endif
122+
pr_debug("mapping %08lx phys to %08lx\n",
123+
__pa(kaddr), vaddr);
133124
set_pte(pte, pfn_pte(virt_to_pfn(kaddr),
134125
PAGE_KERNEL));
135126
pte++;
@@ -162,7 +153,8 @@ inline int dvma_map_iommu(unsigned long kaddr, unsigned long baddr,
162153
for(; index < end ; index++) {
163154
// if(dvma_entry_use(index))
164155
// BUG();
165-
// printk("mapping pa %lx to ba %lx\n", __pa(kaddr), index << DVMA_PAGE_SHIFT);
156+
// pr_info("mapping pa %lx to ba %lx\n", __pa(kaddr),
157+
// index << DVMA_PAGE_SHIFT);
166158

167159
dvma_entry_set(index, __pa(kaddr));
168160

@@ -190,13 +182,12 @@ void dvma_unmap_iommu(unsigned long baddr, int len)
190182
end = (DVMA_PAGE_ALIGN(baddr+len) >> DVMA_PAGE_SHIFT);
191183

192184
for(; index < end ; index++) {
193-
#ifdef DEBUG
194-
printk("freeing bus mapping %08x\n", index << DVMA_PAGE_SHIFT);
195-
#endif
185+
pr_debug("freeing bus mapping %08x\n",
186+
index << DVMA_PAGE_SHIFT);
196187
#if 0
197188
if(!dvma_entry_use(index))
198-
printk("dvma_unmap freeing unused entry %04x\n",
199-
index);
189+
pr_info("dvma_unmap freeing unused entry %04x\n",
190+
index);
200191
else
201192
dvma_entry_dec(index);
202193
#endif

arch/m68k/sun3x/prom.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ void __init sun3x_prom_init(void)
106106
idprom_init();
107107

108108
if (!((idprom->id_machtype & SM_ARCH_MASK) == SM_SUN3X)) {
109-
printk("Warning: machine reports strange type %02x\n",
109+
pr_warn("Machine reports strange type %02x\n",
110110
idprom->id_machtype);
111-
printk("Pretending it's a 3/80, but very afraid...\n");
111+
pr_warn("Pretending it's a 3/80, but very afraid...\n");
112112
idprom->id_machtype = SM_SUN3X | SM_3_80;
113113
}
114114

0 commit comments

Comments
 (0)