Re: [PATCH] staging: vt6656: Use BIT_ULL() macro instead of bit shift operation

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

 



On Sat, Mar 07, 2020 at 11:49:29AM +0100, Oscar Carter wrote:
> Replace the bit left shift operation with the BIT_ULL() macro and remove
> the unnecessary "and" operation against the bit_nr variable.
> 
> Signed-off-by: Oscar Carter <oscar.carter@xxxxxxx>
> ---
>  drivers/staging/vt6656/main_usb.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c
> index 5e48b3ddb94c..f7ca9e97594d 100644
> --- a/drivers/staging/vt6656/main_usb.c
> +++ b/drivers/staging/vt6656/main_usb.c
> @@ -21,6 +21,7 @@
>   */
>  #undef __NO_VERSION__
> 
> +#include <linux/bits.h>
>  #include <linux/etherdevice.h>
>  #include <linux/file.h>
>  #include "device.h"
> @@ -802,8 +803,7 @@ static u64 vnt_prepare_multicast(struct ieee80211_hw *hw,
> 
>  	netdev_hw_addr_list_for_each(ha, mc_list) {
>  		bit_nr = ether_crc(ETH_ALEN, ha->addr) >> 26;
> -
> -		mc_filter |= 1ULL << (bit_nr & 0x3f);
> +		mc_filter |= BIT_ULL(bit_nr);

Are you sure this does the same thing?  You are not masking off bit_nr
anymore, why not?

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux