All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Revert "memory-hotplug: add 0x prefix to HEX block_size_bytes"
@ 2010-04-08 15:10 Heiko Carstens
  2010-04-08 15:41 ` Américo Wang
  0 siblings, 1 reply; 6+ messages in thread
From: Heiko Carstens @ 2010-04-08 15:10 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton
  Cc: linux-kernel, Wu Fengguang, Andi Kleen, Greg KH, Gerald Schaefer, stable

From: Heiko Carstens <heiko.carstens@de.ibm.com>

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 <fengguang.wu@intel.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Greg KH <greg@kroah.com>
Cc: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Cc: stable@kernel.org
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
---

 drivers/base/memory.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index 4f4aa58..933442f 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -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);

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Revert "memory-hotplug: add 0x prefix to HEX block_size_bytes"
  2010-04-08 15:10 [PATCH] Revert "memory-hotplug: add 0x prefix to HEX block_size_bytes" Heiko Carstens
@ 2010-04-08 15:41 ` Américo Wang
  2010-04-08 21:29   ` Heiko Carstens
  2010-04-12  5:41   ` Pavel Machek
  0 siblings, 2 replies; 6+ messages in thread
From: Américo Wang @ 2010-04-08 15:41 UTC (permalink / raw)
  To: Heiko Carstens
  Cc: Linus Torvalds, Andrew Morton, linux-kernel, Wu Fengguang,
	Andi Kleen, Greg KH, Gerald Schaefer, stable

On Thu, Apr 08, 2010 at 05:10:06PM +0200, Heiko Carstens wrote:
>From: Heiko Carstens <heiko.carstens@de.ibm.com>
>
>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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Revert "memory-hotplug: add 0x prefix to HEX block_size_bytes"
  2010-04-08 15:41 ` Américo Wang
@ 2010-04-08 21:29   ` Heiko Carstens
  2010-04-09  1:42     ` Wu Fengguang
  2010-04-12  5:41   ` Pavel Machek
  1 sibling, 1 reply; 6+ messages in thread
From: Heiko Carstens @ 2010-04-08 21:29 UTC (permalink / raw)
  To: Américo Wang
  Cc: Linus Torvalds, Andrew Morton, linux-kernel, Wu Fengguang,
	Andi Kleen, Greg KH, Gerald Schaefer, stable

On Thu, Apr 08, 2010 at 11:41:24PM +0800, Américo Wang wrote:
> On Thu, Apr 08, 2010 at 05:10:06PM +0200, Heiko Carstens wrote:
> >From: Heiko Carstens <heiko.carstens@de.ibm.com>
> >
> >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.

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Revert "memory-hotplug: add 0x prefix to HEX block_size_bytes"
  2010-04-08 21:29   ` Heiko Carstens
@ 2010-04-09  1:42     ` Wu Fengguang
  2010-04-09  8:31       ` KOSAKI Motohiro
  0 siblings, 1 reply; 6+ messages in thread
From: Wu Fengguang @ 2010-04-09  1:42 UTC (permalink / raw)
  To: Heiko Carstens
  Cc: Américo Wang, Linus Torvalds, Andrew Morton, linux-kernel,
	Andi Kleen, Greg KH, Gerald Schaefer, stable

Hi Heiko,

On Fri, Apr 09, 2010 at 05:29:18AM +0800, Heiko Carstens wrote:
> On Thu, Apr 08, 2010 at 11:41:24PM +0800, Américo Wang wrote:
> > On Thu, Apr 08, 2010 at 05:10:06PM +0200, Heiko Carstens wrote:
> > >From: Heiko Carstens <heiko.carstens@de.ibm.com>
> > >
> > >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.
> 
> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Revert "memory-hotplug: add 0x prefix to HEX block_size_bytes"
  2010-04-09  1:42     ` Wu Fengguang
@ 2010-04-09  8:31       ` KOSAKI Motohiro
  0 siblings, 0 replies; 6+ messages in thread
From: KOSAKI Motohiro @ 2010-04-09  8:31 UTC (permalink / raw)
  To: Wu Fengguang
  Cc: kosaki.motohiro, Heiko Carstens, Americo Wang, Linus Torvalds,
	Andrew Morton, linux-kernel, Andi Kleen, Greg KH,
	Gerald Schaefer, stable

> Hi Heiko,
> 
> On Fri, Apr 09, 2010 at 05:29:18AM +0800, Heiko Carstens wrote:
> > On Thu, Apr 08, 2010 at 11:41:24PM +0800, Américo Wang wrote:
> > > On Thu, Apr 08, 2010 at 05:10:06PM +0200, Heiko Carstens wrote:
> > > >From: Heiko Carstens <heiko.carstens@de.ibm.com>
> > > >
> > > >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.
> > 
> > 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 (;_;)




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Revert "memory-hotplug: add 0x prefix to HEX block_size_bytes"
  2010-04-08 15:41 ` Américo Wang
  2010-04-08 21:29   ` Heiko Carstens
@ 2010-04-12  5:41   ` Pavel Machek
  1 sibling, 0 replies; 6+ messages in thread
From: Pavel Machek @ 2010-04-12  5:41 UTC (permalink / raw)
  To: Am?rico Wang
  Cc: Heiko Carstens, Linus Torvalds, Andrew Morton, linux-kernel,
	Wu Fengguang, Andi Kleen, Greg KH, Gerald Schaefer, stable

On Thu 2010-04-08 23:41:24, Am?rico Wang wrote:
> On Thu, Apr 08, 2010 at 05:10:06PM +0200, Heiko Carstens wrote:
> >From: Heiko Carstens <heiko.carstens@de.ibm.com>
> >
> >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.

'no regressions'?!

You should not randomly change kernel api, then blame it on applications.
								Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-04-12  5:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-08 15:10 [PATCH] Revert "memory-hotplug: add 0x prefix to HEX block_size_bytes" Heiko Carstens
2010-04-08 15:41 ` Américo Wang
2010-04-08 21:29   ` Heiko Carstens
2010-04-09  1:42     ` Wu Fengguang
2010-04-09  8:31       ` KOSAKI Motohiro
2010-04-12  5:41   ` Pavel Machek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.