Commit 9273220c authored by Emilio G. Cota's avatar Emilio G. Cota Committed by David Gibson

bitmap: add endianness casts

sparse yells at us when it realises we are implicitly casting an
endian type (big endian) to a plain unsigned long.

Get rid of this warning by telling sparse that we know what
we are doing.
Signed-off-by: default avatarEmilio G. Cota <cota@braap.org>
parent 8f6c40bc
......@@ -38,9 +38,9 @@ static inline bitmap *bitmap_alloc(int nbits)
static inline bitmap_word bitmap_bswap(bitmap_word w)
{
if (BITMAP_WORD_BITS == 32)
return cpu_to_be32(w);
return (ENDIAN_CAST bitmap_word)cpu_to_be32(w);
else if (BITMAP_WORD_BITS == 64)
return cpu_to_be64(w);
return (ENDIAN_CAST bitmap_word)cpu_to_be64(w);
}
#define BITMAP_WORD(_bm, _n) ((_bm)[(_n) / BITMAP_WORD_BITS].w)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment