[PATCH] Use sg_set_buf/sg_init_one where applicable
[safe/jmp/linux-2.6] / drivers / scsi / arm / scsi.h
index 2f1b3f4..1993764 100644 (file)
@@ -10,6 +10,8 @@
  *  Commonly used scsi driver functions.
  */
 
+#include <linux/scatterlist.h>
+
 #define BELT_AND_BRACES
 
 /*
@@ -22,9 +24,7 @@ static inline int copy_SCp_to_sg(struct scatterlist *sg, Scsi_Pointer *SCp, int
 
        BUG_ON(bufs + 1 > max);
 
-       sg->page   = virt_to_page(SCp->ptr);
-       sg->offset = offset_in_page(SCp->ptr);
-       sg->length = SCp->this_residual;
+       sg_set_buf(sg, SCp->ptr, SCp->this_residual);
 
        if (bufs)
                memcpy(sg + 1, SCp->buffer + 1,
@@ -108,7 +108,7 @@ static inline void init_SCp(Scsi_Cmnd *SCpnt)
 #if 0 //def BELT_AND_BRACES
                printk(KERN_WARNING "scsi%d.%c: zero length buffer passed for "
                       "command ", SCpnt->host->host_no, '0' + SCpnt->target);
-               print_command(SCpnt->cmnd);
+               __scsi_print_command(SCpnt->cmnd);
 #endif
                SCpnt->SCp.ptr = NULL;
        }