]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
sfc: refactor selftest work init code
authorAlex Maftei (amaftei) <amaftei@solarflare.com>
Fri, 10 Jan 2020 13:26:34 +0000 (13:26 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 10 Jan 2020 19:24:37 +0000 (11:24 -0800)
Signed-off-by: Alexandru-Mihai Maftei <amaftei@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sfc/efx_common.c
drivers/net/ethernet/sfc/selftest.c
drivers/net/ethernet/sfc/selftest.h

index 9cd7c1550c0832556474c945685b04dffe1df228..33b523b6d0a8cf3eaa5af7986413803311b56eb9 100644 (file)
@@ -840,7 +840,7 @@ int efx_init_struct(struct efx_nic *efx,
 #endif
        INIT_WORK(&efx->reset_work, efx_reset_work);
        INIT_DELAYED_WORK(&efx->monitor_work, efx_monitor);
-       INIT_DELAYED_WORK(&efx->selftest_work, efx_selftest_async_work);
+       efx_selftest_async_init(efx);
        efx->pci_dev = pci_dev;
        efx->msg_enable = debug;
        efx->state = STATE_UNINIT;
index ec5002b5ec4fc3126c73783c2f0a5e7ae3c863f8..1ae369022d7d945b4a5a03b7a37594957e30e0e8 100644 (file)
@@ -785,7 +785,7 @@ void efx_selftest_async_cancel(struct efx_nic *efx)
        cancel_delayed_work_sync(&efx->selftest_work);
 }
 
-void efx_selftest_async_work(struct work_struct *data)
+static void efx_selftest_async_work(struct work_struct *data)
 {
        struct efx_nic *efx = container_of(data, struct efx_nic,
                                           selftest_work.work);
@@ -804,3 +804,8 @@ void efx_selftest_async_work(struct work_struct *data)
                                  channel->channel, cpu);
        }
 }
+
+void efx_selftest_async_init(struct efx_nic *efx)
+{
+       INIT_DELAYED_WORK(&efx->selftest_work, efx_selftest_async_work);
+}
index a3553816d92c168ecb28dd1961799236fd368d1d..ca88ebb4f6b1fdc97f1d44325c367ba1c788992b 100644 (file)
@@ -45,8 +45,8 @@ void efx_loopback_rx_packet(struct efx_nic *efx, const char *buf_ptr,
                            int pkt_len);
 int efx_selftest(struct efx_nic *efx, struct efx_self_tests *tests,
                 unsigned flags);
+void efx_selftest_async_init(struct efx_nic *efx);
 void efx_selftest_async_start(struct efx_nic *efx);
 void efx_selftest_async_cancel(struct efx_nic *efx);
-void efx_selftest_async_work(struct work_struct *data);
 
 #endif /* EFX_SELFTEST_H */