Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3321122pxf; Mon, 15 Mar 2021 07:06:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgShlqUHakxddErXoy+7/fnO8oaoPNK2bhCHISp20YCiEXc5B/OcCOEAPSYiDivkdb8AT1 X-Received: by 2002:a17:906:1494:: with SMTP id x20mr23767377ejc.101.1615817174398; Mon, 15 Mar 2021 07:06:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615817174; cv=none; d=google.com; s=arc-20160816; b=pNrF4VINdhTT1P/jfjOiM+nc/uvWwyWnpZBHjwJiYI2QJau3me7JAVSVLI2Bl//80Q 05exAQ5aA9vssZtVg4V7W/V7KOSqUqxBtqHQXZW1fk0MaQG4zyDd5aHVPPV8MDY8Gqqb FT2MaDsuqPRkhmk4B+K2P+g/yIkSOq2hUoRuaQUBAOYzlN5T1QaeZA9DWbEdTrYu1Okc zqhoYv4Bws7wM++mxD04rAPyw02Nj9iY/5qOO9cv9kchbdr9GVzIQJnMSvb82i+zhcDi gtY60CWmTl97MOdUDxMZh8JTEjJR91m+tClvKSuh/WwO8Srn+q5UDm808a+uSnhuy+gu iW9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=AXDK1qgEEBpRi5hrsY2cCzr/rOzHHl0dV3zIe9Cu0Fg=; b=Xg3k8HWPLFIT4Ydn/Q/cSiyN3VLDQ+YWvr04SO6R7/GdyxK6IMKGcqawUlPuLMivIX 5/5wYcZDlz56+MZyJFCL5+8SrB6UHWUSmifpJSNv6yvvI2flH2R5GplmpOY8kXf7UoUz qveYXZ6xWaeMbm2xfFDNq1Y2xpEOXfj1Ott+oFMwiRqO+lO0SDsA/hoJwiq90wMaRGaA oOSGsG/CMrsWnG2yJyBEP9Mnd5HSBV0mahRl3UyWMCUy4+Wu2GvlV8Gf9MU3WEQ490NF 16Npyh6JK7lQINmfNweL2P/GnCLfJQhUD3rUHvoHTa37/uy9kV7fv8tEUCY4F9X0Dasb xL8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=05ih5YIq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w26si10361889eju.454.2021.03.15.07.05.51; Mon, 15 Mar 2021 07:06:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=05ih5YIq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234619AbhCOOEa (ORCPT + 99 others); Mon, 15 Mar 2021 10:04:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:34306 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231207AbhCON5T (ORCPT ); Mon, 15 Mar 2021 09:57:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D242264EF0; Mon, 15 Mar 2021 13:57:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816639; bh=kQUkM0FiOwOORrfwDF8PLigJXM3f6iK6it+5VrLkPAI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=05ih5YIqMeMpQ2zV3eXq5t0lMWUFEZluCA6p7MhPuJoxtL0PgHk+hUnU9WQUzFknl hVNO2ZC+bL/XOkt7ZtjB4bPBMMBoaHubKVaEOiQ5Wihl80Pn8TzmjB6Vs+iG+uufnf uBMdJE10uO8oZSkH9t8CPPchM7gyzoT0ik79sGDI= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michal Suchanek , Sukadev Bhattiprolu , "David S. Miller" Subject: [PATCH 5.10 027/290] ibmvnic: Fix possibly uninitialized old_num_tx_queues variable warning. Date: Mon, 15 Mar 2021 14:52:00 +0100 Message-Id: <20210315135542.847424658@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135541.921894249@linuxfoundation.org> References: <20210315135541.921894249@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: Michal Suchanek commit 6881b07fdd24850def1f03761c66042b983ff86e upstream. GCC 7.5 reports: ../drivers/net/ethernet/ibm/ibmvnic.c: In function 'ibmvnic_reset_init': ../drivers/net/ethernet/ibm/ibmvnic.c:5373:51: warning: 'old_num_tx_queues' may be used uninitialized in this function [-Wmaybe-uninitialized] ../drivers/net/ethernet/ibm/ibmvnic.c:5373:6: warning: 'old_num_rx_queues' may be used uninitialized in this function [-Wmaybe-uninitialized] The variable is initialized only if(reset) and used only if(reset && something) so this is a false positive. However, there is no reason to not initialize the variables unconditionally avoiding the warning. Fixes: 635e442f4a48 ("ibmvnic: merge ibmvnic_reset_init and ibmvnic_init") Signed-off-by: Michal Suchanek Reviewed-by: Sukadev Bhattiprolu Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/ibm/ibmvnic.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c @@ -5176,16 +5176,14 @@ static int ibmvnic_reset_init(struct ibm { struct device *dev = &adapter->vdev->dev; unsigned long timeout = msecs_to_jiffies(20000); - u64 old_num_rx_queues, old_num_tx_queues; + u64 old_num_rx_queues = adapter->req_rx_queues; + u64 old_num_tx_queues = adapter->req_tx_queues; int rc; adapter->from_passive_init = false; - if (reset) { - old_num_rx_queues = adapter->req_rx_queues; - old_num_tx_queues = adapter->req_tx_queues; + if (reset) reinit_completion(&adapter->init_done); - } adapter->init_done_rc = 0; rc = ibmvnic_send_crq_init(adapter);