netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] r8169: simplify setting hwmon attribute visibility
@ 2024-12-03 21:33 Heiner Kallweit
  2024-12-04 10:06 ` Michal Swiatkowski
  2024-12-05  3:50 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Heiner Kallweit @ 2024-12-03 21:33 UTC (permalink / raw)
  To: Realtek linux nic maintainers, Andrew Lunn, Paolo Abeni,
	Jakub Kicinski, David Miller, Eric Dumazet, Simon Horman
  Cc: netdev@vger.kernel.org

Use new member visible to simplify setting the static visibility.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.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,
 };
 
-- 
2.47.1




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] r8169: simplify setting hwmon attribute visibility
  2024-12-03 21:33 [PATCH net-next] r8169: simplify setting hwmon attribute visibility Heiner Kallweit
@ 2024-12-04 10:06 ` Michal Swiatkowski
  2024-12-05  3:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Michal Swiatkowski @ 2024-12-04 10:06 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: Realtek linux nic maintainers, Andrew Lunn, Paolo Abeni,
	Jakub Kicinski, David Miller, Eric Dumazet, Simon Horman,
	netdev@vger.kernel.org

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@gmail.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@linux.intel.com>
>  
> -- 
> 2.47.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] r8169: simplify setting hwmon attribute visibility
  2024-12-03 21:33 [PATCH net-next] r8169: simplify setting hwmon attribute visibility Heiner Kallweit
  2024-12-04 10:06 ` Michal Swiatkowski
@ 2024-12-05  3:50 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-12-05  3:50 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: nic_swsd, andrew+netdev, pabeni, kuba, davem, edumazet, horms,
	netdev

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 3 Dec 2024 22:33:22 +0100 you wrote:
> Use new member visible to simplify setting the static visibility.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
>  drivers/net/ethernet/realtek/r8169_main.c | 9 +--------
>  1 file changed, 1 insertion(+), 8 deletions(-)

Here is the summary with links:
  - [net-next] r8169: simplify setting hwmon attribute visibility
    https://git.kernel.org/netdev/net-next/c/152d00a91396

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-12-05  3:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-03 21:33 [PATCH net-next] r8169: simplify setting hwmon attribute visibility Heiner Kallweit
2024-12-04 10:06 ` Michal Swiatkowski
2024-12-05  3:50 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).