Skip to contentSkip to conversation

UML - Fix fencepost errors in printks

PATCH New Jeff Dike 1 participant 1 message Sep 23, 2004 User-mode Linux (UML)

lore
Share & tools
lore

Jeff Dike

author
#0 lore raw

PATCH 1/1 UML - Fix fencepost errors in printks

Simple corrections to some error messages, which list wrong limits for UBD devices and such.

arch/um/drivers/line.c +1 -1
Index: linux-2.6.9-rc2-mm1-orig/arch/um/drivers/line.c
===================================================================
@@ -332,7 +332,7 @@
 	init++;
 	if((n >= 0) && (n >= num)){
 		printk("line_setup - %d out of range ((0 ... %d) allowed)\n",
-		       n, num);
+		       n, num - 1);
 		return(0);
 	}
 	else if(n >= 0){
arch/um/drivers/ubd_kern.c +1 -1
Index: linux-2.6.9-rc2-mm1-orig/arch/um/drivers/ubd_kern.c
===================================================================
@@ -299,7 +299,7 @@
 	}
 	if(n >= MAX_DEV){
 		printk(KERN_ERR "ubd_setup : index %d out of range "
-		       "(%d devices)\n", n, MAX_DEV);
+		       "(%d devices, from 0 to %d)\n", n, MAX_DEV, MAX_DEV - 1);
 		return(1);
 	}
 

More recent patches modify files in message-off-by-one.