From 2134f9b72dc205ffb08aef5f2d9fc5cfacd58fee Mon Sep 17 00:00:00 2001 From: Mulin Chao Date: Sun, 7 Mar 2021 22:23:12 -0800 Subject: [PATCH] driver: clock: npcx: remove useless operands. Remove useless operands since 'bit' field of npcx_clk_cfg structure is only 3-bit depth and always under 8. Signed-off-by: Mulin Chao --- drivers/clock_control/clock_control_npcx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clock_control/clock_control_npcx.c b/drivers/clock_control/clock_control_npcx.c index 9b52af4ae8a..db8e0072b4a 100644 --- a/drivers/clock_control/clock_control_npcx.c +++ b/drivers/clock_control/clock_control_npcx.c @@ -39,7 +39,7 @@ static inline int npcx_clock_control_on(const struct device *dev, struct npcx_clk_cfg *clk_cfg = (struct npcx_clk_cfg *)(sub_system); const uint32_t pmc_base = DRV_CONFIG(dev)->base_pmc; - if (clk_cfg->ctrl >= NPCX_PWDWN_CTL_COUNT || clk_cfg->bit >= 8) + if (clk_cfg->ctrl >= NPCX_PWDWN_CTL_COUNT) return -EINVAL; /* Clear related PD (Power-Down) bit of module to turn on clock */ @@ -54,7 +54,7 @@ static inline int npcx_clock_control_off(const struct device *dev, struct npcx_clk_cfg *clk_cfg = (struct npcx_clk_cfg *)(sub_system); const uint32_t pmc_base = DRV_CONFIG(dev)->base_pmc; - if (clk_cfg->ctrl >= NPCX_PWDWN_CTL_COUNT || clk_cfg->bit >= 8) + if (clk_cfg->ctrl >= NPCX_PWDWN_CTL_COUNT) return -EINVAL; /* Set related PD (Power-Down) bit of module to turn off clock */