Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp420343ybh; Sat, 18 Jul 2020 08:07:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqbJSMT38PzzrNO5AHL/qXDrDA9XIIjn2jmNwcHE/KiAxrI1PaZtEtzzhfm/4sStSsBWwj X-Received: by 2002:aa7:c98d:: with SMTP id c13mr13677312edt.188.1595084823313; Sat, 18 Jul 2020 08:07:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595084823; cv=none; d=google.com; s=arc-20160816; b=akYzFvEqBnSUN+LkTCIx2qibZf2cUA7jS4s3Yze8C74r/tgPX4QgN7bG5fS0D9vUvC VK4gAnexENu/OtuKPEuDhyH42mNRi8euNbhRJ8PDFR/39tfLuuxXTkKRyeARiGXtuya6 eaHf0rh+lk0xZ7AHsR6ufDj5Az3ejWUEqKVc7Z/3aaTyrzbyp+qUyd4ToNmDEH93lu3O woB6YJOXKhQ8Sxm0zosW0GqL3hCkeFaOMwoiTzeKhIV2CLFFeIR7bkwKn+RNvCISA8DT /EVDrSHteKIzEgFR5uAbg8HwNaYEl8qx7m+UK2e+RVR6hoh7/Lvb4MzdX+26j4CuLp7y nNIg== 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:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=hmsIrp53JEPNGyOHmneFb2cgC8ajL4dxWMgzBy95GPk=; b=haK0pGys2wsTDPLY59DzY1VpNl0pKGJSS2IfLoxnFbHx4Km4JzMCt7Eztj423l43Y+ cz9D93CkN6c+UuPrzj+2mts9pyEmFk5Piu4ILFJWRPIcj9UUuHH9b+DnrPQPVBS/Leij rJ41If+L7xECwiAkW/nbtUvwKUB51EPQEMbz+S1TAce0TAhFKtWZJ808NTqLEVNUsmjy sNpLuT6l9Smn9rCFeFoKLZkGVQqlqDn66w34s0DgK4C3F8wRyza0DLGVECpVu9kbCccK x7CXNTP8fa4HF+9Ts54cwOpvt7m4r+npYNEvdv8eBMsUymaxt/DHoMaDRZTmp03SqxEZ CP+Q== 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 h5si6906825ejq.249.2020.07.18.08.06.40; Sat, 18 Jul 2020 08:07:03 -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 S1727943AbgGRPGT (ORCPT + 99 others); Sat, 18 Jul 2020 11:06:19 -0400 Received: from smtprelay0163.hostedemail.com ([216.40.44.163]:40920 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726155AbgGRPGT (ORCPT ); Sat, 18 Jul 2020 11:06:19 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id 1BCCA180A8CA9; Sat, 18 Jul 2020 15:06:18 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:41:355:379:599:960:968:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1714:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3351:3622:3865:3867:3868:4250:4321:4605:5007:10004:10400:10848:11026:11232:11657:11658:11914:12043:12048:12296:12297:12438:12555:12740:12760:12895:12986:13069:13311:13357:13439:14659:14721:21080:21451:21627:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: fear80_261175726f14 X-Filterd-Recvd-Size: 2490 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf13.hostedemail.com (Postfix) with ESMTPA; Sat, 18 Jul 2020 15:06:16 +0000 (UTC) Message-ID: <3093bc36c2ad86170e2e90a3451e5962d0815122.camel@perches.com> Subject: Re: [PATCH -next] net: ena: use NULL instead of zero From: Joe Perches To: Wang Hai , netanel@amazon.com, akiyano@amazon.com, gtzalik@amazon.com, saeedb@amazon.com, zorik@amazon.com, davem@davemloft.net, kuba@kernel.org, sameehj@amazon.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Date: Sat, 18 Jul 2020 08:06:14 -0700 In-Reply-To: <20200718115633.37464-1-wanghai38@huawei.com> References: <20200718115633.37464-1-wanghai38@huawei.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.36.3-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2020-07-18 at 19:56 +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 Better to remove the initialization altogether and move the declaration into the loop. > diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c [] > @@ -2190,7 +2190,7 @@ 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}; > + struct ena_napi *napi = NULL; > int i; > > for (i = first_index; i < first_index + count; i++) { --- drivers/net/ethernet/amazon/ena/ena_netdev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c index 91be3ffa1c5c..470d8f38b824 100644 --- 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,