lkml.org 
[lkml]   [2015]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH] s390-ctcm: Delete unnecessary checks before the function call "channel_remove"
    From
    Date
    From: Markus Elfring <elfring@users.sourceforge.net>
    Date: Tue, 17 Nov 2015 20:10:02 +0100

    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>
    ---
    drivers/s390/net/ctcm_main.c | 7 ++-----
    1 file changed, 2 insertions(+), 5 deletions(-)

    diff --git a/drivers/s390/net/ctcm_main.c b/drivers/s390/net/ctcm_main.c
    index 05c37d6..c3e2252 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;
    --
    2.6.2


    \
     
     \ /
      Last update: 2015-11-17 20:41    [W:4.141 / U:27.624 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site