All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ewan Milne <emilne@redhat.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-scsi@vger.kernel.org,
	Douglas Gilbert <dgilbert@interlog.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	"James E.J. Bottomley" <jbottomley@odin.com>,
	Andy Shevchenko <andy.shevchenko@gmail.com>
Subject: Re: [PATCH v1 1/1] scsi_debug: check for bigger value first
Date: Mon, 30 Nov 2015 08:55:03 -0500	[thread overview]
Message-ID: <1448891703.4067.79.camel@localhost.localdomain> (raw)
In-Reply-To: <1448562170-122075-1-git-send-email-andriy.shevchenko@linux.intel.com>

On Thu, 2015-11-26 at 20:22 +0200, Andy Shevchenko wrote:
> From: Andy Shevchenko <andy.shevchenko@gmail.com>
> 
> Even for signed types we have to check for bigger positive value first.
> Otherwise it will be never happened.
> 
> Acked-by: Douglas Gilbert <dgilbert@interlog.com>
> Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> ---
>  drivers/scsi/scsi_debug.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
> index dfcc45b..f773b34 100644
> --- a/drivers/scsi/scsi_debug.c
> +++ b/drivers/scsi/scsi_debug.c
> @@ -4846,10 +4846,10 @@ static int __init scsi_debug_init(void)
>  	/* play around with geometry, don't waste too much on track 0 */
>  	sdebug_heads = 8;
>  	sdebug_sectors_per = 32;
> -	if (scsi_debug_dev_size_mb >= 16)
> -		sdebug_heads = 32;
> -	else if (scsi_debug_dev_size_mb >= 256)
> +	if (scsi_debug_dev_size_mb >= 256)
>  		sdebug_heads = 64;
> +	else if (scsi_debug_dev_size_mb >= 16)
> +		sdebug_heads = 32;
>  	sdebug_cylinders_per = (unsigned long)sdebug_capacity /
>  			       (sdebug_sectors_per * sdebug_heads);
>  	if (sdebug_cylinders_per >= 1024) {

Reviewed-by: Ewan D. Milne <emilne@redhat.com>



  parent reply	other threads:[~2015-11-30 13:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-26 18:22 [PATCH v1 1/1] scsi_debug: check for bigger value first Andy Shevchenko
2015-11-27  9:32 ` Johannes Thumshirn
2015-11-30 13:55 ` Ewan Milne [this message]
2015-11-30 17:14 ` Martin K. Petersen

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=1448891703.4067.79.camel@localhost.localdomain \
    --to=emilne@redhat.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=dgilbert@interlog.com \
    --cc=jbottomley@odin.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.