Commit d89d8d4d authored by Wang Hai's avatar Wang Hai Committed by David S. Miller

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: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarWang Hai <wanghai38@huawei.com>
Suggested-by: default avatarJoe Perches <joe@perches.com>
Acked-by: default avatarShay Agroskin <shayagr@amazon.com>
Acked-by: default avatarShay Agroskin <shayagr@amazon.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 74b5afea
...@@ -2190,14 +2190,13 @@ static void ena_del_napi_in_range(struct ena_adapter *adapter, ...@@ -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, static void ena_init_napi_in_range(struct ena_adapter *adapter,
int first_index, int count) int first_index, int count)
{ {
struct ena_napi *napi = {0};
int i; int i;
for (i = first_index; i < first_index + count; 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, 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_IS_XDP_INDEX(adapter, i) ? ena_xdp_io_poll : ena_io_poll,
ENA_NAPI_BUDGET); ENA_NAPI_BUDGET);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment