summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/ar5xxx.h6
-rw-r--r--sys/dev/ic/athnreg.h6
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/ic/ar5xxx.h b/sys/dev/ic/ar5xxx.h
index a9980517223..511a4c12292 100644
--- a/sys/dev/ic/ar5xxx.h
+++ b/sys/dev/ic/ar5xxx.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ar5xxx.h,v 1.56 2016/01/12 09:28:09 stsp Exp $ */
+/* $OpenBSD: ar5xxx.h,v 1.57 2016/12/18 14:34:20 kettenis Exp $ */
/*
* Copyright (c) 2004, 2005, 2006, 2007 Reyk Floeter <reyk@openbsd.org>
@@ -1373,9 +1373,9 @@ typedef HAL_BOOL (ar5k_rfgain_t)
bus_space_read_4(hal->ah_st, hal->ah_sh, (_reg))
#define AR5K_REG_SM(_val, _flags) \
- (((_val) << _flags##_S) & (_flags))
+ (((uint32_t)(_val) << _flags##_S) & (_flags))
#define AR5K_REG_MS(_val, _flags) \
- (((_val) & (_flags)) >> _flags##_S)
+ (((uint32_t)(_val) & (_flags)) >> _flags##_S)
#define AR5K_REG_WRITE_BITS(_reg, _flags, _val) \
AR5K_REG_WRITE(_reg, (AR5K_REG_READ(_reg) &~ (_flags)) | \
(((_val) << _flags##_S) & (_flags)))
diff --git a/sys/dev/ic/athnreg.h b/sys/dev/ic/athnreg.h
index f35358d1634..45d72fea749 100644
--- a/sys/dev/ic/athnreg.h
+++ b/sys/dev/ic/athnreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: athnreg.h,v 1.18 2012/06/10 21:23:36 kettenis Exp $ */
+/* $OpenBSD: athnreg.h,v 1.19 2016/12/18 14:34:20 kettenis Exp $ */
/*-
* Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr>
@@ -1472,11 +1472,11 @@
*/
/* Mask and Shift (getter). */
#define MS(val, field) \
- (((val) & field##_M) >> field##_S)
+ (((uint32_t)(val) & field##_M) >> field##_S)
/* Shift and Mask (setter). */
#define SM(field, val) \
- (((val) << field##_S) & field##_M)
+ (((uint32_t)(val) << field##_S) & field##_M)
/* Rewrite. */
#define RW(var, field, val) \