]> git.karo-electronics.de Git - linux-beck.git/commitdiff
s390-ctcm: Delete unnecessary checks before the function call "channel_remove"
authorMarkus Elfring <elfring@users.sourceforge.net>
Fri, 11 Dec 2015 11:27:53 +0000 (12:27 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Dec 2015 21:16:44 +0000 (16:16 -0500)
The channel_remove() function tests whether its argument is NULL
and then returns immediately. Thus the test around the calls is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/s390/net/ctcm_main.c

index 05c37d6d4afef27cdb182dbb7621ee7ef4fd2490..c3e22523faf36b2b21aa83dae388d2f2abf17206 100644 (file)
@@ -1677,11 +1677,8 @@ static int ctcm_shutdown_device(struct ccwgroup_device *cgdev)
 
        ccw_device_set_offline(cgdev->cdev[1]);
        ccw_device_set_offline(cgdev->cdev[0]);
-
-       if (priv->channel[CTCM_READ])
-               channel_remove(priv->channel[CTCM_READ]);
-       if (priv->channel[CTCM_WRITE])
-               channel_remove(priv->channel[CTCM_WRITE]);
+       channel_remove(priv->channel[CTCM_READ]);
+       channel_remove(priv->channel[CTCM_WRITE]);
        priv->channel[CTCM_READ] = priv->channel[CTCM_WRITE] = NULL;
 
        return 0;