diff options
author | 2020-08-22 12:25:09 +0000 | |
---|---|---|
committer | 2020-08-22 12:25:09 +0000 | |
commit | 4896f12a39e1385bca31b2ead547f4aecffa5f64 (patch) | |
tree | 3e1e9e0dfc0340eaa985509bb58c2af4dc520c0a | |
parent | Simplify check for return code. (diff) | |
download | wireguard-openbsd-4896f12a39e1385bca31b2ead547f4aecffa5f64.tar.xz wireguard-openbsd-4896f12a39e1385bca31b2ead547f4aecffa5f64.zip |
More consistent use of the BIT() macro.
-rw-r--r-- | sys/dev/fdt/if_mvpp.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/fdt/if_mvpp.c b/sys/dev/fdt/if_mvpp.c index 7ddc6ef687d..a8ae569bee4 100644 --- a/sys/dev/fdt/if_mvpp.c +++ b/sys/dev/fdt/if_mvpp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_mvpp.c,v 1.20 2020/08/22 12:24:26 patrick Exp $ */ +/* $OpenBSD: if_mvpp.c,v 1.21 2020/08/22 12:25:09 patrick Exp $ */ /* * Copyright (c) 2008, 2019 Mark Kettenis <kettenis@openbsd.org> * Copyright (c) 2017, 2020 Patrick Wildt <patrick@blueri.se> @@ -3268,13 +3268,13 @@ mvpp2_prs_tcam_ai_update(struct mvpp2_prs_entry *pe, uint32_t bits, uint32_t ena int i, ai_idx = MVPP2_PRS_TCAM_AI_BYTE; for (i = 0; i < MVPP2_PRS_AI_BITS; i++) { - if (!(enable & (i << 1))) + if (!(enable & BIT(i))) continue; - if (bits & (i << 1)) - pe->tcam.byte[ai_idx] |= 1 << i; + if (bits & BIT(i)) + pe->tcam.byte[ai_idx] |= BIT(i); else - pe->tcam.byte[ai_idx] &= ~(1 << i); + pe->tcam.byte[ai_idx] &= ~BIT(i); } pe->tcam.byte[MVPP2_PRS_TCAM_EN_OFFS(ai_idx)] |= enable; |