From patchwork Wed Aug 18 15:06:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Skripkin X-Patchwork-Id: 12444661 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BF6EC4338F for ; Wed, 18 Aug 2021 15:07:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0813460E76 for ; Wed, 18 Aug 2021 15:07:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239592AbhHRPHk (ORCPT ); Wed, 18 Aug 2021 11:07:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235131AbhHRPHg (ORCPT ); Wed, 18 Aug 2021 11:07:36 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A03F0C061764; Wed, 18 Aug 2021 08:07:01 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id y34so5294815lfa.8; Wed, 18 Aug 2021 08:07:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hpXTPXK1ibNyRndd2z4OxzfYUmUkDAM0OJ5r1uqfGjw=; b=Lnby+xsvPy5y/+y/cRXf1EQaqsXKlWFS0cky80HAYrRYVQVy8eqTbjYWicQuzisYA+ uwjAdyx1kNqoM5F55YZ1fZkDctN5X128018xYz9wVqfSk7JXbEaZ4Uhrbjl8DlIjEFZ6 7FM4NjKn8Vxrmg1ojsBbPFZ89XF5cyOiw6S1/vKqRf8hJNYDQaLKd72L+K7Yi+0WPjlJ rN2xjezJ/+2LfGHyVDjTtlkXYdMb/9mMSeawQZV87M1PyF366luRkeiio5q8F5SBQ78I etNem7u2LoBeZVsB+0cxWgxWcQronQGCMxe/wCHVn8Roy6QsaO9gJ9n0FuS3juZEuHpo UAhA== 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=hpXTPXK1ibNyRndd2z4OxzfYUmUkDAM0OJ5r1uqfGjw=; b=sT2m9xaPRf240uPjM0dtKx9KQIoZTzJHeZHbMPJpSZsgm5v05MYC7xxY6Tat+GgY7p Mv8x05xXLzyKskm8q2gaf4hOaBcSu1VIow5aY5hT7xgyovyrEfb3f5ORXJQDs7Muf3Ds Cv8h1II6/RWJGDnDgJWdufjPX3gUWGXYS9OVZvwu4kcRRvC69MWT22og9MyU9O/CuAVm kKctvcwNzao+bPdnuA04r/hl+0ww79/uPOsJK1NgrdpKE/TOe+tN1iBLuDXgEI0qxIcE 7JiVIPFrdpuDrfE+4zrqbilBz1xNvUc8w+2EfwabT212UT025a2ibPPTM/65PKlnE60S u8PA== X-Gm-Message-State: AOAM5307FYED4ZYyJiy44ALWTfZv6XjLK66f5OtMSf5U8ltIhHwIdNSB QlEq9Fi6glyvJl019V9NyOw= X-Google-Smtp-Source: ABdhPJzCOWLA8LkvS1HCGXpzALuQrjOzmyeSXstCJmQqthtbcgF8x1zP9tMIe4OYOOtMS7EcwL4Weg== X-Received: by 2002:a19:2d0e:: with SMTP id k14mr6573783lfj.409.1629299219839; Wed, 18 Aug 2021 08:06:59 -0700 (PDT) Received: from localhost.localdomain ([46.235.66.127]) by smtp.gmail.com with ESMTPSA id f14sm13489ljk.42.2021.08.18.08.06.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Aug 2021 08:06:59 -0700 (PDT) From: Pavel Skripkin To: davem@davemloft.net, kuba@kernel.org, andriy.shevchenko@linux.intel.com, christophe.jaillet@wanadoo.fr, kaixuxia@tencent.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Pavel Skripkin Subject: [PATCH v3 1/2] net: pch_gbe: remove mii_ethtool_gset() error handling Date: Wed, 18 Aug 2021 18:06:30 +0300 Message-Id: <7e8946ac52de91a963beb7fa0354a19a21c5cf73.1629298981.git.paskripkin@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org mii_ethtool_gset() does not return any errors, so error handling can be omitted to make code more simple. Acked-by: Andy Shevchenko Signed-off-by: Pavel Skripkin --- Changes in v3: No changes Changes in v2: inverted the order of patches --- drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 8 +------- drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_phy.c | 4 +--- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c index e351f3d1608f..539bddfab2d4 100644 --- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c +++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c @@ -1031,13 +1031,7 @@ static void pch_gbe_watchdog(struct timer_list *t) struct ethtool_cmd cmd = { .cmd = ETHTOOL_GSET }; netdev->tx_queue_len = adapter->tx_queue_len; /* mii library handles link maintenance tasks */ - if (mii_ethtool_gset(&adapter->mii, &cmd)) { - netdev_err(netdev, "ethtool get setting Error\n"); - mod_timer(&adapter->watchdog_timer, - round_jiffies(jiffies + - PCH_GBE_WATCHDOG_PERIOD)); - return; - } + mii_ethtool_gset(&adapter->mii, &cmd); hw->mac.link_speed = ethtool_cmd_speed(&cmd); hw->mac.link_duplex = cmd.duplex; /* Set the RGMII control. */ diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_phy.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_phy.c index ed832046216a..3426f6fa2b57 100644 --- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_phy.c +++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_phy.c @@ -301,9 +301,7 @@ void pch_gbe_phy_init_setting(struct pch_gbe_hw *hw) int ret; u16 mii_reg; - ret = mii_ethtool_gset(&adapter->mii, &cmd); - if (ret) - netdev_err(adapter->netdev, "Error: mii_ethtool_gset\n"); + mii_ethtool_gset(&adapter->mii, &cmd); ethtool_cmd_speed_set(&cmd, hw->mac.link_speed); cmd.duplex = hw->mac.link_duplex;