rtc: don't use __exit_p to wrap ds1302_rtc_remove
[safe/jmp/linux-2.6] / drivers / scsi / atari_NCR5380.c
index a9680b5..4240b05 100644 (file)
@@ -511,9 +511,9 @@ static inline void initialize_SCp(Scsi_Cmnd *cmd)
         * various queues are valid.
         */
 
-       if (cmd->use_sg) {
-               cmd->SCp.buffer = (struct scatterlist *)cmd->request_buffer;
-               cmd->SCp.buffers_residual = cmd->use_sg - 1;
+       if (scsi_bufflen(cmd)) {
+               cmd->SCp.buffer = scsi_sglist(cmd);
+               cmd->SCp.buffers_residual = scsi_sg_count(cmd) - 1;
                cmd->SCp.ptr = sg_virt(cmd->SCp.buffer);
                cmd->SCp.this_residual = cmd->SCp.buffer->length;
                /* ++roman: Try to merge some scatter-buffers if they are at
@@ -523,8 +523,8 @@ static inline void initialize_SCp(Scsi_Cmnd *cmd)
        } else {
                cmd->SCp.buffer = NULL;
                cmd->SCp.buffers_residual = 0;
-               cmd->SCp.ptr = (char *)cmd->request_buffer;
-               cmd->SCp.this_residual = cmd->request_bufflen;
+               cmd->SCp.ptr = NULL;
+               cmd->SCp.this_residual = 0;
        }
 }
 
@@ -844,7 +844,7 @@ static char *lprint_Scsi_Cmnd(Scsi_Cmnd *cmd, char *pos, char *buffer, int lengt
  *
  */
 
-static int NCR5380_init(struct Scsi_Host *instance, int flags)
+static int __init NCR5380_init(struct Scsi_Host *instance, int flags)
 {
        int i;
        SETUP_HOSTDATA(instance);
@@ -936,21 +936,21 @@ static int NCR5380_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
        }
 # endif
 # ifdef NCR5380_STAT_LIMIT
-       if (cmd->request_bufflen > NCR5380_STAT_LIMIT)
+       if (scsi_bufflen(cmd) > NCR5380_STAT_LIMIT)
 # endif
                switch (cmd->cmnd[0]) {
                case WRITE:
                case WRITE_6:
                case WRITE_10:
                        hostdata->time_write[cmd->device->id] -= (jiffies - hostdata->timebase);
-                       hostdata->bytes_write[cmd->device->id] += cmd->request_bufflen;
+                       hostdata->bytes_write[cmd->device->id] += scsi_bufflen(cmd);
                        hostdata->pendingw++;
                        break;
                case READ:
                case READ_6:
                case READ_10:
                        hostdata->time_read[cmd->device->id] -= (jiffies - hostdata->timebase);
-                       hostdata->bytes_read[cmd->device->id] += cmd->request_bufflen;
+                       hostdata->bytes_read[cmd->device->id] += scsi_bufflen(cmd);
                        hostdata->pendingr++;
                        break;
                }
@@ -1352,21 +1352,21 @@ static irqreturn_t NCR5380_intr(int irq, void *dev_id)
 static void collect_stats(struct NCR5380_hostdata* hostdata, Scsi_Cmnd *cmd)
 {
 # ifdef NCR5380_STAT_LIMIT
-       if (cmd->request_bufflen > NCR5380_STAT_LIMIT)
+       if (scsi_bufflen(cmd) > NCR5380_STAT_LIMIT)
 # endif
                switch (cmd->cmnd[0]) {
                case WRITE:
                case WRITE_6:
                case WRITE_10:
                        hostdata->time_write[cmd->device->id] += (jiffies - hostdata->timebase);
-                       /*hostdata->bytes_write[cmd->device->id] += cmd->request_bufflen;*/
+                       /*hostdata->bytes_write[cmd->device->id] += scsi_bufflen(cmd);*/
                        hostdata->pendingw--;
                        break;
                case READ:
                case READ_6:
                case READ_10:
                        hostdata->time_read[cmd->device->id] += (jiffies - hostdata->timebase);
-                       /*hostdata->bytes_read[cmd->device->id] += cmd->request_bufflen;*/
+                       /*hostdata->bytes_read[cmd->device->id] += scsi_bufflen(cmd);*/
                        hostdata->pendingr--;
                        break;
                }
@@ -1868,7 +1868,7 @@ static int do_abort(struct Scsi_Host *host)
         * the target sees, so we just handshake.
         */
 
-       while (!(tmp = NCR5380_read(STATUS_REG)) & SR_REQ)
+       while (!((tmp = NCR5380_read(STATUS_REG)) & SR_REQ))
                ;
 
        NCR5380_write(TARGET_COMMAND_REG, PHASE_SR_TO_TCR(tmp));
@@ -2826,8 +2826,7 @@ int NCR5380_abort(Scsi_Cmnd *cmd)
         */
 
        local_irq_restore(flags);
-       printk(KERN_INFO "scsi%d: warning : SCSI command probably completed successfully\n"
-              KERN_INFO "        before abortion\n", HOSTNO);
+       printk(KERN_INFO "scsi%d: warning : SCSI command probably completed successfully before abortion\n", HOSTNO);
 
        /* Maybe it is sufficient just to release the ST-DMA lock... (if
         * possible at all) At least, we should check if the lock could be