Subject: Re: [PATCH v3 net-next] net: hns3: support wake on lan configuration and query

From: Simon Horman <[email-masked]>
Date: Sat, 11 Mar 2023 13:15:24 +0100

On Fri, Mar 10, 2023 at 04:14:04PM +0800, Hao Lan wrote:
> The HNS3 driver supports Wake-on-LAN, which can wake up
> the server from power off state to power on state by magic
> packet or magic security packet.
> 
> ChangeLog:
> v1->v2:
> Deleted the debugfs function that overlaps with the ethtool function
> from suggestion of Andrew Lunn.
> 
> v2->v3:
> Return the wol configuration stored in driver,
> suggested by Alexander H Duyck.
> 
> Signed-off-by: Hao Lan <[email-masked]>

Reviewed-by: Simon Horman <[email-masked]>

...

> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
> index 55306fe8a540..10de2b4c401b 100644
> --- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
> @@ -2063,6 +2063,31 @@ static int hns3_get_link_ext_state(struct net_device *netdev,
>  	return -ENODATA;
>  }
>  
> +static void hns3_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
> +{
> +	struct hnae3_handle *handle = hns3_get_handle(netdev);
> +	struct hnae3_ae_dev *ae_dev = pci_get_drvdata(handle->pdev);
> +	const struct hnae3_ae_ops *ops = handle->ae_algo->ops;

nit: the local variable declarations could be reverse xmas tree
     - longest line to shortest line. One option being:

	const struct hnae3_ae_ops *ops;
	struct hnae3_handle *handle;
	struct hnae3_ae_dev *ae_dev;

	handle = hns3_get_handle(netdev);
	ae_dev = pci_get_drvdata(handle->pdev);
	ops = handle->ae_algo->ops;

Likewise elsewhere in this patch.