iSeries cmdline wraps

Olaf Hering olh at suse.de
Tue Sep 23 03:38:26 EST 2003


The cmdline should be only one line. I'm not sure about the proc
interface, is this part of the patch ok?


diff -p -purNX /suse/olh/kernel/kernel_exclude.txt /dev/shm/usr/src/linux-2.4.21-73/arch/ppc64/kernel/iSeries_setup.c linux-2.4.21-73/arch/ppc64/kernel/iSeries_setup.c
--- /dev/shm/usr/src/linux-2.4.21-73/arch/ppc64/kernel/iSeries_setup.c	2003-09-22 11:21:12.000000000 +0200
+++ linux-2.4.21-73/arch/ppc64/kernel/iSeries_setup.c	2003-09-22 19:09:50.000000000 +0200
@@ -378,15 +378,14 @@ iSeries_init(unsigned long r3, unsigned
 				     256,
 				     HvLpDma_Direction_RemoteToLocal );

-		p = q = cmd_line + 255;
-		while( p > cmd_line ) {
-			if ((*p == 0) || (*p == ' ') || (*p == '\n'))
-				--p;
-			else
+		p = cmd_line;
+		q = cmd_line + 255;
+		while( p < q ) {
+			if (!*p || *p == '\n')
 				break;
+			++p;
 		}
-		if ( p < q )
-			*(p+1) = 0;
+		*p = 0;
 	}

 	iSeries_proc_early_init();
diff -p -purNX /suse/olh/kernel/kernel_exclude.txt /dev/shm/usr/src/linux-2.4.21-73/arch/ppc64/kernel/mf_proc.c linux-2.4.21-73/arch/ppc64/kernel/mf_proc.c
--- /dev/shm/usr/src/linux-2.4.21-73/arch/ppc64/kernel/mf_proc.c	2003-09-22 11:21:12.000000000 +0200
+++ linux-2.4.21-73/arch/ppc64/kernel/mf_proc.c	2003-09-22 19:13:38.000000000 +0200
@@ -151,30 +151,25 @@ int proc_mf_dump_cmdline
 	int		len = count;
 	char *p;

+	/* it seems non NULL is the second call == second (unwanted) line */
+	if ( off ) {
+		*eof = 1;
+		return 0;
+	}
+
 	len = mf_getCmdLine(page, &len, (u64)data);

-	p = page + len - 1;
-	while ( p > page ) {
-		if ( (*p == 0) || (*p == ' ') )
-			--p;
-		else
+	p = page + off;
+	while ( len < ( count - 1 ) ) {
+		if ( ! *p || *p == '\n' )
 			break;
-	}
-	if ( *p != '\n' ) {
 		++p;
-		*p = '\n';
+		++len;
 	}
+	*p = '\n';
 	++p;
 	*p = 0;
-	len = p - page;
-
-	len -= off;
-	if (len < count) {
-		*eof = 1;
-		if (len <= 0)
-			return 0;
-	} else
-		len = count;
+	len = p - (page + off);
 	*start = page + off;
 	return len;
 }
--
USB is for mice, FireWire is for men!

sUse lINUX ag, nÜRNBERG

** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/





More information about the Linuxppc64-dev mailing list