Re: drivers/net/can/kvaser_pciefd.c:801:17: sparse: sparse: cast removes address space '<asn:2>' of expression

From: Greg Ungerer
Date: Mon Jun 15 2020 - 03:07:22 EST



On 13/6/20 2:35 am, Luc Van Oostenryck wrote:
On Sat, Jun 13, 2020 at 01:33:16AM +1000, Greg Ungerer wrote:
arch/m68k/include/asm/io_no.h:78:16: sparse: sparse: cast to restricted __le32

This one I am not sure about yet.
Still investigating.

swab32(__raw_readl(addr)) ?

Keeping __le32_to_cpu() will only force you to use ugly casts for no benefits
and the comment above explain clearly the situation about the endianness.

That is unfortunate, the use of le32_to_cpu() made it very clear
what was going on - for those that don't choose to read comments.

In any case that would seem to be the cleanest solution.
Patch to follow.

Regards
Greg