Message ID | 20190307104900.2506657-1-arnd@arndb.de |
---|---|
State | New |
Headers | show |
Series | [v3] dma-mapping: work around clang bug | expand |
NAK on this whole patch. Please fix the compiler instead of making a complete mess of a common macro.
On Fri, Mar 8, 2019 at 7:27 AM Christoph Hellwig <hch@lst.de> wrote: > > NAK on this whole patch. Please fix the compiler instead of making > a complete mess of a common macro. Definitely on the TODO list; higher priority, but not highest right now. I'll see if I can get some help with it. -- Thanks, ~Nick Desaulniers
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 75e60be91e5f..5788d60c2223 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h @@ -138,7 +138,11 @@ struct dma_map_ops { extern const struct dma_map_ops dma_virt_ops; extern const struct dma_map_ops dma_dummy_ops; -#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) +/* + * Shifting '2' instead of '1' because of + * https://bugs.llvm.org/show_bug.cgi?id=38789 + */ +#define DMA_BIT_MASK(n) (((n) == 0) ? 0ULL : (2ULL<<((n)-1))-1) #define DMA_MASK_NONE 0x0ULL