]> git.baikalelectronics.ru Git - kernel.git/commit
target/configfs: Remove unnecessary null test
authorHimangi Saraogi <himangi774@gmail.com>
Wed, 16 Jul 2014 20:59:53 +0000 (02:29 +0530)
committerNicholas Bellinger <nab@linux-iscsi.org>
Mon, 15 Sep 2014 21:20:00 +0000 (14:20 -0700)
commit4c4c9b4ef9058de93beac33d781b4cf081bbe357
treef4b6a173ae8defceececc6e86d5675f6d22dfe1a
parenta8bdd51f99d9b1667cdf699af3043328c3c16911
target/configfs: Remove unnecessary null test

This patch removes the null test on lun_cg. lun_cg is initialized
at the beginning of the function to &lun->lun_group. Since lun_cg is
dereferenced prior to the null test, it must be a valid pointer.

The following Coccinelle script is used for detecting the change:

@r@
expression e,f;
identifier g,y;
statement S1,S2;
@@

*e = &f->g
<+...
 f->y
 ...+>
*if (e != NULL || ...)
 S1 else S2

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_fabric_configfs.c