From: Guenter Roeck <linux@roeck-us.net>
To: Alexandru Soponar <asoponar@taladin.ro>,
linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org,
linux-iio@vger.kernel.org, linux-leds@vger.kernel.org,
linux-watchdog@vger.kernel.org
Cc: jdelvare@suse.com, jic23@kernel.org, pavel@ucw.cz,
lee@kernel.org, baocheng.su@siemens.com, wim@linux-watchdog.org,
tobias.schaffner@siemens.com,
angelogioacchino.delregno@collabora.com,
benedikt.niedermayr@siemens.com, matthias.bgg@gmail.com,
aardelean@baylibre.com, contact@sopy.one
Subject: Re: [PATCH 0/16] lib: Refactor find_closest() and find_closest_descending() from macros to lib functions
Date: Mon, 19 May 2025 08:44:19 -0700 [thread overview]
Message-ID: <d5f5ac0d-830d-47e7-bb2c-55ecea7eddd2@roeck-us.net> (raw)
In-Reply-To: <20250515081332.151250-1-asoponar@taladin.ro>
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>
prev parent reply other threads:[~2025-05-19 15:44 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-15 8:13 [PATCH 0/16] lib: Refactor find_closest() and find_closest_descending() from macros to lib functions Alexandru Soponar
2025-05-15 8:13 ` [PATCH 01/16] hwmon: w83795: Fix type incompatibility with non-macro find_closest Alexandru Soponar
2025-05-15 8:13 ` [PATCH 02/16] hwmon: emc1403: " Alexandru Soponar
2025-05-15 8:13 ` [PATCH 03/16] hwmon: ina3221: " Alexandru Soponar
2025-05-15 8:13 ` [PATCH 04/16] hwmon: lm95234: " Alexandru Soponar
2025-05-15 8:13 ` [PATCH 05/16] hwmon: max1619: " Alexandru Soponar
2025-05-15 8:13 ` [PATCH 06/16] hwmon: lm75: " Alexandru Soponar
2025-05-15 8:13 ` [PATCH 07/16] hwmon: ltc4282: " Alexandru Soponar
2025-05-15 8:13 ` [PATCH 08/16] hwmon: max6639: " Alexandru Soponar
2025-05-15 8:13 ` [PATCH 09/16] hwmon: max20740: " Alexandru Soponar
2025-05-15 8:13 ` [PATCH 10/16] iio: ad7606: " Alexandru Soponar
2025-05-15 17:13 ` Jonathan Cameron
2025-05-15 8:13 ` [PATCH 11/16] iio: mcp3564: " Alexandru Soponar
2025-05-15 17:14 ` Jonathan Cameron
2025-05-19 8:09 ` Marius.Cristea
2025-05-15 8:13 ` [PATCH 12/16] iio: max44009: " Alexandru Soponar
2025-05-15 17:14 ` Jonathan Cameron
2025-05-15 8:13 ` [PATCH 13/16] leds: eds-mt6370-rgb: Fix type incompatibility with find_closest() Alexandru Soponar
2025-05-22 14:33 ` Lee Jones
2025-05-15 8:13 ` [PATCH 14/16] regulator: max77857: " Alexandru Soponar
2025-05-15 8:13 ` [PATCH 15/16] watchdog: simatic-ipc-wdt: " Alexandru Soponar
2025-05-15 8:13 ` [PATCH 16/16] lib: move find_closest() and find_closest_descending() to lib functions Alexandru Soponar
2025-05-19 16:35 ` David Lechner
2025-05-19 15:44 ` Guenter Roeck [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d5f5ac0d-830d-47e7-bb2c-55ecea7eddd2@roeck-us.net \
--to=linux@roeck-us.net \
--cc=aardelean@baylibre.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=asoponar@taladin.ro \
--cc=baocheng.su@siemens.com \
--cc=benedikt.niedermayr@siemens.com \
--cc=contact@sopy.one \
--cc=jdelvare@suse.com \
--cc=jic23@kernel.org \
--cc=lee@kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=pavel@ucw.cz \
--cc=tobias.schaffner@siemens.com \
--cc=wim@linux-watchdog.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox