Skip to contentSkip to conversation

Use a format string for linux_banner

PATCH In review Alex Riesen 3 participants 5 messages Feb 25, 2009 – May 24, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Use a format string for linux_banner

There is no format specifiers left in the linux_banner, and gcc complains seeing the printk.

---
 init/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

From e7b44c4c1d7d0f182f0100b0dc31c20fb3dfe8ea Mon Sep 17 00:00:00 2001
From: Alex Riesen <[email protected]>
Date: Wed, 25 Feb 2009 09:53:15 +0100
Subject: [PATCH] Use a format string for linux_banner

There is no format specifiers left in the linux_banner, and gcc complains seeing the printk.

---
 init/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
init/main.c +1 -1
index 8442094..78fc0d8 100644
@@ -554,7 +554,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);
 	mm_init_owner(&init_mm, &init_task);
 	setup_command_line(command_line);
Signature · 1 line
1.6.2.rc1.46.gb3ec84f
#1 lore raw
Quoted 7 lines · Alex Riesen

There is no format specifiers left in the linux_banner, and gcc complains seeing the printk.

---
 init/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

[+ application/octet-stream attachment, base64 encoded]

Please send patches as inline text or at least as plaintext attachment in ascii encoding. linux/Documentation/email-clients.txt has help.

init/main.c asmlinkage void __init start_kernel(void) · line 560

Quoted 11 lines
init/main.c +1 -1
@@ -554,7 +554,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);
 	mm_init_owner(&init_mm, &init_task);
 	setup_command_line(command_line);

Better than that:

- printk(KERN_NOTICE);
- printk(linux_banner);
+ printk(KERN_NOTICE "%s", linux_banner);

Signature · 3 lines
Stefan Richter
-=====-==--= --=- ===--
http://arcgraph.de/sr/
#2 lore raw

PATCH 1/1 Use a format string for linux_banner

---

Stefan Richter, Sat, Feb 28, 2009 13:01:07 +0100:

Quoted 4 lines

[+ application/octet-stream attachment, base64 encoded]

Please send patches as inline text or at least as plaintext attachment in ascii encoding. linux/Documentation/email-clients.txt has help.

Couldn't. Had to either choose the corporate firewal and gmail, or the Exchange-thing. Both will corrupt patches, unless send as attachment. Decided not to expose the corporate mail address.
Anyway, resending from home now (back then couldn't send from home
either: was changing providers and had no usable link for a week. Tell about coincidences...)

Review

Quoted 9 lines

Review

Quoted 2 lines
(quoted diff) +1 -1
-	printk(linux_banner);
+	printk("%s", linux_banner);

Better than that:

(quoted diff) +1 -2
-	printk(KERN_NOTICE);
-	printk(linux_banner);
+	printk(KERN_NOTICE "%s", linux_banner);

Missed the line before. Poor blind me.

 init/main.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
init/main.c +1 -2
index 8442094..77fc028 100644
@@ -553,8 +553,7 @@ asmlinkage void __init start_kernel(void)
 	tick_init();
 	boot_cpu_init();
 	page_address_init();
-	printk(KERN_NOTICE);
-	printk(linux_banner);
+	printk(KERN_NOTICE "%s", linux_banner);
 	setup_arch(&command_line);
 	mm_init_owner(&init_mm, &init_task);
 	setup_command_line(command_line);
Signature · 1 line
1.6.2.rc2.31.gce6e3
#3 lore raw
Quoted 7 lines · Alex Riesen
Quoted 3 lines

Please send patches as inline text or at least as plaintext attachment in ascii encoding. linux/Documentation/email-clients.txt has help.

Couldn't. Had to either choose the corporate firewal and gmail, or the Exchange-thing. Both will corrupt patches, unless send as attachment. Decided not to expose the corporate mail address.

Well, I _can_ tell you that I just ignore patches that I can't see directly in my email reader. Others may pick them up, but for me it's an issue of "ok, I can't easily even see the patch, and the person didn't bother to do it right - it's not worth my time".

What people _can_ do is to send it both as a crazy attachment _and_ as plaintext. If they plaintext gets corrupted, the attachment still works, and the plaintext is at least somethign I can see and thus in my mail reader decide whether it's worth my time to save the attachment and look at it outside the mail reader.

Linus

#4 lore raw

PATCH 1/1 Use a format for linux_banner

There is no format specifiers left in the linux_banner, and gcc-4.3 complains seeing the printk.

---

Linus Torvalds, Sat, Feb 28, 2009 18:27:07 +0100:

Quoted 5 lines

What people _can_ do is to send it both as a crazy attachment _and_ as plaintext. If they plaintext gets corrupted, the attachment still works, and the plaintext is at least somethign I can see and thus in my mail reader decide whether it's worth my time to save the attachment and look at it outside the mail reader.

Resent properly. Sorry, took me a while.

 init/main.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
init/main.c +1 -2
index 3bbf93b..d721dad 100644
@@ -566,8 +566,7 @@ asmlinkage void __init start_kernel(void)
 	tick_init();
 	boot_cpu_init();
 	page_address_init();
-	printk(KERN_NOTICE);
-	printk(linux_banner);
+	printk(KERN_NOTICE "%s", linux_banner);
 	setup_arch(&command_line);
 	mm_init_owner(&init_mm, &init_task);
 	setup_command_line(command_line);
Signature · 1 line
1.6.3.1.171.ge2f07