From cf0c32df384c629d446285ff547eb7d4e5545dcf Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Sat, 28 Sep 2019 19:22:24 -0700 Subject: [PATCH] power: qpnp-fg-gen3: Silence an instance of -Wsizeof-array-div in clear_cycle_counter Clang warns: ../drivers/power/supply/qcom/qpnp-fg-gen3.c:2611:32: warning: expression does not compute the number of elements in this array; element type is 'u16' (aka 'unsigned short'), not 'u8 *' (aka 'unsigned char *') [-Wsizeof-array-div] sizeof(chip->cyc_ctr.count) / sizeof(u8 *), ~~~~~~~~~~~~~~~~~~~ ^ ../drivers/power/supply/qcom/qpnp-fg-gen3.c:2611:32: note: place parentheses around the 'sizeof(u8 *)' expression to silence this warning 1 warning generated. Odds are this is intentional given the casting so silence the warning. Signed-off-by: Nathan Chancellor --- drivers/power/supply/qcom/qpnp-fg-gen3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/power/supply/qcom/qpnp-fg-gen3.c b/drivers/power/supply/qcom/qpnp-fg-gen3.c index a546621d0837..243c865e6877 100644 --- a/drivers/power/supply/qcom/qpnp-fg-gen3.c +++ b/drivers/power/supply/qcom/qpnp-fg-gen3.c @@ -2608,7 +2608,7 @@ static void clear_cycle_counter(struct fg_chip *chip) } rc = fg_sram_write(chip, CYCLE_COUNT_WORD, CYCLE_COUNT_OFFSET, (u8 *)&chip->cyc_ctr.count, - sizeof(chip->cyc_ctr.count) / sizeof(u8 *), + sizeof(chip->cyc_ctr.count) / (sizeof(u8 *)), FG_IMA_DEFAULT); if (rc < 0) pr_err("failed to clear cycle counter rc=%d\n", rc);