Re: [PATCH v2] drivers: hv: vmbus: Fix build on Clang 12 failed by DMA_BIT_MASK(64) expansion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 04, 2022 at 05:26:27AM +0300, Vitaly Chikunov wrote:
> Clang 12.0.1 cannot understand that value 64 is excluded from the shift
> at compile time (for use in global context) resulting in build error[1]:
> 
>   drivers/hv/vmbus_drv.c:2082:29: error: shift count >= width of type [-Werror,-Wshift-count-overflow]
>   static u64 vmbus_dma_mask = DMA_BIT_MASK(64);
> 			      ^~~~~~~~~~~~~~~~
>   ./include/linux/dma-mapping.h:76:54: note: expanded from macro 'DMA_BIT_MASK'
>   #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
> 						       ^ ~~~
> 
> Avoid using DMA_BIT_MASK macro for that corner case.
> 
> Cc: Tianyu Lan <Tianyu.Lan@xxxxxxxxxxxxx>
> Cc: Michael Kelley <mikelley@xxxxxxxxxxxxx>
> Cc: Long Li <longli@xxxxxxxxxxxxx>
> Cc: Wei Liu <wei.liu@xxxxxxxxxx>
> Link: https://lore.kernel.org/linux-hyperv/20220203235828.hcsj6najsl7yxmxa@xxxxxxxxxxxx/

BTW there is no need to put in a Link tag here. The tool I use (b4)
handles this automatically.

Wei.



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux