Skip to content

Commit 4ed89f2

Browse files
author
Russell King
committed
ARM: convert printk(KERN_* to pr_*
Convert many (but not all) printk(KERN_* to pr_* to simplify the code. We take the opportunity to join some printk lines together so we don't split the message across several lines, and we also add a few levels to some messages which were previously missing them. Tested-by: Andrew Lunn <andrew@lunn.ch> Tested-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
1 parent c2459d3 commit 4ed89f2

28 files changed

Lines changed: 128 additions & 146 deletions

‎arch/arm/common/sa1111.c‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,8 @@ static int sa1111_retrigger_lowirq(struct irq_data *d)
282282
}
283283

284284
if (i == 8)
285-
printk(KERN_ERR "Danger Will Robinson: failed to "
286-
"re-trigger IRQ%d\n", d->irq);
285+
pr_err("Danger Will Robinson: failed to re-trigger IRQ%d\n",
286+
d->irq);
287287
return i == 8 ? -1 : 0;
288288
}
289289

@@ -384,8 +384,8 @@ static int sa1111_retrigger_highirq(struct irq_data *d)
384384
}
385385

386386
if (i == 8)
387-
printk(KERN_ERR "Danger Will Robinson: failed to "
388-
"re-trigger IRQ%d\n", d->irq);
387+
pr_err("Danger Will Robinson: failed to re-trigger IRQ%d\n",
388+
d->irq);
389389
return i == 8 ? -1 : 0;
390390
}
391391

@@ -740,9 +740,8 @@ static int __sa1111_probe(struct device *me, struct resource *mem, int irq)
740740
goto err_unmap;
741741
}
742742

743-
printk(KERN_INFO "SA1111 Microprocessor Companion Chip: "
744-
"silicon revision %lx, metal revision %lx\n",
745-
(id & SKID_SIREV_MASK)>>4, (id & SKID_MTREV_MASK));
743+
pr_info("SA1111 Microprocessor Companion Chip: silicon revision %lx, metal revision %lx\n",
744+
(id & SKID_SIREV_MASK) >> 4, id & SKID_MTREV_MASK);
746745

747746
/*
748747
* We found it. Wake the chip up, and initialise.

‎arch/arm/kernel/atags_compat.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ static void __init build_tag_list(struct param_struct *params, void *taglist)
9797
struct tag *tag = taglist;
9898

9999
if (params->u1.s.page_size != PAGE_SIZE) {
100-
printk(KERN_WARNING "Warning: bad configuration page, "
101-
"trying to continue\n");
100+
pr_warn("Warning: bad configuration page, trying to continue\n");
102101
return;
103102
}
104103

@@ -109,8 +108,7 @@ static void __init build_tag_list(struct param_struct *params, void *taglist)
109108
params->u1.s.nr_pages != 0x04000 &&
110109
params->u1.s.nr_pages != 0x08000 &&
111110
params->u1.s.nr_pages != 0x10000) {
112-
printk(KERN_WARNING "Warning: bad NeTTrom parameters "
113-
"detected, using defaults\n");
111+
pr_warn("Warning: bad NeTTrom parameters detected, using defaults\n");
114112

115113
params->u1.s.nr_pages = 0x1000; /* 16MB */
116114
params->u1.s.ramdisk_size = 0;

‎arch/arm/kernel/atags_parse.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,7 @@ static void __init parse_tags(const struct tag *t)
167167
{
168168
for (; t->hdr.size; t = tag_next(t))
169169
if (!parse_tag(t))
170-
printk(KERN_WARNING
171-
"Ignoring unrecognised tag 0x%08x\n",
170+
pr_warn("Ignoring unrecognised tag 0x%08x\n",
172171
t->hdr.tag);
173172
}
174173

@@ -193,7 +192,7 @@ setup_machine_tags(phys_addr_t __atags_pointer, unsigned int machine_nr)
193192
*/
194193
for_each_machine_desc(p)
195194
if (machine_nr == p->nr) {
196-
printk("Machine: %s\n", p->name);
195+
pr_info("Machine: %s\n", p->name);
197196
mdesc = p;
198197
break;
199198
}

‎arch/arm/kernel/atags_proc.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ static int __init init_atags_procfs(void)
4141
size_t size;
4242

4343
if (tag->hdr.tag != ATAG_CORE) {
44-
printk(KERN_INFO "No ATAGs?");
44+
pr_info("No ATAGs?");
4545
return -EINVAL;
4646
}
4747

@@ -68,7 +68,7 @@ static int __init init_atags_procfs(void)
6868

6969
nomem:
7070
kfree(b);
71-
printk(KERN_ERR "Exporting ATAGs: not enough memory\n");
71+
pr_err("Exporting ATAGs: not enough memory\n");
7272

7373
return -ENOMEM;
7474
}

