public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Sumant Patro <sumantp@lsil.com>
Cc: James.Bottomley@SteelEye.com, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org, neela.kolli@lsi.com,
	bo.yang@lsi.com, sumant.patro@lsi.com
Subject: Re: [PATCH 2/5] scsi: megaraid_sas - added bios_param in scsi_host_template
Date: Wed, 7 Feb 2007 13:19:52 -0800	[thread overview]
Message-ID: <20070207131952.681c6775.akpm@linux-foundation.org> (raw)
In-Reply-To: <1170799043.10482.20.camel@dumbo>

On Tue, 06 Feb 2007 13:57:23 -0800
Sumant Patro <sumantp@lsil.com> wrote:

> +static int
> +megasas_bios_param(struct scsi_device *sdev, struct block_device *bdev,
> +		 sector_t capacity, int geom[])
> +{
> +	int 		heads;
> +	int 		sectors;
> +	sector_t	cylinders;
> +	ulong		dummy;

Plain old `unsigned long' is preferred.

> +	/* Default heads (64) & sectors (32) */
> +	heads 		= 64;
> +	sectors 	= 32;
> +
> +	dummy		= heads * sectors;
> +	cylinders	=  capacity;
> +
> +	sector_div(cylinders, dummy);
> +
> +	/*
> +	 * Handle extended translation size for logical drives > 1Gb
> +	 */
> +	
> +	if ((ulong)capacity >= 0x200000) {

Here we're casting a sector_t down to a 32-bit number.  Are you sure that
`capacity' here can never exceed 0xffffffff?


      reply	other threads:[~2007-02-07 21:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-06 21:57 [PATCH 2/5] scsi: megaraid_sas - added bios_param in scsi_host_template Sumant Patro
2007-02-07 21:19 ` Andrew Morton [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=20070207131952.681c6775.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=James.Bottomley@SteelEye.com \
    --cc=bo.yang@lsi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=neela.kolli@lsi.com \
    --cc=sumant.patro@lsi.com \
    --cc=sumantp@lsil.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox