From 549ad0801382ee595fcb87f8eaeb7e7c951c0b28 Mon Sep 17 00:00:00 2001 From: Petro Karashchenko Date: Sun, 25 Aug 2024 16:22:52 -0400 Subject: [PATCH] can/sja1000: drop driver dependency on __builtin functions Signed-off-by: Petro Karashchenko --- drivers/can/sja1000.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/can/sja1000.c b/drivers/can/sja1000.c index 7b01a01087..4894bf2384 100644 --- a/drivers/can/sja1000.c +++ b/drivers/can/sja1000.c @@ -917,8 +917,6 @@ static void sja1000_set_acc_filter(struct sja1000_dev_s *priv, bool single_filter) { uint32_t regval; - uint32_t code_swapped = __builtin_bswap32(code); - uint32_t mask_swapped = __builtin_bswap32(mask); regval = sja1000_getreg(priv, SJA1000_MODE_REG); if (single_filter) @@ -935,9 +933,9 @@ static void sja1000_set_acc_filter(struct sja1000_dev_s *priv, for (int i = 0; i < 4; i++) { sja1000_putreg(priv, (SJA1000_DATA_0_REG + i), - ((code_swapped >> (i * 8)) & 0xff)); + ((code >> ((3 - i) * 8)) & 0xff)); sja1000_putreg(priv, (SJA1000_DATA_4_REG + i), - ((mask_swapped >> (i * 8)) & 0xff)); + ((mask >> ((3 - i) * 8)) & 0xff)); } }