Skip to content

Commit

Permalink
s390-ctcm: Delete unnecessary checks before the function call "channe…
Browse files Browse the repository at this point in the history
…l_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 <elfring@users.sourceforge.net>
Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Markus Elfring authored and David S. Miller committed Dec 14, 2015
1 parent f0c59af commit e043046
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/s390/net/ctcm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e043046

Please sign in to comment.