]> git.baikalelectronics.ru Git - kernel.git/commit
staging: rtl8192u: use min_t/max_t macros instead of if else
authorRebecca Mckeever <remckee0@gmail.com>
Fri, 8 Apr 2022 01:12:51 +0000 (20:12 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 13:43:36 +0000 (15:43 +0200)
commitd082d9d3db742d54f7206aaa8026a0a8c220e02e
tree063ccc5db8d29bb666fa6f6ae4d450f46212ef97
parent90fc468ec32f08da4dfab86f6e65558ae7540959
staging: rtl8192u: use min_t/max_t macros instead of if else

Replace if else statement with min_t or max_t macros to increase
readability and conform to Linux kernel coding style. The _t versions
of the macros must be used to avoid applying typeof to the bit fields
pPeerHTCap->MaxRxAMPDUFactor, and pPeerHTCap->MPDUDensity.

Using u32 assures the reader that the value with not be truncated
without having to look up the types of the variables involved.
Found with minmax coccinelle script.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rebecca Mckeever <remckee0@gmail.com>
Link: https://lore.kernel.org/r/65518c0b366bf199903c6c530774c61ba6087165.1649378587.git.remckee0@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c