Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp499214lql; Mon, 11 Mar 2024 08:46:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU3oqxaEPpjB9NF4GC3QNudIbfI9Mq8AJrT63S2vduNGKkXwuufQS4H4fpLLClv0PX1otvsjsd6loB0nEqMYxTOYur4PEdaIKvSvhopcw== X-Google-Smtp-Source: AGHT+IHN7SOcBMf6xtVIYVt5K6QiO38EQOZvxaRGU78Y29mTgjv3Z6bGgyI8OW6BBfvZWBMYWSwm X-Received: by 2002:a05:6a20:e120:b0:1a1:1f2b:ea1a with SMTP id kr32-20020a056a20e12000b001a11f2bea1amr9157765pzb.2.1710171964066; Mon, 11 Mar 2024 08:46:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710171964; cv=pass; d=google.com; s=arc-20160816; b=UaH60y9NexKq4MqxTEh7cu0rRQenKOqEmRKbcK2f5elh8C/TgBIPjfwPFbE2U6TG3r 7wp8yR4fu/NtVXn8TSXGISEW7N/Y3d/Tlkvdgo8pFCg3FOnpu2ZFNMF7Vq4/NDSa+XV4 VKXq8myZK7Cm9FAYhc1X0wO9N1hiZZ4rAE9Synaww9udQNVsb9WoQbOlyqMcDQpnKqH1 VtnwG//TmfvxOIXHoatg/dpADFw2XjApw4TRGrvtDaQmMjlwtEuZVP57M1AluNNW+r7A hJNc3XSNmPOAWSqTDoeQsKW1QNLPDhGZ0mBouV9rpEkwwK4bRsA6Vks0x1D06eIyIaw+ bxIw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=PIguq5DkTkSPsATyFTTb7/WGT6PoRR6AHuUln6i1LG8=; fh=oX9m+l0Ccp3y6oi3QXoQxifYR4n669nEOescVv5aQm8=; b=vH0zMjhKKgTPCj/Bwd7FwBWjeAQtxv3lQ1q70idZUuLs+nMxDpaEdCKz09DFt+yHAF O3oDR0bOJpKqWpOfUtM3S9A6g4C12/00fBlv/qL9SOyi8dga62nWSz1meYULOG7PLxJ7 D2Ajc1niqKJCZlFhmw+w1mz/EPaVlo0wH49/lYt7nDPW2MOanXo1Midwh/PHguuwj2zF hV61VD3m6BnfTC+ZDPCIqoJUl/iq7Jx0t+riKVil8zWFbwMEnw1K9CMyJUxrEYMRmod5 o0dDwhEHlJ1awmy4oftiunL5eLU38f29PaH5gcku2pBQmIJ1TPXdv5cq7Wl8PZJLYJ4M jCRw==; 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-99150-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-99150-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id fm4-20020a056a002f8400b006e558b4e179si4916626pfb.235.2024.03.11.08.46.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 08:46:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-99150-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=ancud.ru); spf=pass (google.com: domain of linux-kernel+bounces-99150-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-99150-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id A73AC28298D for ; Mon, 11 Mar 2024 15:46:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B0BBC44C7E; Mon, 11 Mar 2024 15:45:49 +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 EDF43446B8; Mon, 11 Mar 2024 15:45:42 +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=1710171949; cv=none; b=M7QidVB28BdpBnTKoWRW+ryo9eufZxjkk8X5/yLDclOGPqitFklT7VOQrAuxQv4udZ5/FgMwCLpoKLG2cDiHasZU8gbucAMkuKzmcf1q7iib02XoJb5U7qFTuGljEGvBL5mumuOrQMqJkbiIMHgJiMsLaJNJ8F6bsl9ylC0D7b0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710171949; c=relaxed/simple; bh=ZM6xMKvwuswUXIWt85Xm1hwgjLqWcGqZLtRZ6XP/j8o=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=ntNFhl2YUNoZywz/ABu6I14ILAo+mU0XecNTDWtiURYnYLO5vmlLJSBIMtQ/08MWiTYCdOAKN435epfWWywUvGxgmVmzZDEwmEUBPpInF8wfFy0G77EEI+rGU6oEIzkIb/wSQjnQKPaOJeNgU10Uvnk5petC326Z6rTop2PvC9E= 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=33148 helo=[192.168.95.111]) by relay.hosting.mail.nic.ru with esmtp (Exim 5.55) (envelope-from ) id 1rjhqF-0002ng-3H; Mon, 11 Mar 2024 18:45:31 +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 1rjhqE-003xOp-31; Mon, 11 Mar 2024 18:45:30 +0300 Message-ID: Date: Mon, 11 Mar 2024 18:45:29 +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 v2] tg3: Remove residual error handling in tg3_suspend To: Michael Chan Cc: Pavan Chebbi , 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 References: Content-Language: en-US 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 and change tg3_power_down_prepare to a void function as its result is no more checked. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: c866b7eac073 ("tg3: Do not use legacy PCI power management") Signed-off-by: Nikita Kiryushin --- v2: Change tg3_power_down_prepare() to a void function as Michael Chan suggested. drivers/net/ethernet/broadcom/tg3.c | 30 ++++------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 04964bbe08cf..bc36926a57cf 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c @@ -4019,7 +4019,7 @@ static int tg3_power_up(struct tg3 *tp) static int tg3_setup_phy(struct tg3 *, bool); -static int tg3_power_down_prepare(struct tg3 *tp) +static void tg3_power_down_prepare(struct tg3 *tp) { u32 misc_host_ctrl; bool device_should_wake, do_low_power; @@ -4263,7 +4263,7 @@ static int tg3_power_down_prepare(struct tg3 *tp) tg3_ape_driver_state_change(tp, RESET_KIND_SHUTDOWN); - return 0; + return; } static void tg3_power_down(struct tg3 *tp) @@ -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