lkml.org 
[lkml]   [2015]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH 1/3] block-cciss: Deletion of an unnecessary check before the function call "put_disk"
    From: Markus Elfring <elfring@users.sourceforge.net>
    Date: Sun, 18 Jan 2015 11:14:16 +0100

    The put_disk() function tests whether its argument is NULL and then
    returns immediately. Thus the test around the call is not needed.

    This issue was detected by using the Coccinelle software.

    Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
    ---
    drivers/block/cciss.c | 3 +--
    1 file changed, 1 insertion(+), 2 deletions(-)

    diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
    index ff20f19..4be0de0 100644
    --- a/drivers/block/cciss.c
    +++ b/drivers/block/cciss.c
    @@ -4424,8 +4424,7 @@ static void free_hba(ctlr_info_t *h)

    hba[h->ctlr] = NULL;
    for (i = 0; i < h->highest_lun + 1; i++)
    - if (h->gendisk[i] != NULL)
    - put_disk(h->gendisk[i]);
    + put_disk(h->gendisk[i]);
    kfree(h);
    }

    --
    2.2.2


    \
     
     \ /
      Last update: 2015-01-18 15:41    [W:4.019 / U:0.652 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site