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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <af416dbf-240c-4c21-954f-d69420f6bd3d@app.fastmail.com>
Date: Wed, 02 Apr 2025 13:03:49 +0200
From: "Arnd Bergmann" <arnd@...db.de>
To: "Akshay Gupta" <akshay.gupta@....com>, linux-hwmon@...r.kernel.org,
 linux-kernel@...r.kernel.org
Cc: "Guenter Roeck" <linux@...ck-us.net>,
 "Greg Kroah-Hartman" <gregkh@...uxfoundation.org>, shyam-sundar.s-k@....com,
 gautham.shenoy@....com, "Mario Limonciello" <mario.limonciello@....com>,
 naveenkrishna.chatradhi@....com, anand.umarji@....com
Subject: Re: [PATCH v7 03/10] misc: amd-sbi: Move hwmon device sensor as separate
 entity

On Wed, Apr 2, 2025, at 07:58, Akshay Gupta wrote:

> +
> +int create_hwmon_sensor_device(struct device *dev, struct sbrmi_data *data)
> +{
> +	if (IS_REACHABLE(CONFIG_HWMON)) {
> +		struct device *hwmon_dev;
> +
> +		hwmon_dev = devm_hwmon_device_register_with_info(dev, "sbrmi", data,
> +								 &sbrmi_chip_info, NULL);
> +		return PTR_ERR_OR_ZERO(hwmon_dev);
> +	}
> +	return 0;

I just one more problems with this bit. This was already in the
existing code, but should still be addressed:

Using IS_REACHABLE() is usually a sign that the Kconfig dependencies
are wrong. Fix the dependencies instead so the hwmon driver can
only be enabled if the subsystem is enabled. You can either add a
separate Kconfig symbol or make the driver 'depends on HWMON || !HWMON'
to express this.

       Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