Messages in this thread Patch in this message | | | Date | Sun, 18 Jan 2015 15:37:42 +0100 | From | SF Markus Elfring <> | 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
| |