[PATCH 6/6] power: supply: Change usb_types from an array into a bitmask

Greg Kroah-Hartman gregkh at linuxfoundation.org
Tue Sep 3 00:04:52 PDT 2024


On Sat, Aug 31, 2024 at 04:20:39PM +0200, Hans de Goede wrote:
> The bit_types array just hold a list of valid enum power_supply_usb_type
> values which map to 0 - 9. This can easily be represented as a bitmap.
> 
> This reduces the size of struct power_supply_desc and further reduces
> the data section size by drivers no longer needing to store the array.
> 
> This also unifies how usb_types are handled with charge_behaviours,
> which allows power_supply_show_usb_type() to be removed.
> 
> Signed-off-by: Hans de Goede <hdegoede at redhat.com>

Nice!

Reviewed-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>



More information about the linux-phy mailing list