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

net: dsa: sja1105: Remove unneeded cast in sja1105_crc32()

sja1105_unpack() takes a "const void *buf" as its first parameter, so
there is no need to cast away the "const" of the "buf" variable before
calling it.

Drop the cast, as it prevents the compiler performing some checks.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Link: https://lore.kernel.org/r/20210223112003.2223332-1-geert+renesas@glider.be
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Geert Uytterhoeven and committed by
Jakub Kicinski
fcd4ba3b 8f1c0fd2

+1 -1
+1 -1
drivers/net/dsa/sja1105/sja1105_static_config.c
··· 85 85 /* seed */ 86 86 crc = ~0; 87 87 for (i = 0; i < len; i += 4) { 88 - sja1105_unpack((void *)buf + i, &word, 31, 0, 4); 88 + sja1105_unpack(buf + i, &word, 31, 0, 4); 89 89 crc = crc32_le(crc, (u8 *)&word, 4); 90 90 } 91 91 return ~crc;