Re: [RFC][PATCH] fix for async scsi scan sysfs problem (resend)

2007-04-21 Thread Andrew Morton
On Thu, 19 Apr 2007 11:06:56 -0400 Josef Bacik <[EMAIL PROTECTED]> wrote: > On Thu, Apr 19, 2007 at 10:02:36AM -0400, James Bottomley wrote: > > On Thu, 2007-04-19 at 09:25 -0400, Josef Bacik wrote: > > > Looking through everything I came to the conclusion that we don't really > > > need > > > th

Re: [PATCH] utilities: add helper functions for safe 64-bit integer operations as 32-bit halves

2007-04-21 Thread Andrew Morton
On Fri, 20 Apr 2007 20:55:49 -0400 (EDT) "John Anthony Kazos Jr." <[EMAIL PROTECTED]> wrote: > +#define upper_32_bits(n) (sizeof(n) == 8 ? (u64)(n) >> 32 : 0) It's very unclear what type this returns, in terms of both size and signedness. Perhaps it always returns a u64, dunno. If it does, tha

Re: [PATCH] utilities: add helper functions for safe 64-bit integer operations as 32-bit halves

2007-04-21 Thread John Anthony Kazos Jr.
From: John Anthony Kazos Jr. <[EMAIL PROTECTED]> Add helper functions "upper_32_bits" and "lower_32_bits" to to allow 64-bit integers to be separated into their 32-bit upper and lower halves without promoting integers, without stretching sign bits, and without generating compiler warnings when

Re: [RFC][PATCH] fix for async scsi scan sysfs problem (resend)

2007-04-21 Thread Josef Bacik
On Sat, Apr 21, 2007 at 12:23:45AM -0700, Andrew Morton wrote: > On Thu, 19 Apr 2007 11:06:56 -0400 Josef Bacik <[EMAIL PROTECTED]> wrote: > > > On Thu, Apr 19, 2007 at 10:02:36AM -0400, James Bottomley wrote: > > > On Thu, 2007-04-19 at 09:25 -0400, Josef Bacik wrote: > > > > Looking through ever

Re: [PATCH] utilities: add helper functions for safe 64-bit integer operations as 32-bit halves

2007-04-21 Thread Alan Cox
> > +#define lower_32_bits(n) (sizeof(n) == 8 ? (u32)(n) : (n)) > > n&0x would be simpler. > > Do we actually have any call for this? The only case for all of this we care about is sector_t, which is one type, with specific properties (eg always being positive). The rest is over-engineer

Re: [PATCH] utilities: add helper functions for safe 64-bit integer operations as 32-bit halves

2007-04-21 Thread Andrew Morton
On Sat, 21 Apr 2007 22:01:47 +0100 Alan Cox <[EMAIL PROTECTED]> wrote: > > > +#define lower_32_bits(n) (sizeof(n) == 8 ? (u32)(n) : (n)) > > > > n&0x would be simpler. > > > > Do we actually have any call for this? > > The only case for all of this we care about is sector_t, which is on