Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp933627imm; Thu, 4 Oct 2018 05:51:43 -0700 (PDT) X-Google-Smtp-Source: ACcGV60tbDclvd5q+7nGokTfCmLFllarDKwh0CiuBCtyEhXHzlrkSzMOFawOdGLAqoixRdhWezlY X-Received: by 2002:a65:5a89:: with SMTP id c9-v6mr5490609pgt.216.1538657503853; Thu, 04 Oct 2018 05:51:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538657503; cv=none; d=google.com; s=arc-20160816; b=lSXL6fNjYtRN25zQYp0QNiVlw4/LsfLbYYXaa6DhWM3P4hmWUbSouXtPLGcaIp5lJU FJssGg5pDR7wvwwZru+WIPMoIQbJWXEQ5faik59YET24rkm0HJiq2yPYQ2KegRl/1pFf W6lWcjuKbU1WLTrXzqN3uB18X1y3Kr12jl0UVbtVfjWcepLpphWimdQQhRZIm9oy2eVF x+qH8Q/UzBOIn+o8FtoxJtB1AHpzSSo+onLrZS2hXoz8i/g4qqlLqZfmxE6hUaS1hhkh VUmAUb/d76du3izNWAtPA+6nVQZTkkroDHcU7ds9KBHYWrIunONibM4nzKivP19qGYWa V36w== 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; bh=SM3PY9fCCdAbW49bPksoz1aWyPxvOHHSRBFh2VdiucA=; b=XJogmYc30wK9UdcGzDpqQnd2NU2C/q7SBiCoc2eqPXb7w/RCUKNcdL/hpfIBuIipCn g0BCm4mugosZFGEKjQeHvv+kBip1iHBjBsex4HIQQbkA7CQXycAXVOCiwnFYDDPK6YUc SrY8jS91mmiR2fdSJtCyhwraEbvIxxtG29OE10Cm0QIzaTAk31lYwvE3FfWrmy7IIUAd HIZcfCHSxacyWh9GG0SJVykx2OU1FLt0YyzgfUDjz0cNX/sw5UtD4MmZKGGZlH5jPXvd 10xLl9+aDZpAolGhrV/LIRYsKClbU7JADCK9k9Uq3pknOzxp0RVZrNtzatvJxgniEH8B YCkA== 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 g69-v6si5024063pfc.284.2018.10.04.05.51.27; Thu, 04 Oct 2018 05:51:43 -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 S1727662AbeJDToV (ORCPT + 99 others); Thu, 4 Oct 2018 15:44:21 -0400 Received: from mail.bootlin.com ([62.4.15.54]:37538 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727279AbeJDToU (ORCPT ); Thu, 4 Oct 2018 15:44:20 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 0A742207B4; Thu, 4 Oct 2018 14:51:09 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost.localdomain (AAubervilliers-681-1-28-153.w90-88.abo.wanadoo.fr [90.88.148.153]) by mail.bootlin.com (Postfix) with ESMTPSA id E0FAA208B5; Thu, 4 Oct 2018 14:50:49 +0200 (CEST) From: Quentin Schulz To: davem@davemloft.net, andrew@lunn.ch, f.fainelli@gmail.com Cc: allan.nielsen@microchip.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, thomas.petazzoni@bootlin.com, alexandre.belloni@bootlin.com, Quentin Schulz Subject: [PATCH net-next v2 6/6] net: phy: mscc: remove unneeded temporary variable Date: Thu, 4 Oct 2018 14:47:28 +0200 Message-Id: <20181004124728.9821-7-quentin.schulz@bootlin.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181004124728.9821-1-quentin.schulz@bootlin.com> References: <20181004124728.9821-1-quentin.schulz@bootlin.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Here, the rc variable is either used only for the condition right after the assignment or right before being used as the return value of the function it's being used in. So let's remove this unneeded temporary variable whenever possible. Reviewed-by: Florian Fainelli Reviewed-by: Andrew Lunn Signed-off-by: Quentin Schulz --- drivers/net/phy/mscc.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/net/phy/mscc.c b/drivers/net/phy/mscc.c index 720d8dc81410..9c7159e1ae17 100644 --- a/drivers/net/phy/mscc.c +++ b/drivers/net/phy/mscc.c @@ -514,7 +514,7 @@ static void vsc85xx_wol_get(struct phy_device *phydev, static int vsc85xx_edge_rate_magic_get(struct phy_device *phydev) { u32 vdd, sd; - int rc, i, j; + int i, j; struct device *dev = &phydev->mdio.dev; struct device_node *of_node = dev->of_node; u8 sd_array_size = ARRAY_SIZE(edge_table[0].slowdown); @@ -522,12 +522,10 @@ static int vsc85xx_edge_rate_magic_get(struct phy_device *phydev) if (!of_node) return -ENODEV; - rc = of_property_read_u32(of_node, "vsc8531,vddmac", &vdd); - if (rc != 0) + if (of_property_read_u32(of_node, "vsc8531,vddmac", &vdd)) vdd = MSCC_VDDMAC_3300; - rc = of_property_read_u32(of_node, "vsc8531,edge-slowdown", &sd); - if (rc != 0) + if (of_property_read_u32(of_node, "vsc8531,edge-slowdown", &sd)) sd = 0; for (i = 0; i < ARRAY_SIZE(edge_table); i++) @@ -781,9 +779,7 @@ static int vsc85xx_config_init(struct phy_device *phydev) return rc; } - rc = genphy_config_init(phydev); - - return rc; + return genphy_config_init(phydev); } static int vsc85xx_ack_interrupt(struct phy_device *phydev) -- 2.17.1