lkml.org 
[lkml]   [2002]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patches in this message
/
From
Subject[PATCH] Add KERN_* constants to printk()s
Date
From Kernel-Janitor todo, make sure printk() calls have the appropriate 
KERN_* constant. These are only from the kernel/ subdir.

Some of these might be off by a level, but I gave them the level that looked
appropriate. If this is accepted, I'll do more of them. This is a good
excercise for newbies like myself ;)

Thanks

--
Cory 'G' Watson
+ Hack, lest ye rust.

diff -Nru linux-2.5.24/kernel/dma.c linux-2.5.24-g/kernel/dma.c
--- linux-2.5.24/kernel/dma.c Sun Jun 2 21:44:43 2002
+++ linux-2.5.24-g/kernel/dma.c Wed Jun 26 09:08:35 2002
@@ -98,12 +98,12 @@
void free_dma(unsigned int dmanr)
{
if (dmanr >= MAX_DMA_CHANNELS) {
- printk("Trying to free DMA%d\n", dmanr);
+ printk(KERN_WARNING "Trying to free DMA%d\n", dmanr);
return;
}

if (xchg(&dma_chan_busy[dmanr].lock, 0) == 0) {
- printk("Trying to free free DMA%d\n", dmanr);
+ printk(KERN_WARNING "Trying to free free DMA%d\n", dmanr);
return;
}

diff -Nru linux-2.5.24/kernel/panic.c linux-2.5.24-g/kernel/panic.c
--- linux-2.5.24/kernel/panic.c Sun Jun 2 21:44:47 2002
+++ linux-2.5.24-g/kernel/panic.c Wed Jun 26 08:57:42 2002
@@ -88,7 +88,7 @@
extern int stop_a_enabled;
/* Make sure the user can actually press L1-A */
stop_a_enabled = 1;
- printk("Press L1-A to return to the boot prom\n");
+ printk(KERN_EMERG "Press L1-A to return to the boot prom\n");
}
#endif
#if defined(CONFIG_ARCH_S390)
diff -Nru linux-2.5.24/kernel/resource.c linux-2.5.24-g/kernel/resource.c
--- linux-2.5.24/kernel/resource.c Sun Jun 2 21:44:51 2002
+++ linux-2.5.24-g/kernel/resource.c Wed Jun 26 09:08:41 2002
@@ -290,7 +290,7 @@
}
p = &res->sibling;
}
- printk("Trying to free nonexistent resource <%08lx-%08lx>\n", start, end);
+ printk(KERN_WARNING "Trying to free nonexistent resource <%08lx-%08lx>\n",
start, end);
}

