Re: [PATCH] power: supply: qcom_battmgr: remove bogus do_div()

From: Linus Torvalds
Date: Wed Mar 01 2023 - 13:51:27 EST


On Wed, Mar 1, 2023 at 10:16 AM Nathan Chancellor <nathan@xxxxxxxxxx> wrote:
>
> Would you be able to take this patch directly? It seems obviously
> correctTM, has an ack from Sebastian [1], and without it, 32-bit
> allmodconfig builds are broken [2] (the other warning in that log has a
> fix on the way to you soon).

Ok, I've taken it directly.

However, the whole "seems obviously correct" is true in the sense that
it now doesn't complain (and doesn't overwrite an "int" with a 64-bit
value.

The actual code still looks odd. Is that return value for
BATT_CAPACITY truly in that odd "hundredths of percent" format, where
dividing it by 100 gives you whole percent?

Because "hundredths of percent" strikes me as a very odd interface.
Even for some firmware interface. I realize that anything is possible
with strange firmware, but still...

Linus