Re: PATCH to fix bug: "serial" does not show up in /proc/interrupts

From: Thomas Hood (jdthoodREMOVETHIS@yahoo.co.uk)
Date: Wed Aug 01 2001 - 22:46:31 EST


Sorry ... here is the same patch but with the diff done
from the parent of the code hierarchy.

---------------------------------------------------
--- linux-2.4.7-ac3/drivers/char/serial.c_ORIG Wed Aug 1 23:02:09 2001
+++ linux-2.4.7-ac3/drivers/char/serial.c Wed Aug 1 23:11:01 2001
@@ -4852,10 +4852,13 @@

 MODULE_DEVICE_TABLE(pci, serial_pci_tbl);

+/* serial_pci_driver_name[] gets truncated to "" if the pci probe fails */
+static char serial_pci_driver_name[] = "serial";
+
 static struct pci_driver serial_pci_driver = {
- name: "serial",
+ name: serial_pci_driver_name,
        probe: serial_init_one,
- remove: serial_remove_one,
+ remove: serial_remove_one,
        id_table: serial_pci_tbl,
 };
---------------------------------------------------

> Here is a patch to fix the serial driver so that its name
> appears in /proc/interrupts. The bug was caused by code
> that was overwriting the string literal "serial" with "".
> gcc merges all the "serial" strings together into one, so
> the "serial" sent to irq_request() was being ""ed as a
> side-effect.
>
> Here is the patch to 2.4.7-ac3 both inline and attached.
> // Thomas Hood <jdthood_AT_yahoo.co.uk>

--- linux-2.4.7-ac3/drivers/char/serial.c_ORIG Wed Aug 1 23:02:09 2001
+++ linux-2.4.7-ac3/drivers/char/serial.c Wed Aug 1 23:11:01 2001
@@ -4852,10 +4852,13 @@
 
 MODULE_DEVICE_TABLE(pci, serial_pci_tbl);
 
+/* serial_pci_driver_name[] gets truncated to "" if the pci probe fails */
+static char serial_pci_driver_name[] = "serial";
+
 static struct pci_driver serial_pci_driver = {
- name: "serial",
+ name: serial_pci_driver_name,
        probe: serial_init_one,
- remove: serial_remove_one,
+ remove: serial_remove_one,
        id_table: serial_pci_tbl,
 };
 

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Aug 07 2001 - 21:00:16 EST