summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authormsaitoh <msaitoh@NetBSD.org>2019-09-03 14:26:55 +0000
committermsaitoh <msaitoh@NetBSD.org>2019-09-03 14:26:55 +0000
commit56804062ee467fb46acee6e3531272e256fb6a7f (patch)
tree58136c5f6c0704fc31220a45a275967128387ed1 /sys/dev
parent916f83c632a39a61677909e42f102aa079080a1a (diff)
Use unsigned to avoid undefined behavior. Found by kUBSan.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/rt2860.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/ic/rt2860.c b/sys/dev/ic/rt2860.c
index f561199a806..39b101bf4bd 100644
--- a/sys/dev/ic/rt2860.c
+++ b/sys/dev/ic/rt2860.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rt2860.c,v 1.33 2018/09/03 16:29:31 riastradh Exp $ */
+/* $NetBSD: rt2860.c,v 1.34 2019/09/03 14:26:55 msaitoh Exp $ */
/* $OpenBSD: rt2860.c,v 1.90 2016/04/13 10:49:26 mpi Exp $ */
/* $FreeBSD: head/sys/dev/ral/rt2860.c 306591 2016-10-02 20:35:55Z avos $ */
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rt2860.c,v 1.33 2018/09/03 16:29:31 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rt2860.c,v 1.34 2019/09/03 14:26:55 msaitoh Exp $");
#include <sys/param.h>
#include <sys/sockio.h>
@@ -2233,7 +2233,7 @@ static void
rt2860_enable_mrr(struct rt2860_softc *sc)
{
#define CCK(mcs) (mcs)
-#define OFDM(mcs) (1 << 3 | (mcs))
+#define OFDM(mcs) (1U << 3 | (mcs))
RAL_WRITE(sc, RT2860_LG_FBK_CFG0,
OFDM(6) << 28 | /* 54->48 */
OFDM(5) << 24 | /* 48->36 */
@@ -3294,7 +3294,7 @@ b4inc(uint32_t b32, int8_t delta)
b4 = 0;
else if (b4 > 0xf)
b4 = 0xf;
- b32 = b32 >> 4 | b4 << 28;
+ b32 = b32 >> 4 | (uint32_t)b4 << 28;
}
return b32;
}