From: Roland Dreier <rdreier@cisco.com>
To: lkml@MoreThan.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [Compile Warning] 2.6.30-rc8 build
Date: Fri, 05 Jun 2009 10:28:00 -0700 [thread overview]
Message-ID: <ada1vpywpy7.fsf@cisco.com> (raw)
In-Reply-To: <200906051150.17889.lkml@morethan.org> (Michael S. Zick's message of "Fri, 5 Jun 2009 11:50:15 -0500")
> I can't argue with gcc on this one either:
>
> drivers/scsi/sd.c: In function 'sd_read_capacity':
> drivers/scsi/sd.c:1451: warning: comparison is always false due to limited range of data type
>
> It reads to my eyes as if the function can never
> select read_capacity_16 for very large devices.
The code is:
if ((sizeof(sdkp->capacity) > 4) &&
(sdkp->capacity > 0xffffffffULL)) {
sdkp->capacity is a sector_t, and <linux/types.h> has:
#ifdef CONFIG_LBD
typedef u64 sector_t;
typedef u64 blkcnt_t;
#else
typedef unsigned long sector_t;
typedef unsigned long blkcnt_t;
#endif
so if you don't set CONFIG_LBD on a 32-bit architecture, then you are
correct that sd.c won't ever hit the READ_CAPACITY(16) case, and the
kernel won't be able to handle large SCSI disks.
next prev parent reply other threads:[~2009-06-05 17:28 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-05 16:50 [Compile Warning] 2.6.30-rc8 build Michael S. Zick
2009-06-05 17:28 ` Roland Dreier [this message]
2009-06-05 17:49 ` Michael S. Zick
-- strict thread matches above, loose matches on Subject: below --
2009-06-05 16:43 Michael S. Zick
2009-06-05 17:22 ` Roland Dreier
2009-06-05 17:40 ` Michael S. Zick
2009-06-05 17:50 ` Roland Dreier
2009-06-05 18:06 ` Alan Cox
2009-06-05 18:01 ` Alan Cox
2009-06-05 21:57 ` Andrew Morton
2009-06-05 22:06 ` Alan Cox
2009-06-05 22:13 ` Andrew Morton
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=ada1vpywpy7.fsf@cisco.com \
--to=rdreier@cisco.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lkml@MoreThan.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 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.