From 9273220c47005235da7cfed1221e13dd19065093 Mon Sep 17 00:00:00 2001 From: "Emilio G. Cota" Date: Thu, 19 Dec 2013 01:00:15 -0500 Subject: [PATCH] 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: Emilio G. Cota --- ccan/bitmap/bitmap.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ccan/bitmap/bitmap.h b/ccan/bitmap/bitmap.h index f43449d7..50086c06 100644 --- a/ccan/bitmap/bitmap.h +++ b/ccan/bitmap/bitmap.h @@ -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) -- 2.39.2