Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp100722lqc; Thu, 7 Mar 2024 11:26:09 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXZFsm9DWAM2WClWda9etXizSrW8uD9/BxAWWtWfmQyfEZ6Zz5CZxWCdQhjrX6FRTtHyXmxh/AAOhEFgkWYSQNzwe+rMN77IqYxg1amWw== X-Google-Smtp-Source: AGHT+IEL2GBU8rJ6Oa43kk1SIUfnU8sJ0Nnx0GPGk+KtMKMOs0U77t6bw/aeoWnwbBe5RUlzRGuJ X-Received: by 2002:a9d:6c83:0:b0:6e5:f65:8775 with SMTP id c3-20020a9d6c83000000b006e50f658775mr305850otr.24.1709839569042; Thu, 07 Mar 2024 11:26:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709839569; cv=pass; d=google.com; s=arc-20160816; b=qyBTMSgGzx52ursk32f0+QOtM6H7XqO7dI60ncVPlKM3wrn2VkNS2yE2xLqVDL6BPY OqEfaX531H+r9en1mJUCiSl6G/7q+8mGYnAx/WLnM+IO5UFg6i6GdDhN3xbBqIyna9M2 7KPzwuutw/I1+t2VsxSS6EE7fum5y3lVnnbIm8zBMKwEw4BzTlY7VtDNZM2+4mxGuLdY gVWRTfH1cTzf1ZG7Mx/aQow8xNhn6c64h3by1RJ+SQkxhJBypXxS90bW54s2NrAAxMjY cGwlp3tJBo6QV3CNdNc40q4bXxKDR6KaaA0kXCEljyiAzibTrStd3Dqu/m/q5o/UiHHs aAYw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:cc:to:content-language :references:subject:from:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=ELR5LcyCmU3TSQcYBY0nOaXIGcnQeT2PD/My86E12Wc=; fh=10zzB2G/XNosjUhIAsI5nSrsh4xSwMIOkLolsmnf/38=; b=DbkP0cE41iWco2Mu02ooaTM5LMN/UC9efCZpzvZEA1rWg5+3othp4hX3+n6Tf0pHiB J8TNV4j+HJkBiWLTVssfO8nR4XgF+MT6O9YV4h3iQOmSGP3TAYbXEUUvTiFcROpL095m hn5plGOb2aQlM+sdmfUo8fnIfons6+6ApSBjTjVCRBNI/yVRJ7J0kv4X+V0g0CsZGZhV olRDIxcRvHYcKRbDec8PaF6FBl2eftL6mjiqJQukLk1bZxMcPOwtAP+o9y1DBwpze0h5 CvswaxTLYo4X37LVKQaBYKbigOo6WBLxSpI+nLFM2ZJvwEPaS+zp6kHxEXNPAtCf4Hb9 dNyg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=ancud.ru); spf=pass (google.com: domain of linux-kernel+bounces-96099-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96099-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id s18-20020a632152000000b005d8e401b4a2si14376136pgm.801.2024.03.07.11.26.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 11:26:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-96099-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=ancud.ru); spf=pass (google.com: domain of linux-kernel+bounces-96099-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96099-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 9F600B22380 for ; Thu, 7 Mar 2024 19:24:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 19A891369AD; Thu, 7 Mar 2024 19:24:13 +0000 (UTC) Received: from relay161.nicmail.ru (relay161.nicmail.ru [91.189.117.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BAA48135417; Thu, 7 Mar 2024 19:24:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.189.117.5 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709839452; cv=none; b=FfA6u7ZKpqqH7RjJqKTg8va5l1fxW49pF92mBWj4Mn7SnzGoxWrMrVZNM4bHeMitHbir46H5mOr8xhQQMAAhY72UUgcBb3etp+TvR1HxUVRuw4bocHeBaI0d74zyMpzLTicuPl1AeRybII6uCPjzUmx/q/GlsElCb8Y/gNS7trU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709839452; c=relaxed/simple; bh=jFrJQ5q+lLh31/DXkoXXkSOYb6P8Rtp/T0yXSgyT6W8=; h=Message-ID:Date:MIME-Version:From:Subject:References:To:Cc: In-Reply-To:Content-Type; b=iZTiRF/P3Dv+hIMeiypP+nq0WPdXHWF6YlVAqjluqP1OvoB6TCh7M5US6E3z48sHzuN7zHDBJtSDtn5Ah08hXG3czUQYF/4vU3uY0c3pWBt8Hp7uNBkbP6lZ4gcpTTmYYUu3Fm1E6WKfXFXEEi7uB8kDYNdMPdnkd0PQMJUT6Sk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ancud.ru; spf=pass smtp.mailfrom=ancud.ru; arc=none smtp.client-ip=91.189.117.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ancud.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ancud.ru Received: from [10.28.138.152] (port=10898 helo=[192.168.95.111]) by relay.hosting.mail.nic.ru with esmtp (Exim 5.55) (envelope-from ) id 1riJLO-0002QA-4t; Thu, 07 Mar 2024 22:23:54 +0300 Received: from [87.245.155.195] (account kiryushin@ancud.ru HELO [192.168.95.111]) by incarp1104.mail.hosting.nic.ru (Exim 5.55) with id 1riJLO-006yUJ-1R; Thu, 07 Mar 2024 22:23:54 +0300 Message-ID: <4e7e11f8-03b5-4289-9475-d3b4e105d40a@ancud.ru> Date: Thu, 7 Mar 2024 22:23:52 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Nikita Kiryushin Subject: [PATCH] tg3: Remove residual error handling in tg3_suspend References: <> Content-Language: en-US To: Pavan Chebbi Cc: Michael Chan , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "Rafael J. Wysocki" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org In-Reply-To: <> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-MS-Exchange-Organization-SCL: -1 As of now, tg3_power_down_prepare always ends with success, but the error handling code from former tg3_set_power_state call is still here. Remove (now unreachable) code for simplification. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: c866b7eac073 ("tg3: Do not use legacy PCI power management") Signed-off-by: Nikita Kiryushin --- drivers/net/ethernet/broadcom/tg3.c | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 04964bbe08cf..400451e10f77 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c @@ -18090,7 +18090,6 @@ static int tg3_suspend(struct device *device) { struct net_device *dev = dev_get_drvdata(device); struct tg3 *tp = netdev_priv(dev); - int err = 0; rtnl_lock(); @@ -18114,32 +18113,11 @@ static int tg3_suspend(struct device *device) tg3_flag_clear(tp, INIT_COMPLETE); tg3_full_unlock(tp); - err = tg3_power_down_prepare(tp); - if (err) { - int err2; - - tg3_full_lock(tp, 0); - - tg3_flag_set(tp, INIT_COMPLETE); - err2 = tg3_restart_hw(tp, true); - if (err2) - goto out; - - tg3_timer_start(tp); - - netif_device_attach(dev); - tg3_netif_start(tp); - -out: - tg3_full_unlock(tp); - - if (!err2) - tg3_phy_start(tp); - } + tg3_power_down_prepare(tp); unlock: rtnl_unlock(); - return err; + return 0; } static int tg3_resume(struct device *device) -- 2.34.1