Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/rockchip Make gate enable/disable logic easier ...
details: https://anonhg.NetBSD.org/src/rev/dd1ca80a4060
branches: trunk
changeset: 319971:dd1ca80a4060
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Sun Jun 17 14:48:15 2018 +0000
description:
Make gate enable/disable logic easier to read. NFC.
diffstat:
sys/arch/arm/rockchip/rk_cru_composite.c | 6 +++---
sys/arch/arm/rockchip/rk_cru_gate.c | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diffs (54 lines):
diff -r 64b9ae2225fc -r dd1ca80a4060 sys/arch/arm/rockchip/rk_cru_composite.c
--- a/sys/arch/arm/rockchip/rk_cru_composite.c Sun Jun 17 13:12:25 2018 +0000
+++ b/sys/arch/arm/rockchip/rk_cru_composite.c Sun Jun 17 14:48:15 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rk_cru_composite.c,v 1.1 2018/06/16 00:19:04 jmcneill Exp $ */
+/* $NetBSD: rk_cru_composite.c,v 1.2 2018/06/17 14:48:15 jmcneill Exp $ */
/*-
* Copyright (c) 2018 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rk_cru_composite.c,v 1.1 2018/06/16 00:19:04 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rk_cru_composite.c,v 1.2 2018/06/17 14:48:15 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -48,7 +48,7 @@
return enable ? 0 : ENXIO;
const uint32_t write_mask = composite->gate_mask << 16;
- const uint32_t write_val = __SHIFTIN(!enable, composite->gate_mask);
+ const uint32_t write_val = enable ? 0 : composite->gate_mask;
CRU_WRITE(sc, composite->gate_reg, write_mask | write_val);
diff -r 64b9ae2225fc -r dd1ca80a4060 sys/arch/arm/rockchip/rk_cru_gate.c
--- a/sys/arch/arm/rockchip/rk_cru_gate.c Sun Jun 17 13:12:25 2018 +0000
+++ b/sys/arch/arm/rockchip/rk_cru_gate.c Sun Jun 17 14:48:15 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rk_cru_gate.c,v 1.1 2018/06/16 00:19:04 jmcneill Exp $ */
+/* $NetBSD: rk_cru_gate.c,v 1.2 2018/06/17 14:48:15 jmcneill Exp $ */
/*-
* Copyright (c) 2018 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rk_cru_gate.c,v 1.1 2018/06/16 00:19:04 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rk_cru_gate.c,v 1.2 2018/06/17 14:48:15 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -45,7 +45,7 @@
KASSERT(clk->type == RK_CRU_GATE);
const uint32_t write_mask = gate->mask << 16;
- const uint32_t write_val = __SHIFTIN(!enable, gate->mask);
+ const uint32_t write_val = enable ? 0 : gate->mask;
CRU_WRITE(sc, gate->reg, write_mask | write_val);
Home |
Main Index |
Thread Index |
Old Index