/*
diff -Nru linux-2.5.24/kernel/signal.c linux-2.5.24-g/kernel/signal.c
--- linux-2.5.24/kernel/signal.c Wed Jun 26 09:03:40 2002
+++ linux-2.5.24-g/kernel/signal.c Wed Jun 26 09:00:35 2002
@@ -270,7 +270,7 @@
int sig = 0;

#if DEBUG_SIG
-printk("SIG dequeue (%s:%d): %d ", current->comm, current->pid,
+printk(KERN_DEBUG "SIG dequeue (%s:%d): %d ", current->comm, current->pid,
signal_pending(current));
#endif

@@ -294,7 +294,7 @@
recalc_sigpending();

#if DEBUG_SIG
-printk(" %d -> %d\n", signal_pending(current), sig);
+printk(KERN_DEBUG " %d -> %d\n", signal_pending(current), sig);
#endif

return sig;
@@ -538,7 +538,7 @@


#if DEBUG_SIG
-printk("SIG queue (%s:%d): %d ", t->comm, t->pid, sig);
+printk(KERN_DEBUG "SIG queue (%s:%d): %d ", t->comm, t->pid, sig);
#endif

ret = -EINVAL;
@@ -576,7 +576,7 @@
spin_unlock_irqrestore(&t->sigmask_lock, flags);
out_nolock:
#if DEBUG_SIG
-printk(" %d -> %d\n", signal_pending(t), ret);
+printk(KERN_DEBUG " %d -> %d\n", signal_pending(t), ret);
#endif

return ret;
diff -Nru linux-2.5.24/kernel/softirq.c linux-2.5.24-g/kernel/softirq.c
--- linux-2.5.24/kernel/softirq.c Wed Jun 26 09:03:40 2002
+++ linux-2.5.24-g/kernel/softirq.c Wed Jun 26 08:51:51 2002
@@ -259,7 +259,7 @@
void tasklet_kill(struct tasklet_struct *t)
{
if (in_interrupt())
- printk("Attempt to kill tasklet from interrupt\n");
+ printk(KERN_WARNING "Attempt to kill tasklet from interrupt\n");

while (test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) {
current->state = TASK_RUNNING;
@@ -407,7 +407,7 @@
continue;
if (kernel_thread(ksoftirqd, (void *) (long) cpu,
CLONE_FS | CLONE_FILES | CLONE_SIGNAL) < 0)
- printk("spawn_ksoftirqd() failed for cpu %d\n", cpu);
+ printk(KERN_WARNING "spawn_ksoftirqd() failed for cpu %d\n", cpu);
else
while (!ksoftirqd_task(cpu))
yield();
diff -Nru linux-2.5.24/kernel/suspend.c linux-2.5.24-g/kernel/suspend.c
--- linux-2.5.24/kernel/suspend.c Wed Jun 26 09:03:33 2002
+++ linux-2.5.24-g/kernel/suspend.c Wed Jun 26 08:48:18 2002
@@ -335,7 +335,7 @@
memcpy(cur->swh.magic.magic,"SWAP-SPACE",10);
else if (!memcmp("SUSP2R",cur->swh.magic.magic,6))
memcpy(cur->swh.magic.magic,"SWAPSPACE2",10);
- else printk("%sUnable to find suspended-data signature (%.10s -
misspelled?\n",
+ else printk(KERN_WARNING "%sUnable to find suspended-data signature (%.10s
- misspelled?\n",
name_resume, cur->swh.magic.magic);
} else {
if ((!memcmp("SWAP-SPACE",cur->swh.magic.magic,10)))
diff -Nru linux-2.5.24/kernel/timer.c linux-2.5.24-g/kernel/timer.c
--- linux-2.5.24/kernel/timer.c Wed Jun 26 09:03:40 2002
+++ linux-2.5.24-g/kernel/timer.c Wed Jun 26 08:46:09 2002
@@ -194,7 +194,7 @@
return;
bug:
spin_unlock_irqrestore(&timerlist_lock, flags);
- printk("bug: kernel timer added twice at %p.\n",
+ printk(KERN_ERR "bug: kernel timer added twice at %p.\n",
__builtin_return_address(0));
}
diff -Nru linux-2.5.24/kernel/dma.c linux-2.5.24-g/kernel/dma.c
--- linux-2.5.24/kernel/dma.c Sun Jun 2 21:44:43 2002
+++ linux-2.5.24-g/kernel/dma.c Wed Jun 26 09:08:35 2002
@@ -98,12 +98,12 @@
void free_dma(unsigned int dmanr)
{
if (dmanr >= MAX_DMA_CHANNELS) {
- printk("Trying to free DMA%d\n", dmanr);
+ printk(KERN_WARNING "Trying to free DMA%d\n", dmanr);
return;
}

if (xchg(&dma_chan_busy[dmanr].lock, 0) == 0) {
- printk("Trying to free free DMA%d\n", dmanr);
+ printk(KERN_WARNING "Trying to free free DMA%d\n", dmanr);
return;
}

diff -Nru linux-2.5.24/kernel/panic.c linux-2.5.24-g/kernel/panic.c
--- linux-2.5.24/kernel/panic.c Sun Jun 2 21:44:47 2002
+++ linux-2.5.24-g/kernel/panic.c Wed Jun 26 08:57:42 2002
@@ -88,7 +88,7 @@
extern int stop_a_enabled;
/* Make sure the user can actually press L1-A */
stop_a_enabled = 1;
- printk("Press L1-A to return to the boot prom\n");
+ printk(KERN_EMERG "Press L1-A to return to the boot prom\n");
}
#endif
#if defined(CONFIG_ARCH_S390)
diff -Nru linux-2.5.24/kernel/resource.c linux-2.5.24-g/kernel/resource.c
--- linux-2.5.24/kernel/resource.c Sun Jun 2 21:44:51 2002
+++ linux-2.5.24-g/kernel/resource.c Wed Jun 26 09:08:41 2002
@@ -290,7 +290,7 @@
}
p = &res->sibling;
}
- printk("Trying to free nonexistent resource <%08lx-%08lx>\n", start, end);
+ printk(KERN_WARNING "Trying to free nonexistent resource <%08lx-%08lx>\n", start, end);
}

