[Linux-parport] [PATCH] fix compilation with DEBUG_PARPORT

Marko Kohtala marko.kohtala at luukku.com
Mon Jan 10 13:38:24 EST 2005


The code did not compile with DEBUG_PARPORT defined. I also added a missing 
const to have the pointers in the array in .rodata segment.

This I could have propably sent directly without review.

Who should I send these to or will someone pick these up from this mailing 
list and send to Linus?

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2005/01/09 23:43:34+02:00 kohtala at kohtala.home.org
#   Fix parport driver to compile with debugging defined.
#
# include/linux/parport_pc.h
#   2005/01/09 23:43:20+02:00 kohtala at kohtala.home.org +2 -2
#   Fix to compile when debugging.
#
diff -Nru a/include/linux/parport_pc.h b/include/linux/parport_pc.h
--- a/include/linux/parport_pc.h	2005-01-10 07:57:30 +02:00
+++ b/include/linux/parport_pc.h	2005-01-10 07:57:30 +02:00
@@ -85,8 +85,8 @@
  	unsigned char ecr = inb (ECONTROL (p));
  	unsigned char dcr = inb (CONTROL (p));
  	unsigned char dsr = inb (STATUS (p));
-	static char *ecr_modes[] = {"SPP", "PS2", "PPFIFO", "ECP", "xXx", "yYy", 
"TST", "CFG"};
-	const struct parport_pc_private *priv = (parport_pc_private 
*)p->physport->private_data;
+	static char *const ecr_modes[] = {"SPP", "PS2", "PPFIFO", "ECP", "xXx", 
"yYy", "TST", "CFG"};
+	const struct parport_pc_private *priv = (struct parport_pc_private 
*)p->physport->private_data;
  	int i;

  	printk (KERN_DEBUG "*** parport state (%s): ecr=[%s", str, ecr_modes[(ecr & 
0xe0) >> 5]);



More information about the Linux-parport mailing list