From: Cory Watson <gphat@cafes.net>
To: linux-kernel@vger.kernel.org
Cc: torvalds@transmeta.com
Subject: [PATCH] Add KERN_* constants to printk()s
Date: Wed, 26 Jun 2002 20:19:06 -0500 [thread overview]
Message-ID: <auto-000059811429@dc-mx08.cluster1.charter.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 4785 bytes --]
>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));
}
[-- Attachment #2: printk-KERN-constants.patch --]
[-- Type: text/x-diff, Size: 4409 bytes --]
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));
}
next reply other threads:[~2002-06-27 1:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-06-27 1:19 Cory Watson [this message]
2002-06-27 1:25 ` [PATCH] Add KERN_* constants to printk()s Cory Watson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=auto-000059811429@dc-mx08.cluster1.charter.net \
--to=gphat@cafes.net \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).