summaryrefslogtreecommitdiff
path: root/chip/mchp/watchdog.c
diff options
context:
space:
mode:
authorGwendal Grignou <gwendal@chromium.org>2019-03-11 15:57:52 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-03-26 04:42:55 -0700
commitbb266fc26fc05d4ab22de6ad7bce5b477c9f9140 (patch)
treef6ada087f62246c3a9547e649ac8846b0ed6d5ab /chip/mchp/watchdog.c
parent0bfc511527cf2aebfa163c63a1d028419ca0b0c3 (diff)
downloadchrome-ec-bb266fc26fc05d4ab22de6ad7bce5b477c9f9140.tar.gz
common: replace 1 << digits, with BIT(digits)
Requested for linux integration, use BIT instead of 1 << First step replace bit operation with operand containing only digits. Fix an error in motion_lid try to set bit 31 of a signed integer. BUG=None BRANCH=None TEST=compile Change-Id: Ie843611f2f68e241f0f40d4067f7ade726951d29 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1518659 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'chip/mchp/watchdog.c')
-rw-r--r--chip/mchp/watchdog.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/chip/mchp/watchdog.c b/chip/mchp/watchdog.c
index 03edeb414e..0533155e08 100644
--- a/chip/mchp/watchdog.c
+++ b/chip/mchp/watchdog.c
@@ -17,9 +17,9 @@ void watchdog_reload(void)
#ifdef CONFIG_WATCHDOG_HELP
/* Reload the auxiliary timer */
- MCHP_TMR16_CTL(0) &= ~(1 << 5);
+ MCHP_TMR16_CTL(0) &= ~BIT(5);
MCHP_TMR16_CNT(0) = CONFIG_AUX_TIMER_PERIOD_MS;
- MCHP_TMR16_CTL(0) |= 1 << 5;
+ MCHP_TMR16_CTL(0) |= BIT(5);
#endif
}
DECLARE_HOOK(HOOK_TICK, watchdog_reload, HOOK_PRIO_DEFAULT);
@@ -38,10 +38,10 @@ int watchdog_init(void)
MCHP_PCR_SLP_DIS_DEV(MCHP_PCR_BTMR16_0);
/* Stop the auxiliary timer if it's running */
- MCHP_TMR16_CTL(0) &= ~(1 << 5);
+ MCHP_TMR16_CTL(0) &= ~BIT(5);
/* Enable auxiliary timer */
- MCHP_TMR16_CTL(0) |= 1 << 0;
+ MCHP_TMR16_CTL(0) |= BIT(0);
val = MCHP_TMR16_CTL(0);
@@ -49,10 +49,10 @@ int watchdog_init(void)
val = (val & 0xffff) | (47999 << 16);
/* No auto restart */
- val &= ~(1 << 3);
+ val &= ~BIT(3);
/* Count down */
- val &= ~(1 << 2);
+ val &= ~BIT(2);
MCHP_TMR16_CTL(0) = val;
@@ -63,7 +63,7 @@ int watchdog_init(void)
/* Load and start the auxiliary timer */
MCHP_TMR16_CNT(0) = CONFIG_AUX_TIMER_PERIOD_MS;
- MCHP_TMR16_CNT(0) |= 1 << 5;
+ MCHP_TMR16_CNT(0) |= BIT(5);
#endif
/* Clear WDT PCR sleep enable */
@@ -75,7 +75,7 @@ int watchdog_init(void)
/* Start watchdog */
#ifdef CONFIG_CHIPSET_DEBUG
/* WDT will not count if JTAG TRST# is pulled high by JTAG cable */
- MCHP_WDG_CTL = (1 << 4) | (1 << 0);
+ MCHP_WDG_CTL = BIT(4) | BIT(0);
#else
MCHP_WDG_CTL |= 1;
#endif