can: tcan4x5x: tcan4x5x_regmap_write(): remove not needed casts and replace 4 by sizeof
This patch simplifies the tcan4x5x_regmap_write(0 function by removing not needed casts and replaces hardcoded "4" by appropriate sizeof()s. Reviewed-by: Dan Murphy <dmurphy@ti.com> Tested-by: Sean Nyekjaer <sean@geanix.com> Link: https://lore.kernel.org/r/20201215231746.1132907-10-mkl@pengutronix.de Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
parent
52be977b3a
commit
0c05345210
|
@ -38,10 +38,9 @@ static int tcan4x5x_regmap_gather_write(void *context, const void *reg,
|
||||||
|
|
||||||
static int tcan4x5x_regmap_write(void *context, const void *data, size_t count)
|
static int tcan4x5x_regmap_write(void *context, const void *data, size_t count)
|
||||||
{
|
{
|
||||||
u16 *reg = (u16 *)(data);
|
return tcan4x5x_regmap_gather_write(context, data, sizeof(u32),
|
||||||
const u32 *val = data + 4;
|
data + sizeof(u32),
|
||||||
|
count - sizeof(u32));
|
||||||
return tcan4x5x_regmap_gather_write(context, reg, 4, val, count - 4);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tcan4x5x_regmap_read(void *context,
|
static int tcan4x5x_regmap_read(void *context,
|
||||||
|
|
Loading…
Reference in New Issue