[PATCH] Use sg_set_buf/sg_init_one where applicable
This patch uses sg_set_buf/sg_init_one in some places where it was duplicated. Signed-off-by: David Hardeman <david@2gen.com> Cc: James Bottomley <James.Bottomley@steeleye.com> Cc: Greg KH <greg@kroah.com> Cc: "David S. Miller" <davem@davemloft.net> Cc: Jeff Garzik <jgarzik@pobox.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
committed by
Herbert Xu
parent
d32311fed7
commit
378f058cc4
@@ -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,
|
||||
|
Reference in New Issue
Block a user