staging: ks7010: assign dev_alloc_name() result to variable before check it
authorSergio Paracuellos <sergio.paracuellos@gmail.com>
Mon, 23 Apr 2018 13:44:47 +0000 (15:44 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Apr 2018 13:47:23 +0000 (15:47 +0200)
This commit assigns dev_alloc_name() call to 'ret' variable to
check it after instead of check directly the call in the if
condition. This improves a bit readability. It also add an empty
line before the new assignment to separate it from the previous
check statement block.

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ks7010/ks7010_sdio.c

index 130e0be284db679914f2ee08c8e6e07ea08b07e0..b29f48c421ccaf6b847ba10ebacf338a3dbe4ad8 100644 (file)
@@ -1021,7 +1021,9 @@ static int ks7010_sdio_probe(struct sdio_func *func,
                dev_err(&card->func->dev, "Unable to alloc new net device\n");
                goto err_release_irq;
        }
-       if (dev_alloc_name(netdev, "wlan%d") < 0) {
+
+       ret = dev_alloc_name(netdev, "wlan%d");
+       if (ret < 0) {
                dev_err(&card->func->dev, "Couldn't get name!\n");
                goto err_free_netdev;
        }