/*
diff -Nru linux-2.5.24/kernel/signal.c linux-2.5.24-g/kernel/signal.c
--- linux-2.5.24/kernel/signal.c Wed Jun 26 09:03:40 2002
+++ linux-2.5.24-g/kernel/signal.c Wed Jun 26 09:00:35 2002
@@ -270,7 +270,7 @@
int sig = 0;

#if DEBUG_SIG
-printk("SIG dequeue (%s:%d): %d ", current->comm, current->pid,
+printk(KERN_DEBUG "SIG dequeue (%s:%d): %d ", current->comm, current->pid,
signal_pending(current));
#endif

@@ -294,7 +294,7 @@
recalc_sigpending();

#if DEBUG_SIG
-printk(" %d -> %d\n", signal_pending(current), sig);
+printk(KERN_DEBUG " %d -> %d\n", signal_pending(current), sig);
#endif

return sig;
@@ -538,7 +538,7 @@


#if DEBUG_SIG
-printk("SIG queue (%s:%d): %d ", t->comm, t->pid, sig);
+printk(KERN_DEBUG "SIG queue (%s:%d): %d ", t->comm, t->pid, sig);
#endif

ret = -EINVAL;
@@ -576,7 +576,7 @@
spin_unlock_irqrestore(&t->sigmask_lock, flags);
out_nolock:
#if DEBUG_SIG
-printk(" %d -> %d\n", signal_pending(t), ret);
+printk(KERN_DEBUG " %d -> %d\n", signal_pending(t), ret);
#endif

return ret;
diff -Nru linux-2.5.24/kernel/softirq.c linux-2.5.24-g/kernel/softirq.c
--- linux-2.5.24/kernel/softirq.c Wed Jun 26 09:03:40 2002
+++ linux-2.5.24-g/kernel/softirq.c Wed Jun 26 08:51:51 2002
@@ -259,7 +259,7 @@
void tasklet_kill(struct tasklet_struct *t)
{
if (in_interrupt())
- printk("Attempt to kill tasklet from interrupt\n");
+ printk(KERN_WARNING "Attempt to kill tasklet from interrupt\n");

while (test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) {
current->state = TASK_RUNNING;
@@ -407,7 +407,7 @@
continue;
if (kernel_thread(ksoftirqd, (void *) (long) cpu,
CLONE_FS | CLONE_FILES | CLONE_SIGNAL) < 0)
- printk("spawn_ksoftirqd() failed for cpu %d\n", cpu);
+ printk(KERN_WARNING "spawn_ksoftirqd() failed for cpu %d\n", cpu);
else
while (!ksoftirqd_task(cpu))
yield();
diff -Nru linux-2.5.24/kernel/suspend.c linux-2.5.24-g/kernel/suspend.c
--- linux-2.5.24/kernel/suspend.c Wed Jun 26 09:03:33 2002
+++ linux-2.5.24-g/kernel/suspend.c Wed Jun 26 08:48:18 2002
@@ -335,7 +335,7 @@
memcpy(cur->swh.magic.magic,"SWAP-SPACE",10);
else if (!memcmp("SUSP2R",cur->swh.magic.magic,6))
memcpy(cur->swh.magic.magic,"SWAPSPACE2",10);
- else printk("%sUnable to find suspended-data signature (%.10s - misspelled?\n",
+ else printk(KERN_WARNING "%sUnable to find suspended-data signature (%.10s - misspelled?\n",
name_resume, cur->swh.magic.magic);
} else {
if ((!memcmp("SWAP-SPACE",cur->swh.magic.magic,10)))
diff -Nru linux-2.5.24/kernel/timer.c linux-2.5.24-g/kernel/timer.c
--- linux-2.5.24/kernel/timer.c Wed Jun 26 09:03:40 2002
+++ linux-2.5.24-g/kernel/timer.c Wed Jun 26 08:46:09 2002
@@ -194,7 +194,7 @@
return;
bug:
spin_unlock_irqrestore(&timerlist_lock, flags);
- printk("bug: kernel timer added twice at %p.\n",
+ printk(KERN_ERR "bug: kernel timer added twice at %p.\n",
__builtin_return_address(0));
}
\
 
 \ /
  Last update: 2005-03-22 13:22    [W:0.040 / U:0.624 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site