• Guenter Roeck's avatar
    hwmon: (core) Simplify sysfs attribute name allocation · 3a412d5e
    Guenter Roeck authored
    Allocating the sysfs attribute name only if needed and only with the
    required minimum length looks optimal, but does not take the additional
    overhead for both devm_ data structures and the allocation header itself
    into account. This also results in unnecessary memory fragmentation.
    Move the sysfs name string into struct hwmon_device_attribute and give it
    a sufficient length to reduce this overhead.
    Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
    3a412d5e
hwmon.c 23.1 KB