summaryrefslogtreecommitdiff
path: root/drivers/power
diff options
context:
space:
mode:
authorNathan Chancellor <natechancellor@gmail.com>2019-09-28 19:22:24 -0700
committerMichael Bestas <mkbestas@lineageos.org>2020-02-02 01:41:08 +0200
commitce8bf528cca2f55327c1b3f1698f329909dddda6 (patch)
tree8ad5508e64906ad587328d2132187d642217bedb /drivers/power
parent8099b2c2cec5fc8750c9bd63e178d389b8cb45cb (diff)
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 <natechancellor@gmail.com>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/supply/qcom/qpnp-fg-gen3.c2
1 files changed, 1 insertions, 1 deletions
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);