From a95c39e39e6417ffe098fbada137abd83485aadd Mon Sep 17 00:00:00 2001 From: dlg Date: Wed, 3 Jan 2018 23:11:06 +0000 Subject: [PATCH] assign 1 instead of the result of htole16(1) to a uint8_t. on big endian archs the 1 is shifted to the high byte, which then gets lost when it's assigned to the uint8_t. at worst we lose the value, at best the compiler has a teary and fixes it. this is the fix for a compiler teary. ok claudio@ --- sys/dev/ic/malo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/ic/malo.c b/sys/dev/ic/malo.c index 552d9303b9d..5f7e233818d 100644 --- a/sys/dev/ic/malo.c +++ b/sys/dev/ic/malo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: malo.c,v 1.116 2017/10/26 15:00:28 mpi Exp $ */ +/* $OpenBSD: malo.c,v 1.117 2018/01/03 23:11:06 dlg Exp $ */ /* * Copyright (c) 2006 Claudio Jeker @@ -620,7 +620,7 @@ malo_alloc_rx_ring(struct malo_softc *sc, struct malo_rx_ring *ring, int count) goto fail; } - desc->status = htole16(1); + desc->status = 1; desc->physdata = htole32(data->map->dm_segs->ds_addr); desc->physnext = htole32(ring->physaddr + (i + 1) % count * sizeof(struct malo_rx_desc)); -- 2.20.1