Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp720733imm; Wed, 18 Jul 2018 09:30:13 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdTJFBG38XnymvfkHgbgyiohCE3VGVyhFOMC4MMpdrbo9QGkP8iiKV/K5B+ZZHgfMeyhTbJ X-Received: by 2002:a65:5b08:: with SMTP id y8-v6mr6311292pgq.297.1531931413681; Wed, 18 Jul 2018 09:30:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531931413; cv=none; d=google.com; s=arc-20160816; b=TW9utNyUKTwFcraUfGYa2e9EShAH59r70BPz03h/pzsfRDMvi+eE2HOEI4OH6It+VX lYZb0O0jSoyflfmtZBihGtrGcfiS1MFY46dLsVNVdnz8Rl1iGd0AJvR6eESfw8vk4h1N CmiICaMqhnKwATZ1xgi0nca2rKAHxIT5tjyuYFzHQqgyo1dnhV4xd0Pos+Y/Tmp05FmV SLYHaLL2q5S87ax1okTtGdgndtbdTKvRydeWrBAfTh1g4EU4mciMjy0fBzTfHj0mC1HY CNuAxBjNr5HO1TGOAVln1uh5OzqTZYFZ4XFGKnYJkOkwvmNKuzlVYTxsEcNlAR4SRCHu hjuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=S2WGeck9CJvob22V0WW66HsQ1t/Ma+gKswxmVDcvHsQ=; b=vk8LOLc0HWtyGS+pbfPQKlCbvIOVyZ6Jwc0FoTavICDbh0DK5iInMHOWjHvjzGsRPy Gvx0YmnZKcPY6UJyyxmHbYs4KZm4EVQCF7kjRGFeb4bVtnW/wkLATwcIs8DlDfsrlnun itnf0pZIiFPk6da1whRslMtzGmf8MpVJOZNwA0LnXJSaYVBpKwVmFbUhdc8y/wlWJZtY 2QQpVnle2e+7O+VtTpRbYLB7xayciulmu1ybureR0FxSU+PkywUVeq2v+xVesEg2n//B 5EcdxsuJtWXGVOdYPtzhLVTYkkUVWO3gI/0+iMysWC2u+628ImQAZWKKuUVddFVrtmte 4NCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=jb7ZlkD9; 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 w16-v6si3982751pfj.144.2018.07.18.09.29.58; Wed, 18 Jul 2018 09:30:13 -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; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=jb7ZlkD9; 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 S1731324AbeGRRID (ORCPT + 99 others); Wed, 18 Jul 2018 13:08:03 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:38742 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731144AbeGRRID (ORCPT ); Wed, 18 Jul 2018 13:08:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=S2WGeck9CJvob22V0WW66HsQ1t/Ma+gKswxmVDcvHsQ=; b=jb7ZlkD9K6wZ3jUgBkjzZ721+VIbAUQnQdJ973RWRsb4n7++VoNLTs//Hz1avqecyvePOTAxavPapRepgV5YIEI0CBXSBfqG75oa9iU1dihL4NzlOXXEGV7d+c8eDInAukyWPRmnssjb65guvH06FZUZSZbfel9mOS/2I84eIKk=; Received: from andrew by vps0.lunn.ch with local (Exim 4.84_2) (envelope-from ) id 1ffpJp-000410-Si; Wed, 18 Jul 2018 18:28:49 +0200 Date: Wed, 18 Jul 2018 18:28:49 +0200 From: Andrew Lunn To: Bartosz Golaszewski Cc: Sekhar Nori , Kevin Hilman , Russell King , Grygorii Strashko , "David S . Miller" , Srinivas Kandagatla , Lukas Wunner , Rob Herring , Florian Fainelli , Dan Carpenter , Ivan Khoronzhuk , David Lechner , Greg Kroah-Hartman , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, netdev@vger.kernel.org, Bartosz Golaszewski Subject: Re: [PATCH 1/5] net: visually shrink eth_platform_get_mac_address() Message-ID: <20180718162849.GA12477@lunn.ch> References: <20180718161035.7005-1-brgl@bgdev.pl> <20180718161035.7005-2-brgl@bgdev.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180718161035.7005-2-brgl@bgdev.pl> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 18, 2018 at 06:10:31PM +0200, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > Initialize the variables with proper values so that we save a few > lines of code before we extend this function in the follow-up patches. > > Signed-off-by: Bartosz Golaszewski > --- > net/ethernet/eth.c | 11 +++-------- > 1 file changed, 3 insertions(+), 8 deletions(-) > > diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c > index ee28440f57c5..da8530879e1e 100644 > --- a/net/ethernet/eth.c > +++ b/net/ethernet/eth.c > @@ -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; Hi Bartosz You are now in the net subsystem, which has its own set of additional coding styles. One of them is reverse Christmas tree. You might want to read Documentation/networking/netdev-FAQ.txt. Andrew