Skip to content
Snippets Groups Projects
Commit 9f8c9f4a authored by Oscar Carter's avatar Oscar Carter Committed by Greg Kroah-Hartman
Browse files

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: default avatarOscar Carter <oscar.carter@gmx.com>
Link: https://lore.kernel.org/r/20200418134553.6415-1-oscar.carter@gmx.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e3436ce6
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment