From 56804062ee467fb46acee6e3531272e256fb6a7f Mon Sep 17 00:00:00 2001 From: msaitoh Date: Tue, 3 Sep 2019 14:26:55 +0000 Subject: Use unsigned to avoid undefined behavior. Found by kUBSan. --- sys/dev/ic/rt2860.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sys/dev') 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 -__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 #include @@ -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; } -- cgit