[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <16ff1f86-8de2-4522-8f9a-51f5110bb365@roeck-us.net>
Date: Fri, 15 Nov 2024 09:13:07 -0800
From: Guenter Roeck <linux@...ck-us.net>
To: Thomas Weißschuh <linux@...ssschuh.net>,
Jean Delvare <jdelvare@...e.com>, "Rafael J. Wysocki" <rafael@...nel.org>,
Daniel Lezcano <daniel.lezcano@...aro.org>, Zhang Rui <rui.zhang@...el.com>,
Lukasz Luba <lukasz.luba@....com>
Cc: linux-hwmon@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-pm@...r.kernel.org
Subject: Re: [PATCH v2 2/2] hwmon: (core) Avoid ifdef CONFIG_THERMAL in C
source file
On 11/15/24 08:40, Thomas Weißschuh wrote:
> Using an #ifdef in a C source files to have different definitions
> of the same symbol makes the code harder to read and understand.
> Furthermore it makes it harder to test compilation of the different
> branches.
>
> Replace the ifdeffery with IS_ENABLED() which is just a normal
> conditional.
> The resulting binary is still the same as before as the compiler
> optimizes away all the unused code and definitions.
>
> Signed-off-by: Thomas Weißschuh <linux@...ssschuh.net>
For my reference:
Reviewed-by: Guenter Roeck <linux@...ck-us.net>
Pending acceptance of the first patch in the series.
Thanks,
Guenter
Powered by blists - more mailing lists