Staging: netlogic: Compress return logic into one line
authorMihaela Muraru <mihaela.muraru21@gmail.com>
Thu, 13 Oct 2016 16:45:59 +0000 (19:45 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Oct 2016 08:27:33 +0000 (10:27 +0200)
Simplify function returns by merging assignment and return into
one command line.
Found with Coccinelle
@@
expression e, ret;
@@

-ret =
+return
        e;
-return ret;

Signed-off-by: Mihaela Muraru <mihaela.muraru21@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/netlogic/xlr_net.c

index cdf01b931296308ba77a688dda0f1c6ac07a83d7..fb0928a4fb97ed9053114a7e90d876d4f5710dae 100644 (file)
@@ -1007,10 +1007,8 @@ static int xlr_net_probe(struct platform_device *pdev)
         */
        adapter = (struct xlr_adapter *)
                devm_kzalloc(&pdev->dev, sizeof(*adapter), GFP_KERNEL);
-       if (!adapter) {
-               err = -ENOMEM;
-               return err;
-       }
+       if (!adapter)
+               return -ENOMEM;
 
        /*
         * XLR and XLS have 1 and 2 NAE controller respectively