From: Markus Elfring Date: Fri, 11 Dec 2015 11:27:53 +0000 (+0100) Subject: s390-ctcm: Delete unnecessary checks before the function call "channel_remove" X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e043046a5a29bebe7e9a68b92c4580e2888f8ed3;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git s390-ctcm: Delete unnecessary checks before the function call "channel_remove" 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 Signed-off-by: Ursula Braun Signed-off-by: David S. Miller --- diff --git a/drivers/s390/net/ctcm_main.c b/drivers/s390/net/ctcm_main.c index 05c37d6d4afe..c3e22523faf3 100644 --- a/drivers/s390/net/ctcm_main.c +++ b/drivers/s390/net/ctcm_main.c @@ -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;