mirror of https://gitee.com/openkylin/linux.git
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:
parent
74b5afea3b
commit
d89d8d4db4
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue