Hi,
The following code causes a sparse warning about " incorrect type in assignment (different base types)"
__le16 var = 0xFFFF;
What would be the best way of fixing this warning?
a) __le16 var = cpu_to_le16(0xFFFF);
b) __le16 var = (__force __le16) 0xFFFF;
c) Ignore the warning and/or fix the sparse tool to not warn about endianness mismatch on an "all 1s" assignment
thanks,
-Sathya
On Thu, Apr 16, 2015 at 06:04:40AM +0000, Sathya Perla wrote:
> What would be the best way of fixing this warning?
>
> a) __le16 var = cpu_to_le16(0xFFFF);
That would do just fine - it's a constant expression, actually.