Linux SCSI subsystem development
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: akpm@osdl.org, linux-scsi@vger.kernel.org
Subject: Re: PATCH: Bogus disk geometry on large disks
Date: Fri, 26 May 2006 12:20:02 -0600	[thread overview]
Message-ID: <20060526182002.GG19587@parisc-linux.org> (raw)
In-Reply-To: <1148667738.20856.40.camel@localhost.localdomain>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=unknown-8bit, Size: 1328 bytes --]

On Fri, May 26, 2006 at 07:22:18PM +0100, Alan Cox wrote:
> On Gwe, 2006-05-26 at 11:57 -0600, Matthew Wilcox wrote:
> > On Fri, May 26, 2006 at 05:29:25PM +0100, Alan Cox wrote:
> > >  
> > > -	if (ret == -1) {
> > > +	if (ret == -1 && capacity < (1ULL << 32)) {
> > >  		/* pick some standard mapping with at most 1024 cylinders,
> > 
> > won't that provoke a gcc warning when sector_t is 32-bit?  how about ...
> 
> I don't believe it will as the type is forced to "1ULL"

gcc disagrees with you ;-)

$ cat test.c 
unsigned int y;

int main(void)
{
        if (y < (1ULL << 32))
                return 0;
        return 1;
}
$ gcc -O2 -W -Wall -o test test.c
test.c: In function ‘main’:
test.c:5: warning: comparison is always true due to limited range of data type

$ cat test.c 
unsigned int y;

int main(void)
{
        if (((y >> 16) >> 16) > 0)
                return 0;
        return 1;
}
$ gcc -O2 -W -Wall -o test test.c

(anyone know how you turn off that fucking UTF8 crap that gcc insists
on putting into its warning/error messages?  Who thought that was a
good idea?)

-
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

  reply	other threads:[~2006-05-26 18:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-26 16:29 PATCH: Bogus disk geometry on large disks Alan Cox
2006-05-26 17:57 ` Matthew Wilcox
2006-05-26 18:22   ` Alan Cox
2006-05-26 18:20     ` Matthew Wilcox [this message]
2006-05-26 19:57       ` Doug Maxey

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=20060526182002.GG19587@parisc-linux.org \
    --to=matthew@wil.cx \
    --cc=akpm@osdl.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-scsi@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox