From: Johannes Thumshirn <jthumshirn@suse.de>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-scsi@vger.kernel.org,
Douglas Gilbert <dgilbert@interlog.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
"James E.J. Bottomley" <jbottomley@odin.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Subject: Re: [PATCH v1 1/1] scsi_debug: check for bigger value first
Date: Fri, 27 Nov 2015 10:32:02 +0100 [thread overview]
Message-ID: <1448616722.2877.97.camel@suse.de> (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: Johannes Thumshirn <jthumshirn@suse.de>
--
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
next prev parent reply other threads:[~2015-11-27 9:32 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 [this message]
2015-11-30 13:55 ` Ewan Milne
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=1448616722.2877.97.camel@suse.de \
--to=jthumshirn@suse.de \
--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.