Re: [PATCH v6 0/4] power: supply: extension API

From: Thomas Weißschuh
Date: Fri Dec 13 2024 - 16:01:07 EST


On 2024-12-12 15:27:52+0100, Armin Wolf wrote:
> Am 11.12.24 um 20:57 schrieb Thomas Weißschuh:
>
> > Introduce a mechanism for drivers to extend the properties implemented
> > by a power supply.

[..]

> > ---
> > Changes in v6:
> > - Drop alreay picked up ACPI battery hook rename patch
> > - Only return bool from power_supply_property_is_writeable()
> > - Improve naming for test_power symbols
> > - Integrate cros_charge-control fixes from the psy/fixes branch
> > - Add sysfs UAPI for extension discovery
> > - Use __must_check on API
> > - Make power_supply_for_each_extension() safer.
> > (And uglier, ideas welcome)
>
> Maybe we can use a do { ... } while (0) construct here.

I don't think so. The macro needs to expand to a dangling loop
condition. So whatever statement comes after gets executed in the loop.

[..]