From: Muli Ben-Yehuda <muli@il.ibm.com>
To: Borislav Petkov <bbpetkov@yahoo.de>
Cc: linux-kernel@vger.kernel.org, Jeremy Fitzhardinge <jeremy@goop.org>
Subject: Re: [PATCH 0/2] unify DMA_..BIT_MASK definitions: v1
Date: Tue, 18 Sep 2007 07:58:03 +0200 [thread overview]
Message-ID: <20070918055803.GB4640@rhun.haifa.ibm.com> (raw)
In-Reply-To: <20070918042919.GA8998@gollum.tnic>
On Tue, Sep 18, 2007 at 06:29:19AM +0200, Borislav Petkov wrote:
> These patches remove redundant DMA_..BIT_MASK definitions across two drivers.
> In this version of the patches, the computation of the bitmasks is done by
> the compiler.
>
> Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
> Cc: Jeremy Fitzhardinge <jeremy@goop.org>
>
> --
> Index: 23-rc6/include/linux/dma-mapping.h
> ===================================================================
> --- 23-rc6/include/linux/dma-mapping.h.orig 2007-09-17 17:48:20.000000000 +0200
> +++ 23-rc6/include/linux/dma-mapping.h 2007-09-18 06:12:33.000000000 +0200
> @@ -13,16 +13,19 @@
> DMA_NONE = 3,
> };
>
> -#define DMA_64BIT_MASK 0xffffffffffffffffULL
> -#define DMA_48BIT_MASK 0x0000ffffffffffffULL
> -#define DMA_40BIT_MASK 0x000000ffffffffffULL
> -#define DMA_39BIT_MASK 0x0000007fffffffffULL
> -#define DMA_32BIT_MASK 0x00000000ffffffffULL
> -#define DMA_31BIT_MASK 0x000000007fffffffULL
> -#define DMA_30BIT_MASK 0x000000003fffffffULL
> -#define DMA_29BIT_MASK 0x000000001fffffffULL
> -#define DMA_28BIT_MASK 0x000000000fffffffULL
> -#define DMA_24BIT_MASK 0x0000000000ffffffULL
> +#define DMA_BIT_MASK(n) ((1ULL<<(n))-1)
> +
> +#define DMA_64BIT_MASK DMA_BIT_MASK(64)
This one does not do what you mean. You need an explicit mask or a
~0ULL here.
Cheers,
Muli
next prev parent reply other threads:[~2007-09-18 5:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-18 4:29 Borislav Petkov
2007-09-18 5:58 ` Muli Ben-Yehuda [this message]
2007-09-18 6:01 ` Jeremy Fitzhardinge
2007-09-18 6:08 ` Borislav Petkov
2007-09-18 6:16 ` Satyam Sharma
2007-09-18 6:34 ` Borislav Petkov
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=20070918055803.GB4640@rhun.haifa.ibm.com \
--to=muli@il.ibm.com \
--cc=bbpetkov@yahoo.de \
--cc=jeremy@goop.org \
--cc=linux-kernel@vger.kernel.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®