From patchwork Tue Aug 17 18:34:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Skripkin X-Patchwork-Id: 498593 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.8 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, 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 05B88C4338F for ; Tue, 17 Aug 2021 18:35:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E0D5F6103A for ; Tue, 17 Aug 2021 18:35:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233379AbhHQSgP (ORCPT ); Tue, 17 Aug 2021 14:36:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232620AbhHQSgG (ORCPT ); Tue, 17 Aug 2021 14:36:06 -0400 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11A20C061764; Tue, 17 Aug 2021 11:35:33 -0700 (PDT) Received: by mail-lj1-x22e.google.com with SMTP id s3so283973ljp.11; Tue, 17 Aug 2021 11:35:32 -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:mime-version :content-transfer-encoding; bh=ouYM9VHMpEM8w2sBiSiM4kMsiclMCWPkcX2MmzsySN4=; b=GcRGVF89SwgKWtmB++fh8Vcvh0rJKY1OAGWUy+cYaEK9Nl+TGMAD9nZGZmIzgkpRps QSRe59oVgsjXLPYuWnhKVpzx+Wg9WvBwGAkPg0A54s4bOOMxrgNVS7TBDZAXixkNuoSx Rdk7T3Mpj1D0Gs/JsT+BdaPJ/BI5JzFYnU9QE9HppkP/5qcGGNleOG0eqg7tTMszWSbi T/TilJKi3iO2TjhmwteAdh9mAMn4kQpH4i4pQa7ox5nySa1+cjFh1HEqtqvg7EYN2MwO eK7D4R+7Tp9ZUFFtisMcBGAAv1H3I1nBZ73zaXKnnMaEWt6f/AiT6PnivXmBEBy4MQPb LIEA== 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:mime-version :content-transfer-encoding; bh=ouYM9VHMpEM8w2sBiSiM4kMsiclMCWPkcX2MmzsySN4=; b=GrZX3VD0MQB2KrpAKa/t08FLuOwX8zgzLBQ8/ydVm1KAdiMaAIc1TAY3RJcTDHpsQr /mr+YrgIluxBVCvi93zK+Y4j2wZX7bzZCPlZSnxlJJg8e4p4/PT9faLDyTuqB+w/VGtS H6I92hOnd/DThuRtfB+H/fl+Wf7e3etUVShiHyfmqw4EDDfWxV4OCiwCnce0/dUG8GsI 0uZieVxHyjyDZts0x5mr7vy1Y/+dt9NmGCwQN4XIS5+YdJx6BXPUkg+rOMT3WV2yCfpc HeQe65GIhBeEhl3+v84QjLcvmFWzFhYTmsfQezN+5O8HnRGsZ2QM6dqlPHHB1iMhZCjQ 0KMg== X-Gm-Message-State: AOAM532J85C/5w/kiWXkI2EJvtBFhCLPamDPlIQ7/alfs6WPBNuAFsbY /KBfuX7o6mnzBvpx+uns9xE= X-Google-Smtp-Source: ABdhPJw0SXgT8GZ5K48mNK19qTuVj8zhO2h+zQR0hrgWHrJzlvs3R9mwE7tBOF0Jolacm1wL2pPfiw== X-Received: by 2002:a2e:a914:: with SMTP id j20mr4390799ljq.460.1629225331328; Tue, 17 Aug 2021 11:35:31 -0700 (PDT) Received: from localhost.localdomain ([46.235.66.127]) by smtp.gmail.com with ESMTPSA id y4sm259724lfl.38.2021.08.17.11.35.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Aug 2021 11:35:30 -0700 (PDT) From: Pavel Skripkin To: davem@davemloft.net, kuba@kernel.org, andriy.shevchenko@linux.intel.com, christophe.jaillet@wanadoo.fr, jesse.brandeburg@intel.com, kaixuxia@tencent.com, lee.jones@linaro.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Pavel Skripkin Subject: [PATCH 1/2] net: mii: make mii_ethtool_gset() return void Date: Tue, 17 Aug 2021 21:34:42 +0300 Message-Id: <680892d787669c56f0ceac0e9c113d6301fbe7c6.1629225089.git.paskripkin@gmail.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org mii_ethtool_gset() does not return any errors. We can make it return void to simplify error checking in drivers, that rely on return value of this function. Signed-off-by: Pavel Skripkin Acked-by: Andy Shevchenko --- drivers/net/mii.c | 5 +---- include/linux/mii.h | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/net/mii.c b/drivers/net/mii.c index 779c3a96dba7..3e7823267a3b 100644 --- a/drivers/net/mii.c +++ b/drivers/net/mii.c @@ -50,9 +50,8 @@ static u32 mii_get_an(struct mii_if_info *mii, u16 addr) * The @ecmd parameter is expected to have been cleared before calling * mii_ethtool_gset(). * - * Returns 0 for success, negative on error. */ -int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd) +void mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd) { struct net_device *dev = mii->dev; u16 bmcr, bmsr, ctrl1000 = 0, stat1000 = 0; @@ -131,8 +130,6 @@ int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd) mii->full_duplex = ecmd->duplex; /* ignore maxtxpkt, maxrxpkt for now */ - - return 0; } /** diff --git a/include/linux/mii.h b/include/linux/mii.h index 219b93cad1dd..12ea29e04293 100644 --- a/include/linux/mii.h +++ b/include/linux/mii.h @@ -32,7 +32,7 @@ struct mii_if_info { extern int mii_link_ok (struct mii_if_info *mii); extern int mii_nway_restart (struct mii_if_info *mii); -extern int mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd); +extern void mii_ethtool_gset(struct mii_if_info *mii, struct ethtool_cmd *ecmd); extern void mii_ethtool_get_link_ksettings( struct mii_if_info *mii, struct ethtool_link_ksettings *cmd); extern int mii_ethtool_sset(struct mii_if_info *mii, struct ethtool_cmd *ecmd); From patchwork Tue Aug 17 18:35:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Skripkin X-Patchwork-Id: 499632 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.8 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,USER_AGENT_GIT autolearn=unavailable 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 91169C432BE for ; Tue, 17 Aug 2021 18:35:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7B83161051 for ; Tue, 17 Aug 2021 18:35:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233428AbhHQSgR (ORCPT ); Tue, 17 Aug 2021 14:36:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233318AbhHQSgM (ORCPT ); Tue, 17 Aug 2021 14:36:12 -0400 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97AB3C061764; Tue, 17 Aug 2021 11:35:38 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id d16so346945ljq.4; Tue, 17 Aug 2021 11:35:38 -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=QTBDXnwQGkT+4A4UuLJatqAKSgRrFvBbySkIbNpaSYE=; b=QZjIRn7uwlkVj+s5yU06Kvnh0SRLIDmhwCZuVsnW16SlFCD3zkAc7e5sZ6ycLhXUZh zZMyHqEm+Ic5etnaDYOFjClkOeAbgMR+e3wbo2VlDKGFzunT6ByjtWXefxDet0UVelBP AX/5YTA/IQTZMN1/PsImhZwCqVMwwE5JaL69PR2YrZfKrwvU5RuQ3e0u7ORwhSipxrW9 ZXVcaxyPCFKb09Tu0xWXb1RoDj31JWnT2rSFT8elvMdeMAwiuEbTIKa2zevX+HemYidg /W/JXqQOsJ1XBo9Yv5m30unJxWLC4NOS4MvaRhZvr8peBRUKFnXbOEaZaIQ89VDm0QEx e2dQ== 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=QTBDXnwQGkT+4A4UuLJatqAKSgRrFvBbySkIbNpaSYE=; b=QLg3xnySY7QAdfahLGkyXDnEfAMwppZYCTpLePyXIqp7+kG+r99zbktXEMf3p0fTK5 RZZeo/l6dcmXY6yWqKcOz+WcN9L/m2AreqMD5T1PJCQ6tgl5CVdzDJELaQDOcD2or5G8 +c2QW0QpDfl3esuDvsvRgpWCPYeTzYXY6sSceaJIgJfoHv9hNXA58Ut+eGR5+YqCmISt g9Z0pW3h4ReaXmdhjSpgMEmQQu9gP96JlPYIcaRlItQLwmtyDJOE1B2gc+nGLCDwdsUH Zgi1OZuoJrIK12nh8ejP63jWp8iK6A0RvxZlmJQZOe0zbXYCWRvb0MH8woaHXef4KQXM br4A== X-Gm-Message-State: AOAM533gGTbP58JQbYqvi4vKmpeX22IXoDXQ6XlZwtBZ9o0R32DoKqWV UFJZfyuZIZrtHc+VtR/8r+s= X-Google-Smtp-Source: ABdhPJwbnhWtQ8TneqnM2aEr/lMnzIb4+YPLmJLc/hcb8eryahYg4crcKxa/1SYKeymcJjTuJRTUvQ== X-Received: by 2002:a05:651c:11c7:: with SMTP id z7mr4415069ljo.288.1629225336963; Tue, 17 Aug 2021 11:35:36 -0700 (PDT) Received: from localhost.localdomain ([46.235.66.127]) by smtp.gmail.com with ESMTPSA id x27sm258004lfa.232.2021.08.17.11.35.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Aug 2021 11:35:36 -0700 (PDT) From: Pavel Skripkin To: davem@davemloft.net, kuba@kernel.org, andriy.shevchenko@linux.intel.com, christophe.jaillet@wanadoo.fr, jesse.brandeburg@intel.com, kaixuxia@tencent.com, lee.jones@linaro.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Pavel Skripkin Subject: [PATCH 2/2] net: pch_gbe: remove mii_ethtool_gset() error handling Date: Tue, 17 Aug 2021 21:35:33 +0300 Message-Id: <2fd83384bde83d9cd4ad5111b03e653bd9a8fe84.1629225090.git.paskripkin@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <680892d787669c56f0ceac0e9c113d6301fbe7c6.1629225089.git.paskripkin@gmail.com> References: <680892d787669c56f0ceac0e9c113d6301fbe7c6.1629225089.git.paskripkin@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Since mii_ethtool_gset() becomes void in previous patch we can omit cheking return value of this function and make code more simple. Signed-off-by: Pavel Skripkin --- 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;