Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp1468225pxb; Sat, 9 Jan 2021 22:42:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJyNgg/WUlS7aVRnx0rgrAKvJcv6cyeLAtFac+s/YzFA6FEZqN0lMDAY9dpqMLVCWQO7sdUO X-Received: by 2002:a05:6402:a52:: with SMTP id bt18mr10556671edb.228.1610260926486; Sat, 09 Jan 2021 22:42:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610260926; cv=none; d=google.com; s=arc-20160816; b=FG90KbaSY35qca+HIc/G2uErc5tsMJghS3eeIb8EDDrFTNK+ZQ53mhuRJMXi6oNJ73 l7PP1B76OBr8GnZSb+0c0+cNIKMEtzyYw6u1Emih9jW1T7W0CAgVO5bBmza8uoyK4PES knhPpIK7luMPICc3uBn6GMWmLnDiCk6ui17dffU0damxkbYZ1DgjRXe9kZ/An5Bz1z2n ETaLf0Ga9kNLXyuAdCT5J/BS3fhC/E2W/wa7IQ60fpPAeReyf731ZMlCpfMQQ4NhgG3k 6Unxcx9YRKrTDvA+s+VkIbWylzLLMIibxcJ9cT9b+wQkmYxvUQhuxtdcvfhgm4kPwBR6 IMFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:dkim-signature:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=JTT7LraeNZwxgbWXZ93S3R16J1s+M871mksvKda7ArA=; b=Lf5d8cMXfVap2q62Tp2iqim4HgMTJoAhrIm4js9j9X7YXWxRq0JzSREA3lminZcWHf y9RTAs0a91YMKzdp6kfGXMDrOOcMbTj2qPtIOiblYq5j+p6I95DVk5m/1+l45AuZV71p F6CyLbAh+2kUsPtQJluOyfVyH1XQS042F+Y3Ksrj7Cb6yPLHwFOEJizUeHsD24U+/OEO jwt/1A8m94rpoW03aRwOIfDk2iZ41Y6woiiVVUlePuQsMnP8euow5XAglNtsmPLQnR05 ODX6GyU82WeoFhOYqzqOtH7aRo+3UVPPfFVI5S3u//pFtngNPwXlERTOh0LJZgDUuJ9z ETpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=Fzf7hRVq; 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=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p5si5813709edt.50.2021.01.09.22.41.42; Sat, 09 Jan 2021 22:42:06 -0800 (PST) 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=@nvidia.com header.s=n1 header.b=Fzf7hRVq; 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=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725907AbhAJGkl (ORCPT + 99 others); Sun, 10 Jan 2021 01:40:41 -0500 Received: from hqnvemgate24.nvidia.com ([216.228.121.143]:19563 "EHLO hqnvemgate24.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725267AbhAJGkk (ORCPT ); Sun, 10 Jan 2021 01:40:40 -0500 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Sat, 09 Jan 2021 22:40:00 -0800 Received: from mtl-vdi-166.wap.labs.mlnx (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Sun, 10 Jan 2021 06:39:58 +0000 Date: Sun, 10 Jan 2021 08:39:55 +0200 From: Eli Cohen To: Jason Wang CC: , , Subject: Re: [PATCH] mlx5: vdpa: fix possible uninitialized var Message-ID: <20210110063955.GA115874@mtl-vdi-166.wap.labs.mlnx> References: <20210108082443.5609-1-jasowang@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20210108082443.5609-1-jasowang@redhat.com> User-Agent: Mutt/1.9.5 (bf161cf53efb) (2018-04-13) X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1610260800; bh=JTT7LraeNZwxgbWXZ93S3R16J1s+M871mksvKda7ArA=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To:User-Agent: X-Originating-IP:X-ClientProxiedBy; b=Fzf7hRVqwqvu/A9pHll5tOrNbH/WNIVqCySWEFcLLm3avVzqILnqgCZT+wjeWi/I6 J2WWGYBqQb1IWRUwj/TlaUP3vKHBwRB/f+AWaLy1+v8XSMWEKJwjEpijkcB5S21DDu utB73fLfQ6hhpKb3YrIBBnsKAhwfjKBauPbQ13gHxMrP5HcwZAXBuTT4eCeea8cMRH kh+dzudzDV7Njid8sQwLbgyfZvBf35bEQ7KXHch9kZppVL/vR0s75iyBHFl6HiaeeN jT/J7CWaN9YTcqT1vRQ908b3G0mJoLQpAJD7cFxZhknlcTIXKYjzzTWZ38dAxoMwck bJYLZ7uuBQV6Q== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 08, 2021 at 04:24:43PM +0800, Jason Wang wrote: > Upstream: posted > > When compiling with -Werror=maybe-uninitialized, gcc may complains the > possible uninitialized umem. Fix that. > > Signed-off-by: Jason Wang > --- > drivers/vdpa/mlx5/net/mlx5_vnet.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c > index f1d54814db97..a6ad83d8d8e2 100644 > --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c > +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c > @@ -706,6 +706,9 @@ static void umem_destroy(struct mlx5_vdpa_net *ndev, struct mlx5_vdpa_virtqueue > case 3: > umem = &mvq->umem3; > break; > + default: > + WARN(1, "unsupported umem num %d\n", num); > + return; > } > > MLX5_SET(destroy_umem_in, in, opcode, MLX5_CMD_OP_DESTROY_UMEM); Since the "default" case will never be executed, maybe it's better to just change "case 3:" to "default:" and avoid the WARN(). > -- > 2.25.1 >