Skip to contentSkip to conversation

2.5.31_drivers_char_lp.c

TRIVIAL Rusty Trivial Russell 1 participant 1 message Sep 10, 2002 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

[ As per 2.4.19 AC kernel tree, makes sense --RR ]
From: Lucas Correia Villa Real <[email protected]>

Hi,

This is a trivial patch already applied in the -ac tree for the 2.4.19 kernel. Patch for lp.c avoid +/- operations with 0 and explicit some debug information as KERN_INFO or KERN_ERR.

Comments?

Lucas

drivers/char/lp.c renamed from drivers/char/lp.c.orig +4 -4
@@ -335,7 +335,7 @@
 	do {
 		/* Write the data. */
 		written = parport_write (port, kbuf, copy_size);
-		if (written >= 0) {
+		if (written > 0) {
 			copy_size -= written;
 			count -= written;
 			buf  += written;
@@ -840,7 +840,7 @@
 		    port->probe_info[0].class != PARPORT_CLASS_PRINTER)
 			return;
 		if (lp_count == LP_NO) {
-			printk("lp: ignoring parallel port (max. %d)\n",LP_NO);
+			printk(KERN_INFO "lp: ignoring parallel port (max. %d)\n",LP_NO);
 			return;
 		}
 		if (!lp_register(lp_count, port))
@@ -904,14 +904,14 @@
 	}
 
 	if (register_chrdev (LP_MAJOR, "lp", &lp_fops)) {
-		printk ("lp: unable to get major %d\n", LP_MAJOR);
+		printk (KERN_ERR "lp: unable to get major %d\n", LP_MAJOR);
 		return -EIO;
 	}
 
 	devfs_handle = devfs_mk_dir (NULL, "printers", NULL);
 
 	if (parport_register_driver (&lp_driver)) {
-		printk ("lp: unable to register with parport\n");
+		printk (KERN_ERR "lp: unable to register with parport\n");
 		return -EIO;
 	}
 
Signature · 2 lines
  Don't blame me: the Monkey is driving
  File: Lucas Correia Villa Real <[email protected]>: [PATCH] 2.5.31_drivers_char_lp.c