[PATCH] fix missing newlines in /proc

Roman Kagan rkagan at mail.ru
Mon Feb 7 07:52:19 EST 2005


  Hi Duncan,

This patch fixes the missing newlines in usbatm_atm_proc_read (leftover
from the times when USB device status was appended there).

Cheers,
  Roman.

--- usbatm.c~	2005-02-07 14:16:51.223668440 +0300
+++ usbatm.c	2005-02-07 15:45:59.617588976 +0300
@@ -824,22 +824,16 @@ static int usbatm_atm_proc_read(struct a
 			       atomic_read(&atm_dev->stats.aal5.rx_err),
 			       atomic_read(&atm_dev->stats.aal5.rx_drop));
 
-	if (!left--) {
+	if (!left--)
 		switch (atm_dev->signal) {
 		case ATM_PHY_SIG_FOUND:
-			sprintf(page, "Line up");
-			break;
+			return sprintf(page, "Line up\n");
 		case ATM_PHY_SIG_LOST:
-			sprintf(page, "Line down");
-			break;
+			return sprintf(page, "Line down\n");
 		default:
-			sprintf(page, "Line state unknown");
-			break;
+			return sprintf(page, "Line state unknown\n");
 		}
 
-		return strlen(page);
-	}
-
 	return 0;
 }
 



More information about the Usbatm mailing list