Message ID | 20250515081332.151250-1-asoponar@taladin.ro |
---|---|
Headers | show |
Series | lib: Refactor find_closest() and find_closest_descending() from macros to lib functions | expand |
On 5/15/25 01:13, Alexandru Soponar wrote: > This patch series converts the find_closest() and find_closest_descending() macros > into proper library functions. The conversion moves these utilities from macro > implementations in util_macros.h to standard C functions in lib/find_closest.c. > > The first 15 patches modify individual callers across hwmon, iio, leds, regulator, > and watchdog subsystems to ensure they work correctly with the new function-based > implementation. This maintains compatibility while allowing the final conversion. > > The final patch implements the actual refactoring by moving the code to > lib/find_closest.c. This approach was chosen based on discussions between > Andrew Morton and Alexandru Ardelean[1], who suggested that a non-inline > implementation would be appropriate given the size of the functions. > > The refactoring avoids of macro expansion-related issues and proper function > prototypes with well-defined parameter types. > > Links: > [1] https://lore.kernel.org/lkml/20241105145406.554365-1-aardelean@baylibre.com/ > > Alexandru Soponar (16): > hwmon: w83795: Fix type incompatibility with non-macro find_closest > hwmon: emc1403: Fix type incompatibility with non-macro find_closest > hwmon: ina3221: Fix type incompatibility with non-macro find_closest > hwmon: lm95234: Fix type incompatibility with non-macro find_closest > hwmon: max1619: Fix type incompatibility with non-macro find_closest > hwmon: lm75: Fix type incompatibility with non-macro find_closest > hwmon: ltc4282: Fix type incompatibility with non-macro find_closest > hwmon: max6639: Fix type incompatibility with non-macro find_closest > hwmon: max20740: Fix type incompatibility with non-macro find_closest > iio: ad7606: Fix type incompatibility with non-macro find_closest > iio: mcp3564: Fix type incompatibility with non-macro find_closest > iio: max44009: Fix type incompatibility with non-macro find_closest > leds: eds-mt6370-rgb: Fix type incompatibility with find_closest() > regulator: max77857: Fix type incompatibility with find_closest() > watchdog: simatic-ipc-wdt: Fix type incompatibility with > find_closest() For the hwmon and watchdog patches: Acked-by: Guenter Roeck <linux@roeck-us.net>