[ofw] libibnetdisc: fix cast in unmarshall16

Hefty, Sean sean.hefty at intel.com
Mon Jul 26 11:40:30 PDT 2010


Uri Habusha reported a build error on windows as a result of an
incorrect cast to uint64_t.

Signed-off-by: Sean Hefty <sean.hefty at intel.com>
---
 .../libibnetdisc/src/ibnetdisc_cache.c             |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/infiniband-diags/libibnetdisc/src/ibnetdisc_cache.c b/infiniband-diags/libibnetdisc/src/ibnetdisc_cache.c
index 1de42eb..199bf33 100644
--- a/infiniband-diags/libibnetdisc/src/ibnetdisc_cache.c
+++ b/infiniband-diags/libibnetdisc/src/ibnetdisc_cache.c
@@ -183,8 +183,7 @@ static size_t _unmarshall8(uint8_t * inbuf, uint8_t * num)
 
 static size_t _unmarshall16(uint8_t * inbuf, uint16_t * num)
 {
-	(*num) = (uint64_t) inbuf[0];
-	(*num) |= ((uint16_t) inbuf[1] << 8);
+	(*num) = ((uint16_t) inbuf[1] << 8) | inbuf[0];
 
 	return (sizeof(*num));
 }





More information about the ofw mailing list