Re: xd.c broken

Steven N. Hirsch (shirsch@ibm.net)
Fri, 17 Apr 1998 20:48:06 -0400 (EDT)


On Fri, 17 Apr 1998, Philipp Rumpf wrote:

> Hello,

> I am talking about the file drivers/block/xd.c . In the Kernel versions
> up to 2.1.92, this file used an array xd[]. This was changed for
> versions 2.1.93+, but it is still used in the function
> xd_dtc_init_controller (this is new for versions 2.1.93+ also). I don't
> know exactly what it is for, but I would be happy if someone could fix
> it ... (Am I the only one having old hard disks ?) Philipp Rumpf,
> prumpf@t-online.de

Several folks (Adam Richter most recently) have posted a fix for this.
With the then-impending birth of his second daughter, I'm sure Linus was
distracted and didn't pick up on them <g>.

Here's Adam's:

The xd driver in the Linux 2.1.93 kernel does not compile.
I have attached the patch below. This patch is a little ugly. If
I knew what the purpose of "if (xd[3]<=0)" is and why the xd[] array
only seem to be declared if the driver is a module, I might be able to
make a prettier patch.

(This is another bug caught by the GNU style "./configure" script.)

Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 205
adam@yggdrasil.com \ / San Jose, California 95129-1034
+1 408 261-6630 | g g d r a s i l United States of America
fax +1 408 261-6631 "Free Software For The Rest Of Us."
----------------------CUT HERE---------------------------------------------
--- /tmp/linux-2.1.93/drivers/block/xd.c Sat Apr 4 09:36:10 1998
+++ linux/drivers/block/xd.c Tue Apr 7 19:54:40 1998
@@ -701,12 +701,20 @@
xd_info[drive].sectors = (u_char)(xd_geo[3 * drive + 2]);
}

+#ifdef MODULE
+static int xd[];
+#endif /* MODULE */
+
__initfunc(static void xd_dtc_init_controller (unsigned int address))
{
switch (address) {
case 0x00000:
case 0xC8000: break; /*initial: 0x320 */
- case 0xCA000: if (xd[3]<=0) xd_iobase = 0x324;
+ case 0xCA000:
+#ifdef MODULE
+ if (xd[3]<=0)
+#endif
+ xd_iobase = 0x324;
break;
case 0xD0000: /*5150CX*/
case 0xD8000: break; /*5150CX & 5150XL*/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu