Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2969441pxb; Tue, 12 Jan 2021 03:10:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJyug1TN6BxSy18vsdMd4dwnN+DISFWNsGK9LOFoPdMxI7edYnvfupxGTziroAGOuWEw/m9t X-Received: by 2002:a17:907:4271:: with SMTP id nq1mr2796930ejb.358.1610449848607; Tue, 12 Jan 2021 03:10:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610449848; cv=none; d=google.com; s=arc-20160816; b=GAed9YKbITHSGJUVOb223lwfVQwTpyEKvYZvFInTNnY4Lhx7JtzxQjgWs1NgbM3r3k R9FCz6E5+1b5ceojqRfP2VKCeIWzWit+ZRUi4HMQsCO1ITXLUugT53QIe3w02Rt7WzDu vHGrWJFAq5abVJvR5t5LyU1UnIRz6f+94S7okXXAN9PFsZzzssGn0IVuknBQ0HbanhNy x4gVax5zzfPrhghsJD/Ia2daabnezmJdvAllecnlEQX/6igEpcGmcSt0HDBF2SQ6PzJ4 ta51MQWciThU8vnDt6Wanf1Gy5yUxJMPqP2lUl9pAq9jEkOUTzeiOjx+saXmYm9TtUA3 b9ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=hBNIZoVEFYnZolBPXDxQvsKxura8sTWXxEYo+kfOlYs=; b=Dpl8knJsm+H4GPCtrRU0o0QvP7AOUsPAaQLC0Lxf2NJ3TV6CfuEoD99nyDBTLIfhXi Io4bAezfQyUbtUf6IH00/WzNlwlJx3WZ4FyvmUrSbPFNorS3mQJgYvYqFzFntkfYdPqX VqElrljXvCd1oiXTIXFLJVETHr9HN3+P6hNpGCP97HutmInXiwKEbMHqjEhywNZyNT6j dNdBTfY20+gBKEA9kTcC+aS4DEpxvKpF/IRnrMgjFRn+JQbl4w0XCth0CWrpRd4t47mq Fq4iPWMmWfyiApnkZQWpFBCTczz6aMeT4Nu4aM+MzVJA1IPrVJt5nrNzvm6Lx2D4sLud MEBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cFXmGcYH; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r4si1145672edm.79.2021.01.12.03.10.25; Tue, 12 Jan 2021 03:10:48 -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=@redhat.com header.s=mimecast20190719 header.b=cFXmGcYH; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728830AbhALCza (ORCPT + 99 others); Mon, 11 Jan 2021 21:55:30 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:55183 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728044AbhALCza (ORCPT ); Mon, 11 Jan 2021 21:55:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610420043; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hBNIZoVEFYnZolBPXDxQvsKxura8sTWXxEYo+kfOlYs=; b=cFXmGcYHNd0t2am0TZqWM+DQwdlLteKst4A3LNRpecda3PWWh+faEsix2j/a8Y2Xg1P9Hn OZZl/r+JaB4TXZSuAtx/cPZ4eg9rr2annuqcgr9pPXlAPCiUhWb9pKP0e6bUvULIdbAh1u nY2vaaqHzHIPsX/8sIpR2XUpRLy09C8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-354-NeFrT79jM9uRKsLdnRlk2A-1; Mon, 11 Jan 2021 21:54:02 -0500 X-MC-Unique: NeFrT79jM9uRKsLdnRlk2A-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0DAF0107ACF8; Tue, 12 Jan 2021 02:54:01 +0000 (UTC) Received: from [10.72.12.225] (ovpn-12-225.pek2.redhat.com [10.72.12.225]) by smtp.corp.redhat.com (Postfix) with ESMTP id B3E094F3C6; Tue, 12 Jan 2021 02:53:56 +0000 (UTC) Subject: Re: [PATCH] mlx5: vdpa: fix possible uninitialized var To: Eli Cohen Cc: mst@redhat.com, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org References: <20210108082443.5609-1-jasowang@redhat.com> <20210110063955.GA115874@mtl-vdi-166.wap.labs.mlnx> From: Jason Wang Message-ID: Date: Tue, 12 Jan 2021 10:53:54 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210110063955.GA115874@mtl-vdi-166.wap.labs.mlnx> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/1/10 下午2:39, Eli Cohen wrote: > 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(). Fine with me. Will do that in V3. Thanks > >> -- >> 2.25.1 >>