From: Douglas Gilbert <dgilbert@interlog.com>
To: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: linux-scsi@vger.kernel.org, James.Bottomley@HansenPartnership.com
Subject: Re: [PATCH 2/2] sg: use ALIGN macro
Date: Sun, 15 Feb 2009 01:17:19 +0100 [thread overview]
Message-ID: <49975F0F.3040702@interlog.com> (raw)
In-Reply-To: <1234374177-6192-2-git-send-email-fujita.tomonori@lab.ntt.co.jp>
FUJITA Tomonori wrote:
> 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>
> ---
> drivers/scsi/sg.c | 5 ++---
> 1 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
> index d17d89b..b459864 100644
> --- a/drivers/scsi/sg.c
> +++ b/drivers/scsi/sg.c
> @@ -98,7 +98,6 @@ static int scatter_elem_sz = SG_SCATTER_SZ;
> static int scatter_elem_sz_prev = SG_SCATTER_SZ;
>
> #define SG_SECTOR_SZ 512
> -#define SG_SECTOR_MSK (SG_SECTOR_SZ - 1)
>
> static int sg_add(struct device *, struct class_interface *);
> static 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)
> return -EFAULT;
> if (0 == blk_size)
> ++blk_size; /* don't know why */
> -/* round request up to next highest SG_SECTOR_SZ byte boundary */
> - blk_size = (blk_size + SG_SECTOR_MSK) & (~SG_SECTOR_MSK);
> + /* round request up to next highest SG_SECTOR_SZ byte boundary */
> + blk_size = ALIGN(blk_size, SG_SECTOR_SZ);
> SCSI_LOG_TIMEOUT(4, printk("sg_build_indirect: buff_size=%d, blk_size=%d\n",
> buff_size, blk_size));
>
Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
next prev parent reply other threads:[~2009-02-15 0:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-11 17:42 [PATCH 1/2] sg: remove unnecessary function declarations FUJITA Tomonori
2009-02-11 17:42 ` [PATCH 2/2] sg: use ALIGN macro FUJITA Tomonori
2009-02-15 0:17 ` Douglas Gilbert [this message]
2009-02-15 0:16 ` [PATCH 1/2] sg: remove unnecessary function declarations Douglas Gilbert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49975F0F.3040702@interlog.com \
--to=dgilbert@interlog.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox