[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZGtTW1sNDT8si9/r@corigine.com>
Date: Mon, 22 May 2023 13:34:51 +0200
From: Simon Horman <simon.horman@...igine.com>
To: Justin Chen <justin.chen@...adcom.com>
Cc: netdev@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-media@...r.kernel.org,
dri-devel@...ts.freedesktop.org,
bcm-kernel-feedback-list@...adcom.com, justinpopo6@...il.com,
f.fainelli@...il.com, davem@...emloft.net,
florian.fainelli@...adcom.com, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, robh+dt@...nel.org,
krzysztof.kozlowski+dt@...aro.org, opendmb@...il.com,
andrew@...n.ch, hkallweit1@...il.com, linux@...linux.org.uk,
richardcochran@...il.com, sumit.semwal@...aro.org,
christian.koenig@....com
Subject: Re: [PATCH net-next v3 3/6] net: bcmasp: Add support for ASP2.0
Ethernet controller
On Fri, May 19, 2023 at 02:19:41PM -0700, Justin Chen wrote:
> Add support for the Broadcom ASP 2.0 Ethernet controller which is first
> introduced with 72165. This controller features two distinct Ethernet
> ports that can be independently operated.
>
> This patch supports:
>
> - Wake-on-LAN using magic packets
> - basic ethtool operations (link, counters, message level)
> - MAC destination address filtering (promiscuous, ALL_MULTI, etc.)
>
> Signed-off-by: Florian Fainelli <florian.fainelli@...adcom.com>
> Signed-off-by: Justin Chen <justin.chen@...adcom.com>
...
> +static netdev_tx_t bcmasp_xmit(struct sk_buff *skb, struct net_device *dev)
> +{
> + struct bcmasp_intf *intf = netdev_priv(dev);
> + struct device *kdev = &intf->parent->pdev->dev;
> + int spb_index, nr_frags, ret, i, j;
> + unsigned int total_bytes, size;
> + struct bcmasp_tx_cb *txcb;
> + dma_addr_t mapping, valid;
> + struct bcmasp_desc *desc;
> + bool csum_hw = false;
> + skb_frag_t *frag;
Hi Justin,
Please use reverse xmas tree order - lognest line to shortest - for local
variables, even in cases of assignment such as this one.
In this case I would suggest splitting the declarations and assignment
of kdev. Something line this:
struct bcmasp_intf *intf = netdev_priv(dev);
int spb_index, nr_frags, ret, i, j;
unsigned int total_bytes, size;
struct bcmasp_tx_cb *txcb;
dma_addr_t mapping, valid;
struct bcmasp_desc *desc;
bool csum_hw = false;
struct device *kdev;
skb_frag_t *frag;
kdev = &intf->parent->pdev->dev;
...
Powered by blists - more mailing lists