Skip to contentSkip to conversation

Revert "memory-hotplug: add 0x prefix to HEX block_size_bytes"

PATCH In review Heiko Carstens 5 participants 6 messages Apr 8, 2010 – Apr 12, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "memory-hotplug: add 0x prefix to HEX block_size_bytes"

From: Heiko Carstens <[email protected]>

Revert ba168fc37dea145deeb8fa9e7e71c748d2e00d74 "memory-hotplug: add 0x prefix to HEX block_size_bytes" since it changes the user space visible sysfs interface /sys/devices/system/memory/block_size_bytes.
The change breaks existing user space applications which rely on the fact that the output does not contain the "0x" prefix.

Cc Wu Fengguang <[email protected]>
Cc Andi Kleen <[email protected]>
Cc Greg KH <[email protected]>
Cc Gerald Schaefer <[email protected]>

---

 drivers/base/memory.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/memory.c +1 -1
index 4f4aa58..933442f 100644
@@ -313,7 +313,7 @@ static ssize_t
 print_block_size(struct sysdev_class *class, struct sysdev_class_attribute *attr,
 		 char *buf)
 {
-	return sprintf(buf, "%#lx\n", (unsigned long)PAGES_PER_SECTION * PAGE_SIZE);
+	return sprintf(buf, "%lx\n", (unsigned long)PAGES_PER_SECTION * PAGE_SIZE);
 }
 
 static SYSDEV_CLASS_ATTR(block_size_bytes, 0444, print_block_size, NULL);
#1 lore raw
Quoted 8 lines · Heiko Carstens

From: Heiko Carstens <[email protected]>

Revert ba168fc37dea145deeb8fa9e7e71c748d2e00d74 "memory-hotplug: add 0x prefix to HEX block_size_bytes" since it changes the user space visible sysfs interface /sys/devices/system/memory/block_size_bytes.
The change breaks existing user space applications which rely on the fact that the output does not contain the "0x" prefix.

Odd.

Which application relies on this? Isn't the application which should be fixed?? It should use something like strtoul() which doesn't rely on '0x' prefix.

Thanks.

#2 lore raw
Quoted 9 lines · Américo Wang
Quoted 7 lines · Heiko Carstens

From: Heiko Carstens <[email protected]>

Revert ba168fc37dea145deeb8fa9e7e71c748d2e00d74 "memory-hotplug: add 0x prefix to HEX block_size_bytes" since it changes the user space visible sysfs interface /sys/devices/system/memory/block_size_bytes.
The change breaks existing user space applications which rely on the fact that the output does not contain the "0x" prefix.

Quoted 5 lines

Odd.

Which application relies on this? Isn't the application which should be fixed?? It should use something like strtoul() which doesn't rely on '0x' prefix.

Ok, consider it the other way round: your application is doing strtoul() with a base of 0 (since you rely on the 0x prefix) and for no good reason it doesn't work on older kernels.
I really can't see a reason for adding additional pitfalls by _changing_ a long existing user space interface.

#3 lore raw

Hi Heiko,

Quoted 16 lines · Heiko Carstens
Quoted 9 lines · Américo Wang
Quoted 7 lines · Heiko Carstens

From: Heiko Carstens <[email protected]>

Revert ba168fc37dea145deeb8fa9e7e71c748d2e00d74 "memory-hotplug: add 0x prefix to HEX block_size_bytes" since it changes the user space visible sysfs interface /sys/devices/system/memory/block_size_bytes.
The change breaks existing user space applications which rely on the fact that the output does not contain the "0x" prefix.

Quoted 5 lines

Odd.

Which application relies on this? Isn't the application which should be fixed?? It should use something like strtoul() which doesn't rely on '0x' prefix.

Quoted 5 lines

Ok, consider it the other way round: your application is doing strtoul() with a base of 0 (since you rely on the 0x prefix) and for no good reason it doesn't work on older kernels.
I really can't see a reason for adding additional pitfalls by _changing_ a long existing user space interface.

Ack to revert it. Sorry for killing your time!

Thanks,
Fengguang

#4 lore raw
Quoted 19 lines

Hi Heiko,

Quoted 16 lines · Heiko Carstens
Quoted 14 lines · Américo Wang
Quoted 7 lines · Heiko Carstens

From: Heiko Carstens <[email protected]>

Revert ba168fc37dea145deeb8fa9e7e71c748d2e00d74 "memory-hotplug: add 0x prefix to HEX block_size_bytes" since it changes the user space visible sysfs interface /sys/devices/system/memory/block_size_bytes.
The change breaks existing user space applications which rely on the fact that the output does not contain the "0x" prefix.

Odd.

Which application relies on this? Isn't the application which should be fixed?? It should use something like strtoul() which doesn't rely on '0x' prefix.

Quoted 7 lines
Quoted 5 lines

Ok, consider it the other way round: your application is doing strtoul() with a base of 0 (since you rely on the 0x prefix) and for no good reason it doesn't work on older kernels.
I really can't see a reason for adding additional pitfalls by _changing_ a long existing user space interface.

Ack to revert it. Sorry for killing your time!

I agree to revert, too. I guess nobody see my NAK for original mail (;_;)

#5 lore raw
In reply to Américo Wang
Quoted 10 lines · Am?rico Wang
Quoted 8 lines · Heiko Carstens

From: Heiko Carstens <[email protected]>

Revert ba168fc37dea145deeb8fa9e7e71c748d2e00d74 "memory-hotplug: add 0x prefix to HEX block_size_bytes" since it changes the user space visible sysfs interface /sys/devices/system/memory/block_size_bytes.
The change breaks existing user space applications which rely on the fact that the output does not contain the "0x" prefix.

Quoted 5 lines

Odd.

Which application relies on this? Isn't the application which should be fixed?? It should use something like strtoul() which doesn't rely on '0x' prefix.

'no regressions'?!

You should not randomly change kernel api, then blame it on applications.
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html