]> git.baikalelectronics.ru Git - kernel.git/commit
staging: vt6656: Use BIT_ULL() macro instead of bit shift operation
authorOscar Carter <oscar.carter@gmx.com>
Sat, 14 Mar 2020 16:14:41 +0000 (17:14 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Mar 2020 11:28:03 +0000 (12:28 +0100)
commitfd1e58ae1c81aeb457d3a80a83a8df8378ab2b05
tree66f0ff4d6da283ef9afb563dcf3ad262920a7e8d
parent355182d4f36f47a0d03d2e9fc3abeb45f132b838
staging: vt6656: Use BIT_ULL() macro instead of bit shift operation

Replace the bit left shift operation with the BIT_ULL() macro and remove
the unnecessary mask off operation against the bit_nr variable.

This mask is only there for legacy reasons. Originally it was 31 (0x1f)
and the bit_nr variable spread across an mc_filter array with two u32
elements. Now, this mask is not needed because its value is 0x3f and the
mc_filter variable is an u64 type.

In this situation, the 26 bit right shift operation against the value
returned by the ether_crc function set the bit_nr variable to the
following value:

bit 31 to bit 6 -> All 0 (due to the bit shift operation happens over an
unsigned type).

bit 5 to bit 0 -> The 6 msb bits of the value returned by the ether_crc
function.

The purpose of the 0x3f mask against the bit_nr variable is to reset
(set to 0) the 26 msb bits (bit 31 to bit 6), but these bits are yet 0.
So, the mask off operation is now unnecessary.

Signed-off-by: Oscar Carter <oscar.carter@gmx.com>
Link: https://lore.kernel.org/r/20200314161441.4870-1-oscar.carter@gmx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6656/main_usb.c