From: Matthew Wilcox <matthew@wil.cx>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>,
Greg KH <greg@kroah.com>,
Matthew Dharm <mdharm-usb@one-eyed-alien.net>,
SCSI development list <linux-scsi@vger.kernel.org>,
USB Storage list <usb-storage@lists.one-eyed-alien.net>
Subject: Re: [PATCH] SCSI: add check_capacity flag and sd_read_last_sector()
Date: Wed, 22 Apr 2009 08:51:17 -0600 [thread overview]
Message-ID: <20090422145116.GH1926@parisc-linux.org> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0904221034340.3405-100000@iolanthe.rowland.org>
On Wed, Apr 22, 2009 at 10:42:36AM -0400, Alan Stern wrote:
> + /* If the capacity is unknown, we can't test anything */
> + if (sdkp->capacity <= 0)
> + return rc;
sector_t is unsigned, so this should be just == 0.
> + /* One test should be enough (unless it's inconclusive) */
> + sdp->check_capacity = 0;
> +
> + /* If the device doesn't use READ(10), assume we're okay */
> + if (!sdp->use_10_for_rw)
> + return rc;
> +
> + /* If the capacity is too big for READ(10), assume we're okay */
> + if (sdkp->capacity > 0xffffffff)
> + return rc;
Won't gcc warn about this when sector_t is 32 bits?
--
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."
next prev parent reply other threads:[~2009-04-22 14:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-22 14:42 [PATCH] SCSI: add check_capacity flag and sd_read_last_sector() Alan Stern
2009-04-22 14:51 ` Matthew Wilcox [this message]
2009-04-22 17:17 ` Alan Stern
2009-04-22 15:57 ` Greg KH
2009-04-22 19:17 ` [usb-storage] " Andries E. Brouwer
2009-04-22 20:47 ` Alan Stern
2009-04-22 23:03 ` Andries E. Brouwer
2009-04-23 2:33 ` Alan Stern
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=20090422145116.GH1926@parisc-linux.org \
--to=matthew@wil.cx \
--cc=James.Bottomley@HansenPartnership.com \
--cc=greg@kroah.com \
--cc=linux-scsi@vger.kernel.org \
--cc=mdharm-usb@one-eyed-alien.net \
--cc=stern@rowland.harvard.edu \
--cc=usb-storage@lists.one-eyed-alien.net \
/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