LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Mike Miller (OS Dev)" <mikem@beardog.cca.cpqcorp.net>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: mike.miller@hp.com, jens.axboe@oracle.com,
	linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,
	gregkh@novell.com
Subject: Re: [Patch 1/2] cciss: fix for 2TB support
Date: Thu, 22 Feb 2007 14:18:09 -0600	[thread overview]
Message-ID: <20070222201809.GA1530@beardog.cca.cpqcorp.net> (raw)
In-Reply-To: <20070221191427.9b7cf4b0.akpm@linux-foundation.org>

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

  parent reply	other threads:[~2007-02-22 20:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-21 21:10 Mike Miller (OS Dev)
2007-02-22  3:14 ` Andrew Morton
2007-02-22  7:31   ` [PATCH] Speedup divides by cpu_power in scheduler Eric Dumazet
2007-02-22  7:56     ` Ingo Molnar
2007-02-22  8:19     ` [PATCH, take 2] " Eric Dumazet
2007-02-22  8:19       ` Ingo Molnar
2007-02-22 16:51   ` [Patch 1/2] cciss: fix for 2TB support Mike Miller (OS Dev)
2007-02-22 21:24     ` Andrew Morton
2007-02-22 21:41       ` James Bottomley
2007-02-22 22:02         ` Mike Miller (OS Dev)
2007-02-22 22:06           ` James Bottomley
2007-02-23 20:52             ` Mike Miller (OS Dev)
2007-02-24  6:35               ` Andrew Morton
2007-02-22 20:18   ` Mike Miller (OS Dev) [this message]
2007-02-22 21:22     ` Miller, Mike (OS Dev)

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=20070222201809.GA1530@beardog.cca.cpqcorp.net \
    --to=mikem@beardog.cca.cpqcorp.net \
    --cc=akpm@linux-foundation.org \
    --cc=gregkh@novell.com \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mike.miller@hp.com \
    --subject='Re: [Patch 1/2] cciss: fix for 2TB support' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).