From: Guenter Roeck <linux@roeck-us.net>
To: "Thomas Weißschuh" <linux@weissschuh.net>
Cc: Jean Delvare <jdelvare@suse.com>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
Zhang Rui <rui.zhang@intel.com>,
Lukasz Luba <lukasz.luba@arm.com>,
linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-pm@vger.kernel.org
Subject: Re: [PATCH v3 2/2] hwmon: (core) Avoid ifdef CONFIG_THERMAL in C source file
Date: Mon, 25 Nov 2024 09:09:58 -0800 [thread overview]
Message-ID: <8d922f80-5641-41f2-8062-4c82280f8830@roeck-us.net> (raw)
In-Reply-To: <20241118-hwmon-thermal-v3-2-9c17973e7342@weissschuh.net>
On Mon, Nov 18, 2024 at 07:15:59AM +0100, 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@weissschuh.net>
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Applied.
Thanks,
Guenter
prev parent reply other threads:[~2024-11-25 17:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-18 6:15 [PATCH v3 0/2] " Thomas Weißschuh
2024-11-18 6:15 ` [PATCH v3 1/2] thermal: core: Add stub for thermal_zone_device_update() Thomas Weißschuh
2024-11-25 14:12 ` Rafael J. Wysocki
2024-11-25 17:09 ` Guenter Roeck
2024-11-18 6:15 ` [PATCH v3 2/2] hwmon: (core) Avoid ifdef CONFIG_THERMAL in C source file Thomas Weißschuh
2024-11-25 17:09 ` 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=8d922f80-5641-41f2-8062-4c82280f8830@roeck-us.net \
--to=linux@roeck-us.net \
--cc=daniel.lezcano@linaro.org \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux@weissschuh.net \
--cc=lukasz.luba@arm.com \
--cc=rafael@kernel.org \
--cc=rui.zhang@intel.com \
/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
all inboxes | Powered by JetHome®