All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix modalias content in sysfs for macio devices
@ 2007-04-02 12:33 Olaf Hering
  0 siblings, 0 replies; only message in thread
From: Olaf Hering @ 2007-04-02 12:33 UTC (permalink / raw)
  To: Paul Mackeras, linuxppc-dev


Currently the buf pointer is advanced too far during each iteration.
Also terminate the string with a newline.

Signed-off-by: Olaf Hering <olaf@aepfle.de>

---
 drivers/macintosh/macio_sysfs.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Index: b/drivers/macintosh/macio_sysfs.c
===================================================================
--- a/drivers/macintosh/macio_sysfs.c
+++ b/drivers/macintosh/macio_sysfs.c
@@ -53,12 +53,14 @@ static ssize_t modalias_show (struct dev
 	buf += length;
 	while (cplen > 0) {
 		int l;
-		length += sprintf (buf, "C%s", compat);
-		buf += length;
+		l = sprintf (buf, "C%s", compat);
+		length += l;
+		buf += l;
 		l = strlen (compat) + 1;
 		compat += l;
 		cplen -= l;
 	}
+	length += sprintf(buf, "\n");
 
 	return length;
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-04-02 12:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-02 12:33 [PATCH] fix modalias content in sysfs for macio devices Olaf Hering

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.