net: liquidio: Make use of the helper macro kthread_run()
authorCai Huoqing <caihuoqing@baidu.com>
Thu, 21 Oct 2021 08:41:58 +0000 (16:41 +0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 22 Oct 2021 18:10:10 +0000 (11:10 -0700)
Repalce kthread_create/wake_up_process() with kthread_run()
to simplify the code.

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Link: https://lore.kernel.org/r/20211021084158.2183-1-caihuoqing@baidu.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/cavium/liquidio/lio_main.c

index 1daf63e437cec6be234855a1089e8d32725ceab5..12eee2bc7f5c885228b984a181feeb68eb9a675e 100644 (file)
@@ -892,12 +892,11 @@ liquidio_probe(struct pci_dev *pdev, const struct pci_device_id __maybe_unused *
                        bus = pdev->bus->number;
                        device = PCI_SLOT(pdev->devfn);
                        function = PCI_FUNC(pdev->devfn);
-                       oct_dev->watchdog_task = kthread_create(
-                           liquidio_watchdog, oct_dev,
-                           "liowd/%02hhx:%02hhx.%hhx", bus, device, function);
-                       if (!IS_ERR(oct_dev->watchdog_task)) {
-                               wake_up_process(oct_dev->watchdog_task);
-                       } else {
+                       oct_dev->watchdog_task = kthread_run(liquidio_watchdog,
+                                                            oct_dev,
+                                                            "liowd/%02hhx:%02hhx.%hhx",
+                                                            bus, device, function);
+                       if (IS_ERR(oct_dev->watchdog_task)) {
                                oct_dev->watchdog_task = NULL;
                                dev_err(&oct_dev->pci_dev->dev,
                                        "failed to create kernel_thread\n");