aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2009-02-11 12:42:57 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2009-03-12 13:58:14 -0400
commitb2ed6c69aa3c1a3f496e2a72f770d53069371df3 (patch)
tree8dd6fc39ab31001b16e34a81ff185a840ff8859b
parent2134bc72ddc04d412c0c2ce93a9c6f19de6cac35 (diff)
[SCSI] sg: use ALIGN macro
This changes sg_build_indirect() to use ALIGN macro instead of calculating by hand. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Acked-by: Douglas Gilbert <dgilbert@interlog.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r--drivers/scsi/sg.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index f493d7fca34..d45ac4aab92 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -98,7 +98,6 @@ static int scatter_elem_sz = SG_SCATTER_SZ;
98static int scatter_elem_sz_prev = SG_SCATTER_SZ; 98static int scatter_elem_sz_prev = SG_SCATTER_SZ;
99 99
100#define SG_SECTOR_SZ 512 100#define SG_SECTOR_SZ 512
101#define SG_SECTOR_MSK (SG_SECTOR_SZ - 1)
102 101
103static int sg_add(struct device *, struct class_interface *); 102static int sg_add(struct device *, struct class_interface *);
104static void sg_remove(struct device *, struct class_interface *); 103static void sg_remove(struct device *, struct class_interface *);
@@ -1723,8 +1722,8 @@ sg_build_indirect(Sg_scatter_hold * schp, Sg_fd * sfp, int buff_size)
1723 return -EFAULT; 1722 return -EFAULT;
1724 if (0 == blk_size) 1723 if (0 == blk_size)
1725 ++blk_size; /* don't know why */ 1724 ++blk_size; /* don't know why */
1726/* round request up to next highest SG_SECTOR_SZ byte boundary */ 1725 /* round request up to next highest SG_SECTOR_SZ byte boundary */
1727 blk_size = (blk_size + SG_SECTOR_MSK) & (~SG_SECTOR_MSK); 1726 blk_size = ALIGN(blk_size, SG_SECTOR_SZ);
1728 SCSI_LOG_TIMEOUT(4, printk("sg_build_indirect: buff_size=%d, blk_size=%d\n", 1727 SCSI_LOG_TIMEOUT(4, printk("sg_build_indirect: buff_size=%d, blk_size=%d\n",
1729 buff_size, blk_size)); 1728 buff_size, blk_size));
1730 1729