From: Andrew Morton <akpm@linux-foundation.org>
To: bbpetkov@yahoo.de
Cc: linux-kernel@vger.kernel.org, jeremy@goop.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
Date: Fri, 5 Oct 2007 12:47:05 -0700 [thread overview]
Message-ID: <20071005124705.6584e2f9.akpm@linux-foundation.org> (raw)
In-Reply-To: <20070918194647.GA23800@gollum.tnic>
On Tue, 18 Sep 2007 21:46:47 +0200
Borislav Petkov <bbpetkov@yahoo.de> wrote:
> These patches remove redundant DMA_..BIT_MASK definitions across two
> drivers. The computation of the majority of the bitmasks is done by the
> compiler. The initial split of the patch touching each a different file got
> removed due to possible git bisect breakage.
>
> Andrew, can you please apply this patch for it touches drivers maintained by
> different people and i there might be responsibility issues, imho.
>
> Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
> Cc: Jeremy Fitzhardinge <jeremy@goop.org>
> Cc: Muli Ben-Yehuda <muli@il.ibm.com>
>
> drivers/net/netxen/netxen_nic_main.c | 3 ---
> drivers/scsi/gdth.c | 5 -----
> include/linux/dma-mapping.h | 23 +++++++++++++----------
> 3 files changed, 13 insertions(+), 18 deletions(-)
>
> ...
>
> -#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 (~0ULL)
> +#define DMA_48BIT_MASK DMA_BIT_MASK(48)
> +#define DMA_40BIT_MASK DMA_BIT_MASK(40)
> +#define DMA_39BIT_MASK DMA_BIT_MASK(39)
> +#define DMA_35BIT_MASK DMA_BIT_MASK(35)
> +#define DMA_32BIT_MASK DMA_BIT_MASK(32)
> +#define DMA_31BIT_MASK DMA_BIT_MASK(31)
> +#define DMA_30BIT_MASK DMA_BIT_MASK(30)
> +#define DMA_29BIT_MASK DMA_BIT_MASK(29)
> +#define DMA_28BIT_MASK DMA_BIT_MASK(28)
> +#define DMA_24BIT_MASK DMA_BIT_MASK(24)
>
Now that you've done this, those DMA_xxBIT_MASK macros are pointless and
stupid and we should aim to get rid of them.
From: Andrew Morton <akpm@linux-foundation.org>
Now that we have DMA_BIT_MASK(), these macros are pointless.
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
include/linux/dma-mapping.h | 6 ++++++
1 file changed, 6 insertions(+)
diff -puN include/linux/dma-mapping.h~a include/linux/dma-mapping.h
--- a/include/linux/dma-mapping.h~a
+++ a/include/linux/dma-mapping.h
@@ -15,6 +15,12 @@ enum dma_data_direction {
#define DMA_BIT_MASK(n) ((1ULL<<(n))-1)
+/*
+ * NOTE: do not use the below macros in new code and do not add new definitions
+ * here.
+ *
+ * Instead, just open-code DMA_BIT_MASK(n) within your driver
+ */
#define DMA_64BIT_MASK (~0ULL)
#define DMA_48BIT_MASK DMA_BIT_MASK(48)
#define DMA_47BIT_MASK DMA_BIT_MASK(47)
_
next prev parent reply other threads:[~2007-10-05 19:47 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-18 19:46 [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1 Borislav Petkov
2007-09-19 15:03 ` Satyam Sharma
2007-10-05 19:47 ` Andrew Morton [this message]
2007-10-05 20:43 ` Jeremy Fitzhardinge
2007-10-05 21:00 ` Andrew Morton
2007-10-05 21:03 ` Robert P. J. Day
2007-10-05 21:23 ` Jeremy Fitzhardinge
2007-10-06 7:54 ` Borislav Petkov
2007-10-05 21:24 ` Andreas Schwab
2007-10-05 21:28 ` Jeremy Fitzhardinge
2007-10-05 22:24 ` Andrew Morton
2007-10-05 22:32 ` Jeremy Fitzhardinge
2007-10-06 8:37 ` 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=20071005124705.6584e2f9.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=achim_leubner@adaptec.com \
--cc=amitkale@netxen.com \
--cc=bbpetkov@yahoo.de \
--cc=jeremy@goop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=muli@il.ibm.com \
--cc=satyam@infradead.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