lkml.org 
[lkml]   [2007]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRE: [PATCH] cciss: Fix warnings during compilation under 32bitenvironment
Date
From

Something like

if (sizeof(blah) > 4) {
do all the assignments with shifts
}

might be slighly better since the CDB is already zeroed
by cmd_alloc() and doesn't need to be zeroed a 2nd time.

-- steve

-----Original Message-----
From: James Bottomley [mailto:James.Bottomley@SteelEye.com]
Sent: Thu 4/19/2007 11:22 AM
To: Miller, Mike (OS Dev)
Cc: Hisashi Hifumi; akpm@linux-foundation.org; jens.axboe@oracle.com; linux-kernel@vger.kernel.org; linux-scsi@vger.kernel.org; Cameron, Steve
Subject: RE: [PATCH] cciss: Fix warnings during compilation under 32bitenvironment

On Thu, 2007-04-19 at 16:12 +0000, Miller, Mike (OS Dev) wrote:
> > > Nak. You still haven't told where you saw these warnings. What
> > > compiler are you using? I do not see these in my 32-bit environment.
> >
> > I think it's seen with CONFIG_LBD=n on 32 bits
> >
> > In that configuration, sector_t is a u32 (it's u64 even on 32
> > bits with CONFIG_LBD=y). The proposed code change is a
> > simple cut and paste from the sd driver.
>
> Isn't there a better way than testing each one?

It's not such a bad option. The sizeof() test is compile time
determinable, so the compiler simply zeros the fields in the
CONFIG_LBD=n case and does the shift for CONFIG_LBD=y. It certainly
never compiles to four inline condition checks.

James



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-04-19 18:35    [W:0.077 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site