From ac77140b7f4f42075d2377fc9d956a636b05aacf Mon Sep 17 00:00:00 2001 From: Gwendal Grignou Date: Mon, 11 Mar 2019 16:07:55 -0700 Subject: common: bit change 1 << constants with BIT(constants) Mechanical replacement of bit operation where operand is a constant. More bit operation exist, but prone to errors. Reveal a bug in npcx: chip/npcx/system-npcx7.c:114:54: error: conversion from 'long unsigned int' to 'uint8_t' {aka 'volatile unsigned char'} changes value from '16777215' to '255' [-Werror=overflow] BUG=None BRANCH=None TEST=None Change-Id: I006614026143fa180702ac0d1cc2ceb1b3c6eeb0 Signed-off-by: Gwendal Grignou Reviewed-on: https://chromium-review.googlesource.com/1518660 Reviewed-by: Daisuke Nojiri --- board/rammus/board.c | 2 +- board/rammus/board.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'board/rammus') diff --git a/board/rammus/board.c b/board/rammus/board.c index 7497ac8aa5..31b0a3fb10 100644 --- a/board/rammus/board.c +++ b/board/rammus/board.c @@ -441,7 +441,7 @@ static void board_init(void) * floating SPI buffer input (MISO), which causes power leakage (see * b/64797021). */ - NPCX_PUPD_EN1 |= (1 << NPCX_DEVPU1_F_SPI_PUD_EN); + NPCX_PUPD_EN1 |= BIT(NPCX_DEVPU1_F_SPI_PUD_EN); /* Provide AC status to the PCH */ gpio_set_level(GPIO_PCH_ACPRESENT, extpower_is_present()); diff --git a/board/rammus/board.h b/board/rammus/board.h index da8f311fca..66c79f9317 100644 --- a/board/rammus/board.h +++ b/board/rammus/board.h @@ -278,7 +278,7 @@ void board_reset_pd_mcu(void); void board_set_tcpc_power_mode(int port, int mode); /* Sensors without hardware FIFO are in forced mode */ -#define CONFIG_ACCEL_FORCE_MODE_MASK (1 << LID_ACCEL) +#define CONFIG_ACCEL_FORCE_MODE_MASK BIT(LID_ACCEL) #endif /* !__ASSEMBLER__ */ -- cgit v1.2.1