‎arch/arm/kernel/bios32.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ void pcibios_fixup_bus(struct pci_bus *bus)
355355
/*
356356
* Report what we did for this bus
357357
*/
358-
printk(KERN_INFO "PCI: bus%d: Fast back to back transfers %sabled\n",
358+
pr_info("PCI: bus%d: Fast back to back transfers %sabled\n",
359359
bus->number, (features & PCI_COMMAND_FAST_BACK) ? "en" : "dis");
360360
}
361361
EXPORT_SYMBOL(pcibios_fixup_bus);

‎arch/arm/kernel/dma-isa.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ void __init isa_init_dma(void)
213213
for (chan = 0; chan < 8; chan++) {
214214
int ret = isa_dma_add(chan, &isa_dma[chan]);
215215
if (ret)
216-
printk(KERN_ERR "ISADMA%u: unable to register: %d\n",
217-
chan, ret);
216+
pr_err("ISADMA%u: unable to register: %d\n",
217+
chan, ret);
218218
}
219219

220220
request_dma(DMA_ISA_CASCADE, "cascade");

‎arch/arm/kernel/dma.c‎

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ int request_dma(unsigned int chan, const char *device_id)
7979
return ret;
8080

8181
bad_dma:
82-
printk(KERN_ERR "dma: trying to allocate DMA%d\n", chan);
82+
pr_err("dma: trying to allocate DMA%d\n", chan);
8383
return -EINVAL;
8484

8585
busy:
@@ -100,7 +100,7 @@ void free_dma(unsigned int chan)
100100
goto bad_dma;
101101

102102
if (dma->active) {
103-
printk(KERN_ERR "dma%d: freeing active DMA\n", chan);
103+
pr_err("dma%d: freeing active DMA\n", chan);
104104
dma->d_ops->disable(chan, dma);
105105
dma->active = 0;
106106
}
@@ -111,11 +111,11 @@ void free_dma(unsigned int chan)
111111
return;
112112
}
113113

114-
printk(KERN_ERR "dma%d: trying to free free DMA\n", chan);
114+
pr_err("dma%d: trying to free free DMA\n", chan);
115115
return;
116116

117117
bad_dma:
118-
printk(KERN_ERR "dma: trying to free DMA%d\n", chan);
118+
pr_err("dma: trying to free DMA%d\n", chan);
119119
}
120120
EXPORT_SYMBOL(free_dma);
121121

@@ -126,8 +126,7 @@ void set_dma_sg (unsigned int chan, struct scatterlist *sg, int nr_sg)
126126
dma_t *dma = dma_channel(chan);
127127

128128
if (dma->active)
129-
printk(KERN_ERR "dma%d: altering DMA SG while "
130-
"DMA active\n", chan);
129+
pr_err("dma%d: altering DMA SG while DMA active\n", chan);
131130

132131
dma->sg = sg;
133132
dma->sgcount = nr_sg;
@@ -144,8 +143,7 @@ void __set_dma_addr (unsigned int chan, void *addr)
144143
dma_t *dma = dma_channel(chan);
145144

146145
if (dma->active)
147-
printk(KERN_ERR "dma%d: altering DMA address while "
148-
"DMA active\n", chan);
146+
pr_err("dma%d: altering DMA address while DMA active\n", chan);
149147

150148
dma->sg = NULL;
151149
dma->addr = addr;
@@ -162,8 +160,7 @@ void set_dma_count (unsigned int chan, unsigned long count)
162160
dma_t *dma = dma_channel(chan);
163161

164162
if (dma->active)
165-
printk(KERN_ERR "dma%d: altering DMA count while "
166-
"DMA active\n", chan);
163+
pr_err("dma%d: altering DMA count while DMA active\n", chan);
167164

