staging: vt6656: Refactor the vnt_ofdm_min_rate function
authorOscar Carter <oscar.carter@gmx.com>
Sat, 18 Apr 2020 13:45:53 +0000 (15:45 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Apr 2020 11:38:08 +0000 (13:38 +0200)
commit9f8c9f4a2e6f23fc6eeecd305bfb40ddc91e0369
treece705bfd2ff713d8405868077160761d34c15c08
parente3436ce60cf5f5eaedda2b8c622f69feb97595e2
staging: vt6656: Refactor the vnt_ofdm_min_rate function

Replace the for loop by a ternary operator whose condition is an AND
bitmask against the priv->basic_rates variable.

The purpose of the for loop was to check if any of bits from RATE_54M to
RATE_6M was set, but it's not necessary to check every individual bit.
The same result can be achieved using only one single mask which
comprises all the commented bits.

This way avoid the iteration over an unnecessary for loop.

Also change the return type to bool because it's the type that this
function returns.

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