Re: [PATCH 2/5] power: supply: bd71828: Fix current direction
From: Andy Shevchenko
Date: Wed Aug 12 2026 - 04:22:14 EST
On Wed, Aug 12, 2026 at 10:10:50AM +0200, Andreas Kemnade wrote:
> On Mon, 10 Aug 2026 13:09:07 +0300
> Matti Vaittinen <matti.vaittinen@xxxxxxxxx> wrote:
...
> That code is complicated. What about a generic 16bit non_2complemented sign
> to 2-complemented sign function/macro. Such would have prevented the error
> in the first places. So &vals[i] = signbit_to_2complement(be16_to_cpu(tmp_curr), 15) * pwr->curr_factor
Do you mean existing sign_extend32() from bitops.h?
--
With Best Regards,
Andy Shevchenko