168165
dma->sg = NULL;
169166
dma->count = count;
@@ -178,8 +175,7 @@ void set_dma_mode (unsigned int chan, unsigned int mode)
178175
dma_t *dma = dma_channel(chan);
179176

180177
if (dma->active)
181-
printk(KERN_ERR "dma%d: altering DMA mode while "
182-
"DMA active\n", chan);
178+
pr_err("dma%d: altering DMA mode while DMA active\n", chan);
183179

184180
dma->dma_mode = mode;
185181
dma->invalid = 1;
@@ -202,7 +198,7 @@ void enable_dma (unsigned int chan)
202198
return;
203199

204200
free_dma:
205-
printk(KERN_ERR "dma%d: trying to enable free DMA\n", chan);
201+
pr_err("dma%d: trying to enable free DMA\n", chan);
206202
BUG();
207203
}
208204
EXPORT_SYMBOL(enable_dma);
@@ -223,7 +219,7 @@ void disable_dma (unsigned int chan)
223219
return;
224220

225221
free_dma:
226-
printk(KERN_ERR "dma%d: trying to disable free DMA\n", chan);
222+
pr_err("dma%d: trying to disable free DMA\n", chan);
227223
BUG();
228224
}
229225
EXPORT_SYMBOL(disable_dma);
@@ -240,7 +236,7 @@ EXPORT_SYMBOL(dma_channel_active);
240236

241237
void set_dma_page(unsigned int chan, char pagenr)
242238
{
243-
printk(KERN_ERR "dma%d: trying to set_dma_page\n", chan);
239+
pr_err("dma%d: trying to set_dma_page\n", chan);
244240
}
245241
EXPORT_SYMBOL(set_dma_page);
246242

‎arch/arm/kernel/etm.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ static void etm_dump(void)
213213
int length;
214214

215215
if (!t->etb_regs) {
216-
printk(KERN_INFO "No tracing hardware found\n");
216+
pr_info("No tracing hardware found\n");
217217
return;
218218
}
219219

@@ -229,11 +229,11 @@ static void etm_dump(void)
229229

230230
etb_writel(t, first, ETBR_READADDR);
231231

232-
printk(KERN_INFO "Trace buffer contents length: %d\n", length);
233-
printk(KERN_INFO "--- ETB buffer begin ---\n");
232+
pr_info("Trace buffer contents length: %d\n", length);
233+
pr_info("--- ETB buffer begin ---\n");
234234
for (; length; length--)
235235
printk("%08x", cpu_to_be32(etb_readl(t, ETBR_READMEM)));
236-
printk(KERN_INFO "\n--- ETB buffer end ---\n");
236+
pr_info("\n--- ETB buffer end ---\n");
237237

238238
/* deassert the overflow bit */
239239
etb_writel(t, 1, ETBR_CTRL);
@@ -633,14 +633,14 @@ static int __init etm_init(void)
633633

634634
retval = amba_driver_register(&etb_driver);
635635
if (retval) {
636-
printk(KERN_ERR "Failed to register etb\n");
636+
pr_err("Failed to register etb\n");
637637
return retval;
638638
}
639639

640640
retval = amba_driver_register(&etm_driver);
641641
if (retval) {
642642
amba_driver_unregister(&etb_driver);
643-
printk(KERN_ERR "Failed to probe etm\n");
643+
pr_err("Failed to probe etm\n");
644644
return retval;
645645
}
646646

‎arch/arm/kernel/fiq.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ int claim_fiq(struct fiq_handler *f)
124124
void release_fiq(struct fiq_handler *f)
125125
{
126126
if (current_fiq != f) {
127-
printk(KERN_ERR "%s FIQ trying to release %s FIQ\n",
127+
pr_err("%s FIQ trying to release %s FIQ\n",
128128
f->name, current_fiq->name);
129129
dump_stack();
130130
return;

‎arch/arm/kernel/irq.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ void set_irq_flags(unsigned int irq, unsigned int iflags)
8282
unsigned long clr = 0, set = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN;
8383

8484
if (irq >= nr_irqs) {
85-
printk(KERN_ERR "Trying to set irq flags for IRQ%d\n", irq);
85+
pr_err("Trying to set irq flags for IRQ%d\n", irq);
8686
return;
8787
}
8888

0 commit comments

Comments
 (0)