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/poppy/board.c | 2 +- board/poppy/board.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'board/poppy') diff --git a/board/poppy/board.c b/board/poppy/board.c index 235389fc89..36ba4561eb 100644 --- a/board/poppy/board.c +++ b/board/poppy/board.c @@ -521,7 +521,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_ACOK, extpower_is_present()); diff --git a/board/poppy/board.h b/board/poppy/board.h index 92d15ce0f7..a79216bb63 100644 --- a/board/poppy/board.h +++ b/board/poppy/board.h @@ -269,7 +269,7 @@ void board_set_tcpc_power_mode(int port, int mode); void base_detect_interrupt(enum gpio_signal signal); /* Sensors without hardware FIFO are in forced mode */ -#define CONFIG_ACCEL_FORCE_MODE_MASK (1 << LID_ALS) +#define CONFIG_ACCEL_FORCE_MODE_MASK BIT(LID_ALS) #endif /* !__ASSEMBLER__ */ -- cgit v1.2.1