From: "Thomas Weißschuh" <linux@weissschuh.net>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Jean Delvare <jdelvare@suse.com>,
linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hwmon: (core) Avoid ifdef in C source file
Date: Fri, 15 Nov 2024 17:33:44 +0100 [thread overview]
Message-ID: <dc879ed8-a8be-48c5-a4f3-18f09d3cbfb2@t-8ch.de> (raw)
In-Reply-To: <20fde375-a88a-4279-a849-520063217de9@roeck-us.net>
On 2024-11-15 08:31:27-0800, Guenter Roeck wrote:
> Hi Thomas,
>
> On Wed, Nov 13, 2024 at 05:39:16AM +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>
> > ---
>
> I decided to apply the patch despite my concerns about the lack
> of dummy functions. Let's see if it blows up in our face; if so,
> I'll revert it.
It will blow up because of the missing declaration/stub for
thermal_zone_device_update()
Thomas
next prev parent reply other threads:[~2024-11-15 16:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-13 4:39 Thomas Weißschuh
2024-11-13 6:52 ` Guenter Roeck
2024-11-14 4:40 ` Thomas Weißschuh
2024-11-14 6:51 ` Guenter Roeck
2024-11-14 7:27 ` Thomas Weißschuh
2024-11-14 14:40 ` Guenter Roeck
2024-11-14 16:07 ` Thomas Weißschuh
2024-11-15 16:31 ` Guenter Roeck
2024-11-15 16:33 ` Thomas Weißschuh [this message]
2024-11-15 16:34 ` Guenter Roeck
2024-11-15 16:36 ` Guenter Roeck
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=dc879ed8-a8be-48c5-a4f3-18f09d3cbfb2@t-8ch.de \
--to=linux@weissschuh.net \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
/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®