Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

regmap: spi-avmm: Use swabXX_array() helpers

Since we have a few helpers to swab elements of a given size in an array
use them instead of open coded variants.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20220831212744.56435-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Andy Shevchenko and committed by
Mark Brown
26cc2a78 400dceb6

+4 -10
+4 -10
drivers/base/regmap/regmap-spi-avmm.c
··· 7 7 #include <linux/module.h> 8 8 #include <linux/regmap.h> 9 9 #include <linux/spi/spi.h> 10 + #include <linux/swab.h> 10 11 11 12 /* 12 13 * This driver implements the regmap operations for a generic SPI ··· 163 162 /* bridge buffer used in translation between protocol layers */ 164 163 char trans_buf[TRANS_BUF_SIZE]; 165 164 char phy_buf[PHY_BUF_SIZE]; 166 - void (*swap_words)(char *buf, unsigned int len); 165 + void (*swap_words)(void *buf, unsigned int len); 167 166 }; 168 167 169 - static void br_swap_words_32(char *buf, unsigned int len) 168 + static void br_swap_words_32(void *buf, unsigned int len) 170 169 { 171 - u32 *p = (u32 *)buf; 172 - unsigned int count; 173 - 174 - count = len / 4; 175 - while (count--) { 176 - *p = swab32p(p); 177 - p++; 178 - } 170 + swab32_array(buf, len / 4); 179 171 } 180 172 181 173 /*