Revert "memory-hotplug: add 0x prefix to HEX block_size_bytes"
Subsystems (2)
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.
---
drivers/base/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/memory.c +1 -1
@@ -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);
Quoted 8 lines · Heiko Carstens
From: Heiko Carstens <[email protected]>
Revert
ba168fc37dea145deeb8fa9e7e71c748d2e00d74"memory-hotplug: add 0x prefix to HEXblock_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.
Quoted 9 lines · Américo Wang
Quoted 7 lines · Heiko Carstens
From: Heiko Carstens <[email protected]>
Revert
ba168fc37dea145deeb8fa9e7e71c748d2e00d74"memory-hotplug: add 0x prefix to HEXblock_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.
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 HEXblock_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
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 HEXblock_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 (;_;)
Quoted 10 lines · Am?rico Wang
Quoted 8 lines · Heiko Carstens
From: Heiko Carstens <[email protected]>
Revert
ba168fc37dea145deeb8fa9e7e71c748d2e00d74"memory-hotplug: add 0x prefix to HEXblock_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