From: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
To: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Realtek linux nic maintainers <nic_swsd@realtek.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Paolo Abeni <pabeni@redhat.com>, Jakub Kicinski <kuba@kernel.org>,
David Miller <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Simon Horman <horms@kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next] r8169: simplify setting hwmon attribute visibility
Date: Wed, 4 Dec 2024 11:06:20 +0100 [thread overview]
Message-ID: <Z1ApnLK0fYS0dAeY@mev-dev.igk.intel.com> (raw)
In-Reply-To: <dba77e76-be45-4a30-96c7-45e284072ad2@gmail.com>
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
next prev parent reply other threads:[~2024-12-04 10:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-03 21:33 [PATCH net-next] r8169: simplify setting hwmon attribute visibility Heiner Kallweit
2024-12-04 10:06 ` Michal Swiatkowski [this message]
2024-12-05 3:50 ` patchwork-bot+netdevbpf
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=Z1ApnLK0fYS0dAeY@mev-dev.igk.intel.com \
--to=michal.swiatkowski@linux.intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nic_swsd@realtek.com \
--cc=pabeni@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.