lkml.org 
[lkml]   [2007]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] init: Fix printk format strings
From
Date
This makes sure printk format strings are string literals containing no
more than a single line.


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/calibrate.c b/init/calibrate.c
index 40ff3b4..2a35718 100644
--- a/init/calibrate.c
+++ b/init/calibrate.c
@@ -98,7 +98,9 @@ static unsigned long __devinit calibrate_delay_direct(void)
return (good_tsc_sum/good_tsc_count);

printk(KERN_WARNING "calibrate_delay_direct() failed to get a good "
- "estimate for loops_per_jiffy.\nProbably due to long platform interrupts. Consider using \"lpj=\" boot option.\n");
+ "estimate for loops_per_jiffy.\n");
+ printk(KERN_WARNING "Probably due to long platform interrupts. "
+ "Consider using \"lpj=\" boot option.\n");
return 0;
}
#else
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");
}
}

diff --git a/init/main.c b/init/main.c
index 9def935..5491bba 100644
--- a/init/main.c
+++ b/init/main.c
@@ -537,7 +537,7 @@ asmlinkage void __init start_kernel(void)
boot_cpu_init();
page_address_init();
printk(KERN_NOTICE);
- printk(linux_banner);
+ printk("%s", linux_banner);
setup_arch(&command_line);
setup_command_line(command_line);
unwind_setup();
--
1.5.2.4


-
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/

\
 
 \ /
  Last update: 2007-10-11 08:19    [W:0.060 / U:21.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site