public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: Julia Lawall <julia@diku.dk>
Cc: akpm@linux-foundation.org, James.Bottomley@HansenPartnership.com,
	linux-scsi@vger.kernel.org
Subject: Re: [patch 15/17] drivers/scsi: Use DIV_ROUND_UP
Date: Wed, 24 Sep 2008 13:31:15 -0600	[thread overview]
Message-ID: <20080924193115.GQ27204@parisc-linux.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0809242125450.19914@ask.diku.dk>

On Wed, Sep 24, 2008 at 09:26:48PM +0200, Julia Lawall wrote:
> --------------------
> 
> From: Julia Lawall <julia@diku.dk>
> 
> Use the macro DIV_ROUND_UP and eliminate the variable rounded_up, as
> suggested by Matthew Wilcox.
> 
> Signed-off-by: Julia Lawall <julia@diku.dk>

Reviewed-by: Matthew Wilcox <willy@linux.intel.com>

> ---
> 
>  drivers/scsi/esp_scsi.c       |    6 ++----
>  1 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/scsi/esp_scsi.c b/drivers/scsi/esp_scsi.c
> index 62a4618..a680e18 100644
> --- a/drivers/scsi/esp_scsi.c
> +++ b/drivers/scsi/esp_scsi.c
> @@ -1453,7 +1453,7 @@ static void esp_msgin_sdtr(struct esp *esp, struct esp_target_data *tp)
>  		offset = 0;
>  
>  	if (offset) {
> -		int rounded_up, one_clock;
> +		int one_clock;
>  
>  		if (period > esp->max_period) {
>  			period = offset = 0;
> @@ -1463,9 +1463,7 @@ static void esp_msgin_sdtr(struct esp *esp, struct esp_target_data *tp)
>  			goto do_reject;
>  
>  		one_clock = esp->ccycle / 1000;
> -		rounded_up = (period << 2);
> -		rounded_up = (rounded_up + one_clock - 1) / one_clock;
> -		stp = rounded_up;
> +		stp = DIV_ROUND_UP(period << 2, one_clock);
>  		if (stp && esp->rev >= FAS236) {
>  			if (stp >= 50)
>  				stp--;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Matthew Wilcox				Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

      reply	other threads:[~2008-09-24 19:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-22 21:56 [patch 15/17] drivers/scsi: Use DIV_ROUND_UP akpm
2008-09-23  0:43 ` Matthew Wilcox
2008-09-24 19:26   ` Julia Lawall
2008-09-24 19:31     ` Matthew Wilcox [this message]

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=20080924193115.GQ27204@parisc-linux.org \
    --to=matthew@wil.cx \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=akpm@linux-foundation.org \
    --cc=julia@diku.dk \
    --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