Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764360AbXJEVYj (ORCPT ); Fri, 5 Oct 2007 17:24:39 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760900AbXJEVYb (ORCPT ); Fri, 5 Oct 2007 17:24:31 -0400 Received: from cantor2.suse.de ([195.135.220.15]:38702 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751421AbXJEVYa (ORCPT ); Fri, 5 Oct 2007 17:24:30 -0400 From: Andreas Schwab To: "Robert P. J. Day" Cc: Andrew Morton , Jeremy Fitzhardinge , bbpetkov@yahoo.de, linux-kernel@vger.kernel.org, muli@il.ibm.com, satyam@infradead.org, amitkale@netxen.com, achim_leubner@adaptec.com Subject: Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1 References: <20070918194647.GA23800@gollum.tnic> <20071005124705.6584e2f9.akpm@linux-foundation.org> <4706A20A.5060603@goop.org> <20071005140050.655b7727.akpm@linux-foundation.org> X-Yow: I want to kill everyone here with a cute colorful Hydrogen Bomb!! Date: Fri, 05 Oct 2007 23:24:25 +0200 In-Reply-To: (Robert P. J. Day's message of "Fri\, 5 Oct 2007 17\:03\:28 -0400 \(EDT\)") Message-ID: User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 911 Lines: 26 "Robert P. J. Day" writes: > On Fri, 5 Oct 2007, Andrew Morton wrote: > >> -#define DMA_BIT_MASK(n) ((1ULL<<(n))-1) >> +#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) > > or you could take advantage of the macros in kernel.h and write that > as: > > +#define DMA_BIT_MASK(n) (((n) == 64) ? ULLONG_MAX : ((1ULL<<(n))-1)) #define DMA_BIT_MASK(n) ((u64)-1 >> (64 - (n))) Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, Maxfeldstra?e 5, 90409 N?rnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." - 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/