Skip to contentSkip to conversation

x86: remove printk compiling warning

PATCH In review Shen Feng 4 participants 4 messages May 7, 2008 – May 8, 2008 x86

lore
Share & tools
lore

Shen Feng

author
#0 lore raw

PATCH 1/1 x86: remove printk compiling warning

Since size is unsigned long, the format string is changed from zd to lu.

---
 arch/x86/kernel/setup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kernel/setup.c +1 -1
index cc6f5eb..c0c68c1 100644
@@ -95,7 +95,7 @@ void __init setup_per_cpu_areas(void)
 
 	/* Copy section for each CPU (we discard the original) */
 	size = PERCPU_ENOUGH_ROOM;
-	printk(KERN_INFO "PERCPU: Allocating %zd bytes of per cpu data\n",
+	printk(KERN_INFO "PERCPU: Allocating %lu bytes of per cpu data\n",
 			  size);
 
 	for_each_possible_cpu(i) {
Signature · 1 line
1.5.4.1
#1 lore raw
CC Randy Dunlap <[email protected]>
Quoted 13 lines · Shen Feng

Since size is unsigned long, the format string is changed from zd to lu.

---
 arch/x86/kernel/setup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kernel/setup.c +0 -0
index cc6f5eb..c0c68c1 100644

arch/x86/kernel/setup.c void __init setup_per_cpu_areas(void) · line 101

Quoted 8 lines
arch/x86/kernel/setup.c +1 -1
@@ -95,7 +95,7 @@ void __init setup_per_cpu_areas(void)
 
 	/* Copy section for each CPU (we discard the original) */
 	size = PERCPU_ENOUGH_ROOM;
-	printk(KERN_INFO "PERCPU: Allocating %zd bytes of per cpu data\n",
+	printk(KERN_INFO "PERCPU: Allocating %lu bytes of per cpu data\n",
 			  size);
 
 	for_each_possible_cpu(i) {

Let me figure out this.

Commit 0fc5035fc66d26776bebd45c508a9bce3611f388 in linux-next changed 'size' from unsigned long to ssize_t, causing a compile warning, and then Randy posted a patch to fix it:

	http://marc.info/?l=linux-kernel&m=120958902125650&w=2

But this patch was wrongly merged into mainline, causing the compile warning you described here.

So we should revert Randy's patch and re-apply it to linux-next ?

#2 lore raw
Quoted 30 lines · On Wed, 07 May 2008 16:27:11 +0800 Li Zefan wrote:
CC Randy Dunlap <[email protected]>
Quoted 13 lines · Shen Feng

Since size is unsigned long, the format string is changed from zd to lu.

---
 arch/x86/kernel/setup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kernel/setup.c +0 -0
index cc6f5eb..c0c68c1 100644

arch/x86/kernel/setup.c void __init setup_per_cpu_areas(void) · line 101

Quoted 8 lines
arch/x86/kernel/setup.c +1 -1
@@ -95,7 +95,7 @@ void __init setup_per_cpu_areas(void)
 
 	/* Copy section for each CPU (we discard the original) */
 	size = PERCPU_ENOUGH_ROOM;
-	printk(KERN_INFO "PERCPU: Allocating %zd bytes of per cpu data\n",
+	printk(KERN_INFO "PERCPU: Allocating %lu bytes of per cpu data\n",
 			  size);
 
 	for_each_possible_cpu(i) {

Let me figure out this.

Commit 0fc5035fc66d26776bebd45c508a9bce3611f388 in linux-next changed 'size' from unsigned long to ssize_t, causing a compile warning, and then Randy posted a patch to fix it:

Quoted 6 lines
	http://marc.info/?l=linux-kernel&m=120958902125650&w=2

But this patch was wrongly merged into mainline, causing the compile warning you described here.

So we should revert Randy's patch and re-apply it to linux-next ?

Hi,
Thanks for the detective work. I hadn't looked into this yet.

Yes, my patch was sent for linux-next. How are we supposed to keep this straightened out?

---
~Randy

#3 lore raw
In reply to Li Zefan
Quoted 30 lines · Li Zefan
CC Randy Dunlap <[email protected]>
Quoted 13 lines · Shen Feng

Since size is unsigned long, the format string is changed from zd to lu.

---
 arch/x86/kernel/setup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kernel/setup.c +0 -0
index cc6f5eb..c0c68c1 100644

arch/x86/kernel/setup.c void __init setup_per_cpu_areas(void) · line 101

Quoted 8 lines
arch/x86/kernel/setup.c +1 -1
@@ -95,7 +95,7 @@ void __init setup_per_cpu_areas(void)
 
 	/* Copy section for each CPU (we discard the original) */
 	size = PERCPU_ENOUGH_ROOM;
-	printk(KERN_INFO "PERCPU: Allocating %zd bytes of per cpu data\n",
+	printk(KERN_INFO "PERCPU: Allocating %lu bytes of per cpu data\n",
 			  size);
 
 	for_each_possible_cpu(i) {

Let me figure out this.

Commit 0fc5035fc66d26776bebd45c508a9bce3611f388 in linux-next changed 'size' from unsigned long to ssize_t, causing a compile warning, and then Randy posted a patch to fix it:

Quoted 6 lines
	http://marc.info/?l=linux-kernel&m=120958902125650&w=2

But this patch was wrongly merged into mainline, causing the compile warning you described here.

So we should revert Randy's patch and re-apply it to linux-next ?

Yes, this came via Andrew and we did not notice that it was for linux-next.

Thanks,

tglx