Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2441849ybi; Sun, 9 Jun 2019 11:54:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqyZFD5q5+efLG8rytSNya1EunCtIPHc+yWVdvlHmW7+HiAobqrRxKIM3C8HfAu2QvAA3HQt X-Received: by 2002:a65:490e:: with SMTP id p14mr12298631pgs.287.1560106493638; Sun, 09 Jun 2019 11:54:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560106493; cv=none; d=google.com; s=arc-20160816; b=ZTaMHulfCaBDlYgNibhgq9gyuztckcRVre+ZKE9zjKQ+akO7o8H/BKZOovL4L6mBkx nV3MKC928gm+r1KckXXBIG9xKuAne+mPc/q+N/XwGNiZE6rugtFigY+ZkP1Qw1IhTKPF S1M5iafdlu9eEOWLJlV4e19mEqKzM/s06H27+sVhxxwGop0PLQ0a5uB4nQdEoWP3gJqn 6vw3v9BK4j2EzEbRubvM8opFBMzucFmH0T8tS1BtzQX0bDTpJW2YZCurJimCIVsvid6v 98dDfiHwybYJ9XgUTPr/fDHbjYId135ZajkMYqkHr/U2mZO/jLfRbKi9ii5y/JSBRaI5 F+Ag== 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:message-id:date:subject:cc:to:from :dkim-signature; bh=v1cIgIB/50o1TbuP4h7H+LIZ4pZcg3N52gZnolC5tNY=; b=BbGtYuvPUrBu0vo3urMnPOxXuRDZNm7hPtjfGMVubTbUgbb9wHuXk3wk4ivqAfDDPR /zMRDCFzAtr0Uvdsw/CASbVOisIPWJ1IexhhDl+iHwm8bhkOzTvIpqv/wmGBNsBA6tS2 a0CrbXrbN+VAMxBn4f9YIIDhlE1bAV44AzKbcxvZSjKTVuwxoEbOHSBtGoGca1+62ZoQ 6x+tBbk54BA+tChNFVODgaAy6zcn75hdj55wN+Y3G5o2bu+u5F38I50Y9jk2FUrhi2rG DDrpyEOopkXQ14sFTNjXAY+8PdqaJNnvrucaaY3mTMr3UkeBEWrZu4rA+Z/k5JzK2nx5 QH4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=A3czi1Dd; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j38si7754757pgi.227.2019.06.09.11.54.37; Sun, 09 Jun 2019 11:54:53 -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=@googlemail.com header.s=20161025 header.b=A3czi1Dd; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729748AbfFISGm (ORCPT + 99 others); Sun, 9 Jun 2019 14:06:42 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:45327 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729352AbfFISGk (ORCPT ); Sun, 9 Jun 2019 14:06:40 -0400 Received: by mail-wr1-f65.google.com with SMTP id f9so6868619wre.12; Sun, 09 Jun 2019 11:06:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=v1cIgIB/50o1TbuP4h7H+LIZ4pZcg3N52gZnolC5tNY=; b=A3czi1Dd8xVadhyrRlkBaDwSqjW0C9T7e2gfiqTTqXBWnEx1kL4TX8qXuj3Xy3qfM0 5iny+h6uiPG/9QeP7zkvWcBhsfeCKwy8CGTIMEvub+SmrvjgDCwUoDfQaHzyiyIDEa+k tWDKdLgoefImiuL1ZqWnHWTvo5c59Wq6zCHt/Vv6ZRmsU02qdpxTsPPS/lTTUNkBCGtz vdCrDYoSvMO9YuyBmmRGpts6a17UQjzMJAyeAXOZdnpNrhhAGAKW+FZXIi562prgpzQ+ 1QDEdy6DOYRCzaSLxU2HiUEllLqYYxBMD9Ivg3yXp8csBGAoHjwsyF5E/2bbPrtPWCnF +pVA== 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:mime-version:content-transfer-encoding; bh=v1cIgIB/50o1TbuP4h7H+LIZ4pZcg3N52gZnolC5tNY=; b=hrQlDiY94V2vJ3Vu/1D3asM/DIluqVYnV0bc5bmv2TiH7QWgm0FrtxhBp9wtqoG4c8 ROxQvv5ngjikSOeiYnDKg4lfn0c52NGOeYu9xVsFeSa2lVm4RkpQKHnBXJWO8t7t++AX 1WkoQICOHi1jeuA0hi6AXsvhA8X2t2xmLe6e/BGiE14KXuMfR/Tw/hHfC3ttPhVYT9Py Zb+yARcQv/zeSLqKxlqDX8c2wYXaRpZb3/lrliNwmFP4zswmI177QmjO5IRqDsgJd/mm bSmdW9ocxGj2lGD4YQjWiD9Fh8FvVrg8tuEqG5S/N+jxWt0rU8aYBYozXGqQRMTlxEaq UI0w== X-Gm-Message-State: APjAAAU5ebvMTnBIRnx2IAYmpGNxmnboAicnj8SqPlXKhLnsqQSkOtTj 5KixoUCZRVm3hLacg8VCll6ZbQ9p X-Received: by 2002:a5d:4311:: with SMTP id h17mr43160091wrq.9.1560103597686; Sun, 09 Jun 2019 11:06:37 -0700 (PDT) Received: from blackbox.darklights.net (p200300F133DDA400B42D8EB9D711C35E.dip0.t-ipconnect.de. [2003:f1:33dd:a400:b42d:8eb9:d711:c35e]) by smtp.googlemail.com with ESMTPSA id h14sm2007731wrs.66.2019.06.09.11.06.36 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 09 Jun 2019 11:06:37 -0700 (PDT) From: Martin Blumenstingl To: netdev@vger.kernel.org, linux-gpio@vger.kernel.org, linux-amlogic@lists.infradead.org, linus.walleij@linaro.org, bgolaszewski@baylibre.com, peppe.cavallaro@st.com, alexandre.torgue@st.com, joabreu@synopsys.com Cc: devicetree@vger.kernel.org, davem@davemloft.net, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, khilman@baylibre.com, narmstrong@baylibre.com, Martin Blumenstingl Subject: [RFC next v1 1/5] net: stmmac: drop redundant check in stmmac_mdio_reset Date: Sun, 9 Jun 2019 20:06:17 +0200 Message-Id: <20190609180621.7607-2-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190609180621.7607-1-martin.blumenstingl@googlemail.com> References: <20190609180621.7607-1-martin.blumenstingl@googlemail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A simplified version of the existing code looks like this: if (priv->device->of_node) { struct device_node *np = priv->device->of_node; if (!np) return 0; The second "if" never evaluates to true because the first "if" checks for exactly the opposite. Drop the redundant check and early return to make the code easier to understand. No functional changes intended. Signed-off-by: Martin Blumenstingl --- drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c index 093a223fe408..cb9aad090cc9 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c @@ -254,9 +254,6 @@ int stmmac_mdio_reset(struct mii_bus *bus) if (data->reset_gpio < 0) { struct device_node *np = priv->device->of_node; - if (!np) - return 0; - data->reset_gpio = of_get_named_gpio(np, "snps,reset-gpio", 0); if (data->reset_gpio < 0) -- 2.21.0