[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070222201809.GA1530@beardog.cca.cpqcorp.net>
Date: Thu, 22 Feb 2007 14:18:09 -0600
From: "Mike Miller (OS Dev)" <mikem@...rdog.cca.cpqcorp.net>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: mike.miller@...com, jens.axboe@...cle.com,
linux-kernel@...r.kernel.org, linux-scsi@...r.kernel.org,
gregkh@...ell.com
Subject: Re: [Patch 1/2] cciss: fix for 2TB support
On Wed, Feb 21, 2007 at 07:14:27PM -0800, Andrew Morton wrote:
> >
> > + if (total_size == 0xFFFFFFFF) {
>
> I seem to remember having already questioned this. total_size is sector_t, which
> can be either 32-bit or 64-bit. Are you sure that comparison works as
> intended in both cases?
>
>
> > + if(total_size == 0xFFFFFFFF) {
> > cciss_read_capacity_16(cntl_num, i, 0,
> > &total_size, &block_size);
> > hba[cntl_num]->cciss_read = CCISS_READ_16;
>
> Here too.
Andrew,
Using this test program and changing the type of x to int, long, long long signed and
unsigned the comparison always worked on x86, x86_64, and ia64. It looks to me like
the comparsion will always do what we expect. Unless you see some other problem.
#include <stdio.h>
int main(int argc, char *argv[])
{
unsigned long long x;
x = 0x00000000ffffffff;
printf(sizeof(x) == 8 ?
"x = %lld, sizeof(x) = %d\n" :
"x = %ld, sizeof(x) = %d\n", x, sizeof(x));
if (x == 0xffffffff)
printf("equal\n");
else
printf("not equal\n");
}
-- mikem
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists