diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/dma-mapping.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 29b028597dcd..101a2d4636be 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
@@ -13,9 +13,15 @@ enum dma_data_direction { | |||
13 | DMA_NONE = 3, | 13 | DMA_NONE = 3, |
14 | }; | 14 | }; |
15 | 15 | ||
16 | #define DMA_BIT_MASK(n) ((1ULL<<(n))-1) | 16 | #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) |
17 | 17 | ||
18 | #define DMA_64BIT_MASK (~0ULL) | 18 | /* |
19 | * NOTE: do not use the below macros in new code and do not add new definitions | ||
20 | * here. | ||
21 | * | ||
22 | * Instead, just open-code DMA_BIT_MASK(n) within your driver | ||
23 | */ | ||
24 | #define DMA_64BIT_MASK DMA_BIT_MASK(64) | ||
19 | #define DMA_48BIT_MASK DMA_BIT_MASK(48) | 25 | #define DMA_48BIT_MASK DMA_BIT_MASK(48) |
20 | #define DMA_47BIT_MASK DMA_BIT_MASK(47) | 26 | #define DMA_47BIT_MASK DMA_BIT_MASK(47) |
21 | #define DMA_40BIT_MASK DMA_BIT_MASK(40) | 27 | #define DMA_40BIT_MASK DMA_BIT_MASK(40) |