Skip to content

Commit

Permalink
can/sja1000: drop driver dependency on __builtin functions
Browse files Browse the repository at this point in the history
Signed-off-by: Petro Karashchenko <[email protected]>
  • Loading branch information
pkarashchenko committed Sep 18, 2024
1 parent 5d3d123 commit 7eeae37
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/can/sja1000.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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));
}
}

Expand Down

0 comments on commit 7eeae37

Please sign in to comment.