[Skiboot] [PATCH 25/36] sparse: fix beint16_t degrades to int in hdata/hdif.c

Stewart Smith stewart at linux.vnet.ibm.com
Tue Nov 10 15:18:19 AEDT 2015


Do the comparison in host endian rather than big endian to silence sparse

hdata/hdif.c:25:16: warning: restricted beint16_t degrades to integer

Signed-off-by: Stewart Smith <stewart at linux.vnet.ibm.com>
---
 hdata/hdif.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hdata/hdif.c b/hdata/hdif.c
index 916b4ddaceb5..25c00008138f 100644
--- a/hdata/hdif.c
+++ b/hdata/hdif.c
@@ -22,7 +22,7 @@ const void *HDIF_get_idata(const struct HDIF_common_hdr *hdif, unsigned int di,
 	const struct HDIF_common_hdr *hdr = hdif;
 	const struct HDIF_idata_ptr *iptr;
 
-	if (hdr->d1f0 != BE16_TO_CPU(0xd1f0)) {
+	if (be16_to_cpu(hdr->d1f0) != 0xd1f0) {
 		prerror("HDIF: Bad header format !\n");
 		return NULL;
 	}
-- 
2.1.4



More information about the Skiboot mailing list