Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp703956imm; Wed, 18 Jul 2018 09:14:10 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdHqUFNQRTJxMZI9G8xumraavSa8Hnvrs7QWI73JQzE9RJRi8tJrmgyxvY6MeDMtX14pf5m X-Received: by 2002:a63:1b5c:: with SMTP id b28-v6mr6546047pgm.204.1531930449959; Wed, 18 Jul 2018 09:14:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531930449; cv=none; d=google.com; s=arc-20160816; b=tZsfUQevRLMUnneah15hIzfm2lAGRywmFQRQvSwxO8gLXBTGhKJrxWs+bx43xXJD9v b8KeU0yDbZXH6hO2t5Q2pX5oSbC+kt/LWsoOIjwmvAffd+ihPlpW1u1uNNP9qmWybeID W+f82oUTYLrmxZCzhOu36xU8AGMlK2JdAA7sKbUSL5dNv5kdpikSu6VmSCUC0P38Au60 UJEZs6EVnTRBsGcmy0l6nHp//eqkTCQ3zD3OvntAKF4rqYBGCKzI0CJ5p60r92pqhDPC Qf/LfAnaRP02YY0LhPlu5V0ElTNUbZr/UObA7JF3R/C5eoql8zFR2HlGQxzULFLn7bIO rIug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=AZzCltgnNdPyeZzXiMFjWCg4GFVgDog5WHEdONSaQYA=; b=hSZ2Z8MmetB/B0egWo8dzCanD+e8pgmnWiXymk5e5wxl/izDf0rdBgOrn4k51JTk9r vGQl1AzRH3uiPY0GtrbpHbGxoOiShCfUegJoPVZHqWjJGKa9ec8YihoTGxAtV7yfGOgP klmK6ZpLYCSckIuXaeURhjPADygsXtc/dayROvHMErrMlWbXISWpx1bzcipi+WbnlzXP Reyir6aggfuWqkw8+VUGmf6dBS2SJQqcHmEfkZoiyF1dpGniDm9QpVt+/MsNm4af4DxD trrQCu+g2TR1faPuDyxTw0slVI6eVNURtLPd6D8MY99Mw7cH7TJ+J0BT71341LzBxZJ2 j8fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=0YpQBTGj; 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 f9-v6si3348515plo.206.2018.07.18.09.13.55; Wed, 18 Jul 2018 09:14:09 -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=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=0YpQBTGj; 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 S1731562AbeGRQtV (ORCPT + 99 others); Wed, 18 Jul 2018 12:49:21 -0400 Received: from mail-wm0-f48.google.com ([74.125.82.48]:40599 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731452AbeGRQtU (ORCPT ); Wed, 18 Jul 2018 12:49:20 -0400 Received: by mail-wm0-f48.google.com with SMTP id z13-v6so3447667wma.5 for ; Wed, 18 Jul 2018 09:10:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=AZzCltgnNdPyeZzXiMFjWCg4GFVgDog5WHEdONSaQYA=; b=0YpQBTGjX84ndXw1Qum4CiP3P2WxZurvYZThnuNXWR08RnwbPI4e2GjvoVhUdyEBth GxlkSsth9vK6cOICNeN9DdEtvnvF74ZfP3/vuLuJArkElGJV1YNsYRqHCgERqCOVHQ34 SXrgeL6dBhbLeWlU8Z4JNeI7RB6s/eLqa5j0O8lkGcKo1fiwwLM83cgkxhwz4wrhhNVD RnVS5Emrddpb289sl2cJYb1sfT2soXpIJtm9c/RgLXQ7nwb7a6BfGQBCBO4F2wXAPiuK MYGpqbtrLZDXIke2bNcTOC1WtgoXZsWF8a0yEQWSQyaY0AHTRjHGwPKg8wJzrA55WbPG FDdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=AZzCltgnNdPyeZzXiMFjWCg4GFVgDog5WHEdONSaQYA=; b=XtXPc6s/gh8zEQzk0HFXMX13pIqchJB5BOCi4owGW6Yf+EMH4y15YBEaPtBzU7U+uI xvzXyzOZgzcpFgLnlxch96sPi6Hw+2V97/S398wFRxK8wTaALZQvhu0YYS5z6jBflnBB fEgUsZaaPGzzxOBI+M1nxxBihx22TLdjcfNLXHvIRTvMAr4LgNHQWeur3c0R4L7LDU9x E5Eal/GRDX7DiHs3Ocx1Wuon5MXQVPmwbd6ILQFfqTGxn2W4fAoQQ2nDf+iwNHdqWHNN OjQhbt++fu6MJo/hJFzs9/jWwzWIU5JsZ7KbQBLVlTGcdOf6aRRRdMzGmWBzwkguJYmr RgPA== X-Gm-Message-State: AOUpUlGVH53w8yNZGL2K181EBawoiGkpDT3zLdAQgWGvNZwtlyCy1+U1 0xwTLTnepa8PCOT/+g+n3Jg5PQ== X-Received: by 2002:a1c:888e:: with SMTP id k136-v6mr2069766wmd.6.1531930243447; Wed, 18 Jul 2018 09:10:43 -0700 (PDT) Received: from brgl-bgdev.home ([2a01:cb1d:af:5b00:e837:b8d5:48c1:571b]) by smtp.gmail.com with ESMTPSA id v185-v6sm2847803wme.30.2018.07.18.09.10.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Jul 2018 09:10:42 -0700 (PDT) From: Bartosz Golaszewski To: 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 , Andrew Lunn Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, netdev@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 1/5] net: visually shrink eth_platform_get_mac_address() Date: Wed, 18 Jul 2018 18:10:31 +0200 Message-Id: <20180718161035.7005-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180718161035.7005-1-brgl@bgdev.pl> References: <20180718161035.7005-1-brgl@bgdev.pl> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; - if (dev_is_pci(dev)) - dp = pci_device_to_OF_node(to_pci_dev(dev)); - else - dp = dev->of_node; - - addr = NULL; if (dp) addr = of_get_mac_address(dp); if (!addr) -- 2.17.1