Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1070351imm; Wed, 18 Jul 2018 16:11:51 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeNbI84w2OCEfUYFYieEVxfad2KrKocwi5vjVMXqU5fQdvJKIngxjd3H7Fc3yJLn+BPYi1H X-Received: by 2002:a62:569c:: with SMTP id h28-v6mr7076896pfj.201.1531955510946; Wed, 18 Jul 2018 16:11:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531955510; cv=none; d=google.com; s=arc-20160816; b=J07ugxI3+MgNsJYLH0gyNCv5b2awt6FB2Bdd1MlAjKiVYOR8SwRUK6L/SBYz3Y7co8 /Rsx+JkSbECq5MGP2zqjW3lVgKaOAqpbIzkGd/9R36FkI2C/Um6TuMeNbPmfMwKY2stG O6A/TmsfoMLwe/8LeM5AXLezapQtUAASyIK93Isp+I4Upb5zaLhYqq/IQHawasgtSOqj 5cXWUHFIz22qphf5zMqAr7DQp+2isRQTf19hHRVZxcLXM9Aim2t5bmpLEhu50EVVt2f4 z0M63dq1FV/LfCGrJWSGh3zhbzXoFGKFCssi7qSxhwJaD7yy9QpdrIdu4S2y8GzcNiBL 18Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date :arc-authentication-results; bh=DUXCBCnI9CNbUXog1lVLMzE4oAjOybQfcgDQI3Dj/FI=; b=Feeb9ycm9QWtoML7oCvAQrw6TcJN7qsDy0MGXYr92dImWtJOWBt+gnZ42oKKnzZ3d0 EUpggaOOm0+lprzolhZoc9//H7WPX64KLRCh4cUpcx9vaQ5A7hzQ8XToouyH0nLa8THV ROsLWZ3CBMOO5juWTm5dHyA+J2SY9VPCH6F7K9aVH69PbSF83kB/YsBkvi5bXnDWxzkN p6GSxV4EGimHkiHwJrAoJ7N4aR2r7sTZclWMFWrWf2sUs/3Ycjuv6XflXwMELtMGL/Vg 8tlFYYSv2dqttH3aCW+aWHdL9RgGVeXa5uI6ZyKyl3ufCmRQrw8u6+GZ/EsZNaoTKOII TvDw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l184-v6si4260204pge.257.2018.07.18.16.11.36; Wed, 18 Jul 2018 16:11:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730514AbeGRXvI (ORCPT + 99 others); Wed, 18 Jul 2018 19:51:08 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:45486 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726985AbeGRXvI (ORCPT ); Wed, 18 Jul 2018 19:51:08 -0400 Received: from localhost (unknown [172.58.43.198]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id A83C11007FA43; Wed, 18 Jul 2018 16:10:57 -0700 (PDT) Date: Thu, 19 Jul 2018 08:10:54 +0900 (KST) Message-Id: <20180719.081054.2060054138371290633.davem@davemloft.net> To: brgl@bgdev.pl Cc: nsekhar@ti.com, khilman@kernel.org, linux@armlinux.org.uk, grygorii.strashko@ti.com, srinivas.kandagatla@linaro.org, lukas@wunner.de, robh@kernel.org, f.fainelli@gmail.com, dan.carpenter@oracle.com, ivan.khoronzhuk@linaro.org, david@lechnology.com, gregkh@linuxfoundation.org, andrew@lunn.ch, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, netdev@vger.kernel.org, bgolaszewski@baylibre.com Subject: Re: [PATCH 1/5] net: visually shrink eth_platform_get_mac_address() From: David Miller In-Reply-To: <20180718161035.7005-2-brgl@bgdev.pl> References: <20180718161035.7005-1-brgl@bgdev.pl> <20180718161035.7005-2-brgl@bgdev.pl> X-Mailer: Mew version 6.7 on Emacs 26 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Wed, 18 Jul 2018 16:10:59 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bartosz Golaszewski 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.