net: ena: Fix using plain integer as NULL pointer in ena_init_napi_in_range

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 <hulkci@huawei.com>
Signed-off-by: Wang Hai <wanghai38@huawei.com>
Suggested-by: Joe Perches <joe@perches.com>
Acked-by: Shay Agroskin <shayagr@amazon.com>
Acked-by: Shay Agroskin <shayagr@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Wang Hai 2020-07-20 15:56:14 +08:00 committed by David S. Miller
parent 74b5afea3b
commit d89d8d4db4
1 changed files with 2 additions and 3 deletions

View File

@ -2190,14 +2190,13 @@ 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,
&napi->napi,
ENA_IS_XDP_INDEX(adapter, i) ? ena_xdp_io_poll : ena_io_poll,
ENA_NAPI_BUDGET);