diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2018-01-03 23:11:07 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2018-01-03 23:11:07 +0000 |
commit | 5084311c58e8aa0ac1b5a65779a687a9e8ee4a29 (patch) | |
tree | 307cb6a371d20f6ee0496b7fc0bc70813345c225 /sys/dev | |
parent | 050dc7bf0f38acd812e081a11a1a0ba12e8a5dae (diff) |
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@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ic/malo.c | 4 |
1 files 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 <claudio@openbsd.org> @@ -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)); |