lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <51c9b886-be97-4fe4-bc22-35d1c727b93c@roeck-us.net>
Date: Fri, 15 Nov 2024 08:36:36 -0800
From: Guenter Roeck <linux@...ck-us.net>
To: Thomas Weißschuh <linux@...ssschuh.net>
Cc: Jean Delvare <jdelvare@...e.com>, linux-hwmon@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] hwmon: (core) Avoid ifdef in C source file

On Fri, Nov 15, 2024 at 08:34:47AM -0800, Guenter Roeck wrote:
> On Fri, Nov 15, 2024 at 08:31:29AM -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@...ssschuh.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.
> 
> Ah, no, that didn't work, because if CONFIG_THERMAL=n there isn't
> even an external declaration for thermal_zone_device_update().
> 

allnoconfig+CONFIG_HWMON:

drivers/hwmon//hwmon.c: In function ‘hwmon_thermal_notify’:
drivers/hwmon//hwmon.c:302:25: error: implicit declaration of function ‘thermal_zone_device_update’; did you mean ‘thermal_zone_device_disable’? [-Werror=implicit-function-declaration]
  302 |                         thermal_zone_device_update(tzdata->tzd,

Guenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