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: <Z1ApnLK0fYS0dAeY@mev-dev.igk.intel.com>
Date: Wed, 4 Dec 2024 11:06:20 +0100
From: Michal Swiatkowski <michal.swiatkowski@...ux.intel.com>
To: Heiner Kallweit <hkallweit1@...il.com>
Cc: Realtek linux nic maintainers <nic_swsd@...ltek.com>,
	Andrew Lunn <andrew+netdev@...n.ch>,
	Paolo Abeni <pabeni@...hat.com>, Jakub Kicinski <kuba@...nel.org>,
	David Miller <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>, Simon Horman <horms@...nel.org>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next] r8169: simplify setting hwmon attribute
 visibility

On Tue, Dec 03, 2024 at 10:33:22PM +0100, Heiner Kallweit wrote:
> Use new member visible to simplify setting the static visibility.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@...il.com>
> ---
>  drivers/net/ethernet/realtek/r8169_main.c | 9 +--------
>  1 file changed, 1 insertion(+), 8 deletions(-)
> 
> diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
> index cc14cd540..6934bdee2 100644
> --- a/drivers/net/ethernet/realtek/r8169_main.c
> +++ b/drivers/net/ethernet/realtek/r8169_main.c
> @@ -5332,13 +5332,6 @@ static bool rtl_aspm_is_safe(struct rtl8169_private *tp)
>  	return false;
>  }
>  
> -static umode_t r8169_hwmon_is_visible(const void *drvdata,
> -				      enum hwmon_sensor_types type,
> -				      u32 attr, int channel)
> -{
> -	return 0444;
> -}
> -
>  static int r8169_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
>  			    u32 attr, int channel, long *val)
>  {
> @@ -5355,7 +5348,7 @@ static int r8169_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
>  }
>  
>  static const struct hwmon_ops r8169_hwmon_ops = {
> -	.is_visible =  r8169_hwmon_is_visible,
> +	.visible = 0444,
>  	.read = r8169_hwmon_read,
>  };

Nice simplification, thanks. I checked that it is the only driver under
ethernet that use fixed value in is_visible().

Reviewed-by: Michal Swiatkowski <michal.swiatkowski@...ux.intel.com>
>  
> -- 
> 2.47.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