Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jeremy Fitzhardinge <jeremy@...>
Cc: <bbpetkov@...>, <linux-kernel@...>, <muli@...>, <satyam@...>, <amitkale@...>, <achim_leubner@...>
Date: Friday, October 5, 2007 - 5:00 pm

On Fri, 05 Oct 2007 13:43:54 -0700
Jeremy Fitzhardinge <jeremy@goop.org> wrote:


doh.  Thanks.

--- a/include/linux/dma-mapping.h~stop-using-dma_xxbit_mask-fix
+++ a/include/linux/dma-mapping.h
@@ -13,7 +13,7 @@ enum dma_data_direction {
 	DMA_NONE = 3,
 };
 
-#define DMA_BIT_MASK(n)	((1ULL<<(n))-1)
+#define DMA_BIT_MASK(n)	(((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
 
 /*
  * NOTE: do not use the below macros in new code and do not add new definitions
@@ -21,7 +21,7 @@ enum dma_data_direction {
  *
  * Instead, just open-code DMA_BIT_MASK(n) within your driver
  */
-#define DMA_64BIT_MASK	(~0ULL)
+#define DMA_64BIT_MASK	DMA_BIT_MASK(64)
 #define DMA_48BIT_MASK	DMA_BIT_MASK(48)
 #define DMA_47BIT_MASK	DMA_BIT_MASK(47)
 #define DMA_40BIT_MASK	DMA_BIT_MASK(40)
_


it's irksome that there doesn't seem to be a neater way of doing
this, until they give us unsigned long long longs.
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1, Borislav Petkov, (Tue Sep 18, 3:46 pm)
Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1, Andrew Morton, (Fri Oct 5, 3:47 pm)
Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1, Jeremy Fitzhardinge, (Fri Oct 5, 4:43 pm)
Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1, Andrew Morton, (Fri Oct 5, 5:00 pm)
Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1, Borislav Petkov, (Sat Oct 6, 4:37 am)
Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1, Robert P. J. Day, (Fri Oct 5, 5:03 pm)
Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1, Andreas Schwab, (Fri Oct 5, 5:24 pm)
Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1, Jeremy Fitzhardinge, (Fri Oct 5, 5:28 pm)
Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1, Andrew Morton, (Fri Oct 5, 6:24 pm)
Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1, Jeremy Fitzhardinge, (Fri Oct 5, 6:32 pm)
Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1, Jeremy Fitzhardinge, (Fri Oct 5, 5:23 pm)
Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1, Borislav Petkov, (Sat Oct 6, 3:54 am)
Re: [PATCH 1/1] unify DMA_..BIT_MASK definitions: v3.1, Satyam Sharma, (Wed Sep 19, 11:03 am)