Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3320890pxf; Mon, 15 Mar 2021 07:05:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQ9HWFnf08SONYChe+4HKEtKDDGcmddYhv2OdurpvxsnkdsN63Qqa3AKNmQMUzVRAXyL1Y X-Received: by 2002:a17:906:d787:: with SMTP id pj7mr23308728ejb.257.1615817158513; Mon, 15 Mar 2021 07:05:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615817158; cv=none; d=google.com; s=arc-20160816; b=GaQbRN2o4tFWTtgox3AJatwcMz/FGSApbdFzeaMyivaZj1+5CxTS9rDXld75COnw3Y BhMbg9wCwywU/g01Ln3pYYGjjTcB7CCCESKCIt3lbqGs2qkU29b6UWp9/FzQkvndf6jo yKS/q6v5PmIZhabm5mNKO8n+68GPSvPajOF+2XODkpX6yGQFk3y37QVdvVkoYFM2EV/N Vx+70HGUcMJdZOp11QxvoIktq/ksZrKmuZsLSMReBa1+0eUkVq0XmPdBFq2cd22P2uLQ EefAj/Sj2sZ+RfF1rp0adaLvq0cq88YjzwIFsuhsFsOi4jm4av20YntYxvwrHhKgN/oR iG8g== 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=K+VrHoobFPcyVWo97cMhblily1O69UrBSeOGg+EOae0=; b=ZxEodtuNaoiTxETd/MdLIV3Qld7WdzNPmygwU6uHVxG7YYG+pKM8RQO8Sb3dxjlfU7 DYzTqA/RcZKfab/vytHAOT7JSNx5oVoIbhbaznqtovBdOt6QrEH8kSLvSnC0cgrLdvIy elb494/JJfuddG0flNsRqOFlDtvJNqmRdvqFG311hIfRr67dvavaGcczihPGsr9dIOWr sH2PYZywnDCZfxpY0TTlzR8rSZzFweZ4guDluOx33VufyikVsqp5kspbJy7/1DjrZwvv zkw94K2HFH9/f/6Pc6gDmacYfrteZBkVC4FMUYg3YFTwBbo6iaZSB2vVSTqCXIjAGKG9 4NSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=g5WGZC2d; 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 f25si11511343edr.248.2021.03.15.07.05.34; Mon, 15 Mar 2021 07:05:58 -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=g5WGZC2d; 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 S232973AbhCOOEN (ORCPT + 99 others); Mon, 15 Mar 2021 10:04:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:34798 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230506AbhCON5S (ORCPT ); Mon, 15 Mar 2021 09:57:18 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 10C3864F19; Mon, 15 Mar 2021 13:57:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816637; bh=BjK/QruW1BkNMl4dzTySEjSv3ASKfjDmmcd39gaG9j4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g5WGZC2dDCmvjsn7PsG62RaZa5uJVai8Zq9UdccUrS7Fi7buW9nghuhfP0LTkVgor JqTPb4ssd1xH4yFNHMZetu2YYIn1pBi8Z1bBu9/Dt+IsbpV9gqKg1mJnfvjiGI4ci3 3cgEmptjgBp2ydyMxL2xUyCKNO9k/+hVo4V/XAWE= 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.11 034/306] ibmvnic: Fix possibly uninitialized old_num_tx_queues variable warning. Date: Mon, 15 Mar 2021 14:51:37 +0100 Message-Id: <20210315135508.789050230@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135507.611436477@linuxfoundation.org> References: <20210315135507.611436477@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 @@ -5283,16 +5283,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);