Re: sg.c/IrDA in 2.3.43: compile fails

From: Jean-Luc Pedneault (umaro@step.polymtl.ca)
Date: Fri Feb 11 2000 - 15:18:15 EST


I used patch-2.3.43.gz to patch my linux source, though I didn't do a make
mrproper first.

Lines 1091-1092 reads like that here:

    size = sizeof(Sg_device) *
           (sg_template.dev_noticed + SG_EXTRA_DEVS);

so the patch file doesn't corrupt the linux tree.

When I checked sg.c I tried to find what this CONFIG_SD_EXTRA_DEVS error
was. By checking some #define's around, I found that in hosts.h:

#define SD_EXTRA_DEVS CONFIG_SD_EXTRA_DEVS
#define ST_EXTRA_DEVS CONFIG_ST_EXTRA_DEVS
#define SR_EXTRA_DEVS CONFIG_SR_EXTRA_DEVS
#define SG_EXTRA_DEVS (SD_EXTRA_DEVS + SR_EXTRA_DEVS + ST_EXTRA_DEVS)

SG_EXTRA_DEVS depends on CONFIG_SD_EXTRA_DEVS.

a quick fix:

--- /usr/src/linux/drivers/scsi/hosts.h Fri Feb 11 01:23:01 2000
+++ hosts.h Fri Feb 11 15:06:31 2000
@@ -504,6 +504,19 @@
  * tackle the character devices first, as there aren't any locking implications
  * in the block device layer. The block devices will require more work.
  */
+
+#ifndef CONFIG_SD_EXTRA_DEVS
+#define CONFIG_SD_EXTRA_DEVS 0
+#endif
+
+#ifndef CONFIG_ST_EXTRA_DEVS
+#define CONFIG_ST_EXTRA_DEVS 0
+#endif
+
+#ifndef CONFIG_SR_EXTRA_DEVS
+#define CONFIG_SR_EXTRA_DEVS 0
+#endif
+
 #define SD_EXTRA_DEVS CONFIG_SD_EXTRA_DEVS
 #define ST_EXTRA_DEVS CONFIG_ST_EXTRA_DEVS
 #define SR_EXTRA_DEVS CONFIG_SR_EXTRA_DEVS

therefore it's not sg.c that is broken, but hosts.h. I haven't tested
using these 0 values though.

- JL

On Fri, 11 Feb 2000, Douglas Gilbert wrote:

> Jean-Luc Pedneault wrote:
>
> > I get this while compiling the 2.3.43 kernel (2.3.42 compiled fine):
> >
> > -----------
> > make -C scsi modules
> > make[2]: Entering directory `/usr/src/linux-2.3/drivers/scsi'
> > ld -m elf_i386 -r -o sr_mod.o sr.o sr_ioctl.o sr_vendor.o
> > gcc -D__KERNEL__ -I/usr/src/linux-2.3/include -Wall -Wstrict-prototypes
> > -O2 -fomit-frame-pointer -pipe -DCPU=586 -DMODULE -c -o sg.o sg.c
> > sg.c: In function `sg_init':
> > sg.c:1092: `CONFIG_SD_EXTRA_DEVS' undeclared (first use in this function)
> > sg.c:1092: (Each undeclared identifier is reported only once
> >
> > [snip]
> >
> > I notice that CONFIG_SD_EXTRA_DEVS is the broken #define, and I need it
> > for my cd writer (via SCSI emulation). linux/drivers/scsi/Config.in seems
> > to define this only when the SCSI disk support is set to Yes or Module,
> > even though I got no SCSI disk inside my computer.
> >
> > Actually, sg.c DOES compile when SCSI Disk support is activated.
>
> On my version of 2.3.43 sg.c lines 1091 and 1092 read:
> size = sizeof(Sg_device) *
> (sg_template.dev_noticed + SG_EXTRA_DEVS);
>
> and compiles. Notice SG_EXTRA_DEVS not CONFIG_SD_EXTRA_DEVS. I recently
> downloaded the whole 14 MBytes of 2.3.42 and then used a patch
> from a mirror site to go to 2.3.43 . There is a lot of changes in
> sg in that patch but that doesn't explain way you have a corrupted
> version. Also patch-2.3.43 mentions SG_EXTRA_DEVS and not
> CONFIG_SD_EXTRA_DEVS for the line in question.
>
> Did you get the complete linux-2.3.43 source? If so this may
> indicate a difference between 2.3.42+patch2.3.43 and the
> linux-2.3.43 source.
>
> Doug Gilbert
> sg maintainer
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.rutgers.edu
> Please read the FAQ at http://www.tux.org/lkml/
>

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



This archive was generated by hypermail 2b29 : Tue Feb 15 2000 - 21:00:21 EST