login
Login
/
Register
Search
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2007
»
October
»
11
Re: [PATCH] init: Fix printk format strings
view
thread
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From:
Randy Dunlap <randy.dunlap@...>
To: Vegard Nossum <vegard.nossum@...>
Cc: <trivial@...>, <linux-kernel@...>
Subject:
Re: [PATCH] init: Fix printk format strings
Date: Thursday, October 11, 2007 - 12:01 pm
On Thu, 11 Oct 2007 17:55:16 +0200 Vegard Nossum wrote:
quoted text
> On 10/11/07, Randy Dunlap <randy.dunlap@oracle.com> wrote: > > On Thu, 11 Oct 2007 08:17:02 +0200 Vegard Nossum wrote: > > > > > This makes sure printk format strings are string literals containing no > > > more than a single line. > > > > Each patch needs justification (unless it is blatantly obvious). > > > > > > > Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com> > > > --- > > > init/calibrate.c | 4 +++- > > > init/do_mounts_initrd.c | 5 ++++- > > > init/main.c | 2 +- > > > 3 files changed, 8 insertions(+), 3 deletions(-) > > > > > > diff --git a/init/do_mounts_initrd.c b/init/do_mounts_initrd.c > > > index fd4fc12..ad6174c 100644 > > > --- a/init/do_mounts_initrd.c > > > +++ b/init/do_mounts_initrd.c > > > @@ -98,7 +98,10 @@ static void __init handle_initrd(void) > > > error = sys_ioctl(fd, BLKFLSBUF, 0); > > > sys_close(fd); > > > } > > > - printk(!error ? "okay\n" : "failed\n"); > > > + if(error) > > > + printk("failed\n"); > > > + else > > > + printk("okay\n"); > > > } > > > } > > > > Why this one? > > and if it must change, use: > > if (error) > > but I see little need for the change. > > Oops about the space. And it's to make the format string a constant > literal. If it isn't, you are going to run into trouble with options > to remove printks at compile-time based on log-level token. I realize > it's not really an issue at this point in time, but I assume that it > will eventually make its way into the kernel in some way or another.
so would this be OK? printk("%s\n", error ? "failed" : "okay"); --- ~Randy -
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH] init: Fix printk format strings
, Vegard Nossum
, (Thu Oct 11, 2:17 am)
Re: [PATCH] init: Fix printk format strings
, Johannes Weiner
, (Thu Oct 11, 1:21 pm)
Re: [PATCH] init: Fix printk format strings
, Vegard Nossum
, (Thu Oct 11, 3:15 pm)
Re: [PATCH] init: Fix printk format strings
, Randy Dunlap
, (Thu Oct 11, 11:40 am)
Re: [PATCH] init: Fix printk format strings
, Vegard Nossum
, (Thu Oct 11, 11:55 am)
Re: [PATCH] init: Fix printk format strings
, Randy Dunlap
, (Thu Oct 11, 12:01 pm)
Re: [PATCH] init: Fix printk format strings
, Vegard Nossum
, (Thu Oct 11, 12:09 pm)
Re: [PATCH] init: Fix printk format strings
, Randy Dunlap
, (Thu Oct 11, 12:20 pm)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Greg Kroah-Hartman
[PATCH 008/196] Chinese: add translation of volatile-considered-harmful.txt
Tarkan Erimer
Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3
Greg KH
Re: [Patch v2] Make PCI extended config space (MMCONFIG) a driver opt-in
Andrew Morton
-mm merge plans for 2.6.23
git
:
linux-netdev
:
Gerrit Renker
[PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side)
Herbert Xu
Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
David Miller
[GIT]: Networking
Rémi Denis-Courmont
[PATCH 01/14] Phonet global definitions
openbsd-misc
:
Colocation donated by:
Who's online
There are currently
3 users
and
684 guests
online.
Online users
Kedar Sovani
Jeremy
emeka_micro
Syndicate