Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1424133ybh; Sun, 19 Jul 2020 19:55:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2uW/SGbl/cBL7Ps7xFJCznli2rE+2rBpfAkwOC+hrijbrvemirkAvdtsCMJ8ffq8lnzPe X-Received: by 2002:a05:6402:354:: with SMTP id r20mr20598088edw.32.1595213716570; Sun, 19 Jul 2020 19:55:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595213716; cv=none; d=google.com; s=arc-20160816; b=IwcGpmU6/vM6rfxp39yJmlZDX9GO0jOjmW+rWCro6q/xMmT313UMXiIk/U+mZFVQlh 0SNQhzwFl6mt7IJqup6/+hPT8RjVWNv2aYqUUa2/Lifs9MBOtgTKEWgWBdzKc3e+SaR1 tFiZHioi0Ly4JdTObrGbox0HTorLOgAj4WR+MVWOFL7+XY+e9ZldPD7ZDZ0UC/lAC2Sh wfRcAaMA9IzM/JPZnzlFVvkomi6teP6qWYznwhx+G8eOMwThUs4BCuGfTvmf8GDZ908M JPnkNOUDlhFqaUgj1YzXCViErAle3yu9iSvpNzde7svaeJk8GH9Xhc9YSwwzKprznyjX 7fsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=qYEgiZBE4PoeiLYLHdktaJRxZOxDGDZvo2d/BYMHoSE=; b=FmUcQ0Vpiv7FjE56fMxmSEI99xTYJHyUqyRf92Y2R7pRpcY9t253AT4h1wWo8wW881 t1F5zQC5eeIRQU/x+iTBMX1v3xp8O2MK+UIWS77YXPL5EIPuFN2dR0ahkVCzSv6wXDG1 zaG//Av0y4fszyUv84LpTIoLkbeIn6yKzt01wv/r6ryrQLJlIBAQc56ipEEWuzTXAfvP AI1lfIQeX2qUBOrVDdRdGpx3LAthNtO1lA3hOPQM4sG2FZsGK3IiWr5bQEpWhsrqlI3Q OmQt1BJ6rRHJEDr1Jh2cd4adgUgqkfQIEHTmCGoeAYEHTFUamIei1clNOqD0dMzkSnrJ 0R8g== 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 g25si10134137eds.190.2020.07.19.19.54.53; Sun, 19 Jul 2020 19:55:16 -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 S1726553AbgGTCyl (ORCPT + 99 others); Sun, 19 Jul 2020 22:54:41 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:48956 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726225AbgGTCyl (ORCPT ); Sun, 19 Jul 2020 22:54:41 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 81E9F1D4A2635D05AA35; Mon, 20 Jul 2020 10:54:38 +0800 (CST) Received: from huawei.com (10.175.113.133) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.487.0; Mon, 20 Jul 2020 10:54:36 +0800 From: Wang Hai To: , , , , , , CC: , Subject: [PATCH net-next v2] net: ena: Fix using plain integer as NULL pointer in ena_init_napi_in_range Date: Mon, 20 Jul 2020 10:53:09 +0800 Message-ID: <20200720025309.18597-1-wanghai38@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.113.133] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix sparse build warning: drivers/net/ethernet/amazon/ena/ena_netdev.c:2193:34: warning: Using plain integer as NULL pointer Reported-by: Hulk Robot Signed-off-by: Wang Hai Suggested-by: Joe Perches Acked-by: Shay Agroskin --- v1->v2: Improve code readability based on Joe Perches's suggestion 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, -- 2.17.1