spi: Replace if-else-if by bitops and multiplications
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 10 Jul 2023 15:49:20 +0000 (18:49 +0300)
committerMark Brown <broonie@kernel.org>
Mon, 10 Jul 2023 17:27:44 +0000 (18:27 +0100)
commit2b308e7176e366a52a07a49868e3b1a295e56785
tree4fe69f82ce75a9a58616459590397f5bedae9dea
parent440c47331bdb889e24128c75387c695ca81d9b9b
spi: Replace if-else-if by bitops and multiplications

Instead of if-else-if, simply call roundup_pow_of_two(BITS_PER_BYTES()).
Note, there is no division assumed as compiler may optimize it away.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230710154932.68377-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi.c