Skip to content

Commit

Permalink
power: qpnp-fg-gen3: Silence an instance of -Wsizeof-array-div in cle…
Browse files Browse the repository at this point in the history
…ar_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 <[email protected]>
  • Loading branch information
nathanchance committed Sep 29, 2019
1 parent 012665e commit cf0c32d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/power/supply/qcom/qpnp-fg-gen3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit cf0c32d

Please sign in to comment.