mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arend van Spriel <arend.vanspriel@broadcom.com>
To: tanzheng <tanzheng@kylinos.cn>, johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] wifi: cfg80211: simplify the code
Date: Mon, 25 Aug 2025 20:50:31 +0200	[thread overview]
Message-ID: <11546959-3090-4070-93fa-349bc64f3bdd@broadcom.com> (raw)
In-Reply-To: <20250825055123.960168-1-tanzheng@kylinos.cn>

On 8/25/2025 7:51 AM, tanzheng wrote:
> Simplifying the code makes it more readable:
> 1.Use dev_name instead of pdev->driver->name.
> 2.There is no need to call wiphy_dev again.

Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>

> Signed-off-by: Zheng tan <tanzheng@kylinos.cn>
> ---
>   net/wireless/ethtool.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/wireless/ethtool.c b/net/wireless/ethtool.c
> index 2613d6ac0fda..0acfdc44b479 100644
> --- a/net/wireless/ethtool.c
> +++ b/net/wireless/ethtool.c
> @@ -10,7 +10,7 @@ void cfg80211_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
>   	struct device *pdev = wiphy_dev(wdev->wiphy);
>   
>   	if (pdev->driver)
> -		strscpy(info->driver, pdev->driver->name,
> +		strscpy(info->driver, dev_name(pdev),
Did you test this with some wifi device before and after applying the 
patch. This is not correct as pdev->driver->name is the name of the 
*driver* and dev_name(pdev) is the name of the *device*. Those are two 
different things.

>   			sizeof(info->driver));
>   	else
>   		strscpy(info->driver, "N/A", sizeof(info->driver));
> @@ -23,7 +23,7 @@ void cfg80211_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
>   	else
>   		strscpy(info->fw_version, "N/A", sizeof(info->fw_version));
>   
> -	strscpy(info->bus_info, dev_name(wiphy_dev(wdev->wiphy)),
> +	strscpy(info->bus_info, dev_name(pdev),

This makes sense.

>   		sizeof(info->bus_info));
>   }
>   EXPORT_SYMBOL(cfg80211_get_drvinfo);

  reply	other threads:[~2025-08-25 18:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-25  5:51 tanzheng
2025-08-25 18:50 ` Arend van Spriel [this message]
2025-08-26  3:16   ` tanzheng

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=11546959-3090-4070-93fa-349bc64f3bdd@broadcom.com \
    --to=arend.vanspriel@broadcom.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=tanzheng@kylinos.cn \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®