[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180719.081054.2060054138371290633.davem@davemloft.net>
Date: Thu, 19 Jul 2018 08:10:54 +0900 (KST)
From: David Miller <davem@...emloft.net>
To: brgl@...ev.pl
Cc: nsekhar@...com, khilman@...nel.org, linux@...linux.org.uk,
grygorii.strashko@...com, srinivas.kandagatla@...aro.org,
lukas@...ner.de, robh@...nel.org, f.fainelli@...il.com,
dan.carpenter@...cle.com, ivan.khoronzhuk@...aro.org,
david@...hnology.com, gregkh@...uxfoundation.org, andrew@...n.ch,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-omap@...r.kernel.org, netdev@...r.kernel.org,
bgolaszewski@...libre.com
Subject: Re: [PATCH 1/5] net: visually shrink eth_platform_get_mac_address()
From: Bartosz Golaszewski <brgl@...ev.pl>
Date: Wed, 18 Jul 2018 18:10:31 +0200
> @@ -527,15 +527,10 @@ unsigned char * __weak arch_get_platform_mac_address(void)
>
> int eth_platform_get_mac_address(struct device *dev, u8 *mac_addr)
> {
> - const unsigned char *addr;
> - struct device_node *dp;
> + struct device_node *dp = dev_is_pci(dev) ?
> + pci_device_to_OF_node(to_pci_dev(dev)) : dev->of_node;
> + const unsigned char *addr = NULL;
>
> - if (dev_is_pci(dev))
> - dp = pci_device_to_OF_node(to_pci_dev(dev));
> - else
> - dp = dev->of_node;
> -
Reverse christmas tree is why the assignments are in the body of
the function instead of the declaration area.
Please don't do this, thanks.
Powered by blists - more mailing lists