Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3383528imm; Mon, 8 Oct 2018 03:08:31 -0700 (PDT) X-Google-Smtp-Source: ACcGV61qoz8B3DbJ4AeM2RsABM+8+qyw4Sg4tURwXJ7xFb+CBQE9Cnw1JRZoAxkk9UQI4nA8vUXn X-Received: by 2002:a62:7885:: with SMTP id t127-v6mr18936155pfc.259.1538993311190; Mon, 08 Oct 2018 03:08:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538993311; cv=none; d=google.com; s=arc-20160816; b=mmf7BlfxY9BN0rZ4GMfDZCFaVev/b+3SJwyYdNrRiOm0lHrv+pg04ut1rG5xwRI7be 77yE4bBIl0qM09vDM6V3LkyWNBUTIRCWpyGqNW5yqp2yu590ubCPYYPsc5IH3QDvBCce SubeiZ23vDRY2xGUddbhSjpr5L9ZlWN6/iJ1id2VYVMaYqNXTwNXu9HhGfenVENxWcSX U0igmtUI8cKfWeW7URyLbE7KBkBrGDAZ4a+d4j4LLh3Qq8q3HCFcMqjWhRUN1YWZN9dQ AaGZ6LJtHNQU5dSoKgs8r7fTEqEzCEUkm/9OrWVDFBMGtc5oiGEKqXrG2LQhoi2a29Ox wUcw== 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=DQRpEC109pYapRmqzocsXkS30EYmwA2m+4JAIOwb5xY=; b=HdSd/uVHB9Cj5yYF7BqGne34tgcdUdHBj6r1cogjRoSnFDfMu9WG7dwIbv8r8Op5VC 6CAB6reQj2pyHManBXnCDnWbGARWAvTBMYl2Ys78dZiZIbg+CxiBHpU95/MGozRyBOUV XxG2gbrhBG4TtOXAcd2ograIPGFsecwt3psnHifeq0ppRhxkKKevITAKJd/S0RuVP2y5 LKqLR75UqXaMjgTxDUxOm5En8ZXhg+uVntgyWKrOc12HASuWXE8XZg4NGij3cq0N0au8 TjJwnfQeE0a4bbBr9L0d/OM0MnI6PbN2MNobHtgZy/gcx5RpEEPeee3JopPa5J+gCCij ySQw== 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 9-v6si16288769pgn.512.2018.10.08.03.08.16; Mon, 08 Oct 2018 03:08:31 -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 S1727879AbeJHRSv (ORCPT + 99 others); Mon, 8 Oct 2018 13:18:51 -0400 Received: from mail.bootlin.com ([62.4.15.54]:38945 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726771AbeJHRSu (ORCPT ); Mon, 8 Oct 2018 13:18:50 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 87732208C2; Mon, 8 Oct 2018 12:07:50 +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 432122090A; Mon, 8 Oct 2018 12:07:40 +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 v3 6/6] net: phy: mscc: remove unneeded temporary variable Date: Mon, 8 Oct 2018 12:07:28 +0200 Message-Id: <20181008100728.24959-7-quentin.schulz@bootlin.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181008100728.24959-1-quentin.schulz@bootlin.com> References: <20181008100728.24959-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 6bfdc168c62b..7ae3e644a18f 100644 --- a/drivers/net/phy/mscc.c +++ b/drivers/net/phy/mscc.c @@ -481,7 +481,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); @@ -489,12 +489,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++) @@ -735,9 +733,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