Re: 2.1.126: drivers/scsi/sd.c not compiling

Horst von Brand (vonbrand@sleipnir.valparaiso.cl)
Sun, 25 Oct 1998 22:25:27 -0400


"G. Allen Morris III" <gam3@dharma.sehda.com> said:
> This will get sb to compile, but I get undefined symbol errors when I
> install it.
>

The version from 2.1.126pre2ac2 compiles OK and loads OK (no Zip drive at
hand for testing):

--- drivers/scsi/sd.c.dist-2.1.127pre1 Sun Oct 25 16:31:13 1998
+++ drivers/scsi/sd.c Sun Oct 25 16:55:18 1998
@@ -65,7 +65,8 @@
#define SD_MINOR_NUMBER(i) ((i) & 255)
#define MKDEV_SD_PARTITION(i) MKDEV(SD_MAJOR_NUMBER(i), (i) & 255)
#define MKDEV_SD(index) MKDEV_SD_PARTITION((index) << 4)
-#define N_USED_SD_MAJORS ((sd_template.dev_max + SCSI_DISKS_PER_MAJOR - 1) / SCSI_DISKS_PER_MAJOR)
+#define N_USED_SCSI_DISKS (sd_template.dev_max + SCSI_DISKS_PER_MAJOR - 1)
+#define N_USED_SD_MAJORS (N_USED_SCSI_DISKS / SCSI_DISKS_PER_MAJOR)

#define MAX_RETRIES 5

@@ -1125,8 +1126,8 @@
unsigned char cmd[10];
char nbuff[6];
unsigned char *buffer;
- unsigned long spintime;
- int the_result, retries;
+ unsigned long spintime_value = 0;
+ int the_result, retries, spintime;
Scsi_Cmnd * SCpnt;

/*
@@ -1221,16 +1222,18 @@
SCpnt->request.sem = NULL;
}

- spintime = jiffies;
+ spintime = 1;
+ spintime_value = jiffies;
}

time1 = jiffies + HZ;
spin_unlock_irq(&io_request_lock);
- while(jiffies < time1); /* Wait 1 second for next try */
+ while(time_before(jiffies, time1)); /* Wait 1 second for next try */
printk( "." );
spin_lock_irq(&io_request_lock);
}
- } while(the_result && spintime && spintime+100*HZ > jiffies);
+ } while(the_result && spintime &&
+ time_after(spintime_value+100*HZ, jiffies));
if (spintime) {
if (the_result)
printk( "not responding...\n" );
@@ -1765,7 +1768,7 @@
scsi_unregister_module(MODULE_SCSI_DEV, &sd_template);

for (i=0; i <= sd_template.dev_max / SCSI_DISKS_PER_MAJOR; i++)
- unregister_blkdev(SD_MAJOR(i),"sd");
+ unregister_blkdev(SD_MAJOR(i),"sd");

sd_registered--;
if( rscsi_disks != NULL )
@@ -1783,7 +1786,7 @@

for (sdgd = gendisk_head; sdgd; sdgd = sdgd->next)
{
- if (sdgd->next >= sd_gendisks && sdgd->next <= LAST_SD_GENDISK)
+ if (sdgd->next >= sd_gendisks && sdgd->next <= LAST_SD_GENDISK.max_nr)
removed++, sdgd->next = sdgd->next->next;
else sdgd = sdgd->next;
}

-- 
Horst von Brand                             vonbrand@sleipnir.valparaiso.cl
Casilla 9G, Viņa del Mar, Chile                               +56 32 672616

- 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/