Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1534865ybh; Mon, 20 Jul 2020 00:10:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyTUlkJruAgWerVHZt/vx2IDn3H7ELWAa2HjOAmlCTde3ETVZG1PTQctv0fbEKQZGQHsYz X-Received: by 2002:aa7:cd52:: with SMTP id v18mr19399675edw.196.1595229010793; Mon, 20 Jul 2020 00:10:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595229010; cv=none; d=google.com; s=arc-20160816; b=b7OiIcbIVS67tBWzuzjCGNP8hPGt7VXhxBVrDHZW/dsOYMsSdphuAA7I3d6Yw3DFmb BXo4CHhGLPvqde3x2T9p9+T3TI5ejAq8gGWG+RU78zwQ5Z3mg1Wlhkip4flXai4qgGlS joBWMQCVDizq6Ol+7AQchiSOl2u4keBwja5q/cEgRi5p/5MlHOp8CtJV80p7am1URYZJ YqBXJJiQDx4nw8S0tF8BF80U3p57vHTs1JbZ1GT/VnDe18SeUGAUIWijNrAtenX2qBLW 6a3APXxD1ZJKPrX6zjYVuFFzWURz8hX3ibd9Oh+zxjO31S2XTP/x++Dvn+pkftlUxsR/ 4apw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=IzfSL3gL4NEHohXAnzZtxnT0gUP4PpSUAs/TTfUUNFU=; b=drz8Cezfxsa9+oV6ke3GCnetjUrvU2JkPU4ayJbwwPhwTsgxetOxkzUshUZiN3lNMk Ir1E8tGVP8SZ3txcmLDO6KLAUfG+yfN5RaDvDb0hLm5xSKD4yTchdDZ+7l+BEQ2IQMNg KfmnjkaXTevpDA/Dc3eozEeXYkijhXHnCb2pXWGTm2wwnRZ9EXUr9ehsXmOzd/Kzk8fV N4iRSZLYEjF4e3y//qkDiGWJTmO/SyDNJZcLtjXzgnWd6ep60B76eERvvRrsNlxLO8Ps iQVFfbMDxDttCLuJXgo7JiGApWUMlrE1OpCP0AfEFMokmZ+tooNDlzKqgQjaP6GLp+Xg 5IsQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c95si13703001edf.304.2020.07.20.00.09.48; Mon, 20 Jul 2020 00:10:10 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727036AbgGTHIy (ORCPT + 99 others); Mon, 20 Jul 2020 03:08:54 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:34024 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726017AbgGTHIy (ORCPT ); Mon, 20 Jul 2020 03:08:54 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 7A2A7BC094A04463BD6D; Mon, 20 Jul 2020 15:08:50 +0800 (CST) Received: from [127.0.0.1] (10.174.179.81) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.487.0; Mon, 20 Jul 2020 15:08:44 +0800 Subject: Re: [PATCH net-next v2] net: ena: Fix using plain integer as NULL pointer in ena_init_napi_in_range To: Joe Perches , , , , , , CC: , References: <20200720025309.18597-1-wanghai38@huawei.com> From: "wanghai (M)" Message-ID: <073489da-6ffb-4f1c-fe35-d663f86dd1a6@huawei.com> Date: Mon, 20 Jul 2020 15:08:44 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.179.81] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ?? 2020/7/20 11:15, Joe Perches ะด??: > On Mon, 2020-07-20 at 10:53 +0800, Wang Hai wrote: >> Fix sparse build warning: >> >> drivers/net/ethernet/amazon/ena/ena_netdev.c:2193:34: warning: >> Using plain integer as NULL pointer > [] >> diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c > [] >> @@ -2190,11 +2190,10 @@ static void ena_del_napi_in_range(struct ena_adapter *adapter, >> static void ena_init_napi_in_range(struct ena_adapter *adapter, >> int first_index, int count) >> { >> - struct ena_napi *napi = {0}; >> int i; >> >> for (i = first_index; i < first_index + count; i++) { >> - napi = &adapter->ena_napi[i]; >> + struct ena_napi *napi = &adapter->ena_napi[i]; >> >> netif_napi_add(adapter->netdev, >> &adapter->ena_napi[i].napi, > Another possible change is to this statement: > > netif_napi_add(adapter->netdev, > &napi->napi, > etc...); > Good catch. I'll add this change, Thanks. > > > . >