From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752921AbXDUVH5 (ORCPT ); Sat, 21 Apr 2007 17:07:57 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752880AbXDUVH5 (ORCPT ); Sat, 21 Apr 2007 17:07:57 -0400 Received: from smtp1.linux-foundation.org ([65.172.181.25]:53087 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752800AbXDUVH4 (ORCPT ); Sat, 21 Apr 2007 17:07:56 -0400 Date: Sat, 21 Apr 2007 14:06:22 -0700 From: Andrew Morton To: Alan Cox Cc: "John Anthony Kazos Jr." , James Bottomley , "Cameron, Steve" , "Miller, Mike (OS Dev)" , Hisashi Hifumi , jens.axboe@oracle.com, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, trivial@kernel.org Subject: Re: [PATCH] utilities: add helper functions for safe 64-bit integer operations as 32-bit halves Message-Id: <20070421140622.dc197b38.akpm@linux-foundation.org> In-Reply-To: <20070421220147.7144113e@the-village.bc.nu> References: <6.0.0.20.2.20070418160231.043f23c8@172.19.0.2> <226E1C65E4F6164E8EA5FD3CC913AE8CF461DE@G3W0639.americas.hpqcorp.net> <1176995934.31764.7.camel@mulgrave.il.steeleye.com> <226E1C65E4F6164E8EA5FD3CC913AE8CF462EE@G3W0639.americas.hpqcorp.net> <1176999730.31764.15.camel@mulgrave.il.steeleye.com> <558F4D473FD7FE419B019232BF2D37B401167D74@G3W0634.americas.hpqcorp.net> <20070419222028.d33c7f86.akpm@linux-foundation.org> <1177074641.3718.5.camel@mulgrave.il.steeleye.com> <20070420114337.12a67141.akpm@linux-foundation.org> <1177095007.3718.43.camel@mulgrave.il.steeleye.com> <20070420123041.94aac1e1.akpm@linux-foundation.org> <1177100459.3718.45.camel@mulgrave.il.steeleye.com> <20070420141218.a0222472.akpm@linux-foundation.org> <20070421030825.bed0b8a9.akpm@linux-foundation.org> <20070421220147.7144113e@the-village.bc.nu> X-Mailer: Sylpheed version 2.2.7 (GTK+ 2.8.17; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 21 Apr 2007 22:01:47 +0100 Alan Cox wrote: > > > +#define lower_32_bits(n) (sizeof(n) == 8 ? (u32)(n) : (n)) > > > > n&0xffffffff 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-engineering. Call it sector_upper32() do it the simple way and stop > trying to solve a problem we don't have James said we have the same problem with dma_addr_t.