lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <VI1PR04MB5807DD62C1A2E733CC7CC129F2919@VI1PR04MB5807.eurprd04.prod.outlook.com>
Date:   Thu, 21 Jul 2022 13:15:07 +0000
From:   Camelia Alexandra Groza <camelia.groza@....com>
To:     Sean Anderson <sean.anderson@...o.com>,
        "David S . Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Madalin Bucur <madalin.bucur@....com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC:     Paolo Abeni <pabeni@...hat.com>,
        Eric Dumazet <edumazet@...gle.com>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        Russell King <linux@...linux.org.uk>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Sean Anderson <sean.anderson@...o.com>
Subject: RE: [PATCH net-next v3 35/47] net: dpaa: Use mac_dev variable in
 dpaa_netdev_init

> -----Original Message-----
> From: Sean Anderson <sean.anderson@...o.com>
> Sent: Saturday, July 16, 2022 1:00
> To: David S . Miller <davem@...emloft.net>; Jakub Kicinski
> <kuba@...nel.org>; Madalin Bucur <madalin.bucur@....com>;
> netdev@...r.kernel.org
> Cc: Paolo Abeni <pabeni@...hat.com>; Eric Dumazet
> <edumazet@...gle.com>; linux-arm-kernel@...ts.infradead.org; Russell
> King <linux@...linux.org.uk>; linux-kernel@...r.kernel.org; Sean Anderson
> <sean.anderson@...o.com>
> Subject: [PATCH net-next v3 35/47] net: dpaa: Use mac_dev variable in
> dpaa_netdev_init
> 
> There are several references to mac_dev in dpaa_netdev_init. Make things a
> bit more concise by adding a local variable for it.
> 
> Signed-off-by: Sean Anderson <sean.anderson@...o.com>
> ---
> 
> (no changes since v1)
> 
>  drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> index d378247a6d0c..377e5513a414 100644
> --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
> @@ -203,6 +203,7 @@ static int dpaa_netdev_init(struct net_device
> *net_dev,
>  {
>  	struct dpaa_priv *priv = netdev_priv(net_dev);
>  	struct device *dev = net_dev->dev.parent;
> +	struct mac_device *mac_dev = priv->mac_dev;
>  	struct dpaa_percpu_priv *percpu_priv;
>  	const u8 *mac_addr;
>  	int i, err;
> @@ -216,10 +217,10 @@ static int dpaa_netdev_init(struct net_device
> *net_dev,
>  	}
> 
>  	net_dev->netdev_ops = dpaa_ops;
> -	mac_addr = priv->mac_dev->addr;
> +	mac_addr = mac_dev->addr;
> 
> -	net_dev->mem_start = (unsigned long)priv->mac_dev->vaddr;
> -	net_dev->mem_end = (unsigned long)priv->mac_dev->vaddr_end;
> +	net_dev->mem_start = (unsigned long)mac_dev->vaddr;
> +	net_dev->mem_end = (unsigned long)mac_dev->vaddr_end;
> 
>  	net_dev->min_mtu = ETH_MIN_MTU;
>  	net_dev->max_mtu = dpaa_get_max_mtu();
> @@ -246,7 +247,7 @@ static int dpaa_netdev_init(struct net_device
> *net_dev,
>  		eth_hw_addr_set(net_dev, mac_addr);
>  	} else {
>  		eth_hw_addr_random(net_dev);
> -		err = priv->mac_dev->change_addr(priv->mac_dev-
> >fman_mac,
> +		err = priv->mac_dev->change_addr(mac_dev->fman_mac,
>  			(const enet_addr_t *)net_dev->dev_addr);

You can replace priv->mac_dev->change_addr with mac_dev->change_addr as well.

>  		if (err) {
>  			dev_err(dev, "Failed to set random MAC address\n");
> --
> 2.35.1.1320.gc452695387.dirty

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