David Binderman
2016-Apr-06 18:23 UTC
[Ocfs2-devel] linux-4.6-rc2/fs/ocfs2/refcounttree.c:987]: (style) Redundant condition
Hello there, linux-4.6-rc2/fs/ocfs2/refcounttree.c:987]: (style) Redundant condition: eb. '!eb || (eb && !eb.h_next_leaf_blk)' is equivalent to '!eb || !eb.h_next_leaf_blk' Source code is ??????? if (!eb || (eb && !eb->h_next_leaf_blk)) { Also, linux-4.6-rc2/fs/ocfs2/refcounttree.c:1011] -> [linux-4.6-rc2/fs/ocfs2/refcounttree.c:987]: (warning) Either the condition 'eb' is redundant or there is possible null pointer dereference: eb. Regards David Binderman
Gang He
2016-Apr-20 06:36 UTC
[Ocfs2-devel] linux-4.6-rc2/fs/ocfs2/refcounttree.c:987]: (style) Redundant condition
Yes, "!eb || !eb.h_next_leaf_blk" looks more readable. Thanks Gang>>> > Hello there, > > linux-4.6-rc2/fs/ocfs2/refcounttree.c:987]: (style) Redundant condition: eb. > '!eb || (eb && !eb.h_next_leaf_blk)' is equivalent to '!eb || > !eb.h_next_leaf_blk' > > Source code is > > if (!eb || (eb && !eb->h_next_leaf_blk)) { > > Also, > > linux-4.6-rc2/fs/ocfs2/refcounttree.c:1011] -> > [linux-4.6-rc2/fs/ocfs2/refcounttree.c:987]: (warning) Either the condition > 'eb' is redundant or there is possible null pointer dereference: eb. > > > Regards > > David Binderman > > > _______________________________________________ > Ocfs2-devel mailing list > Ocfs2-devel at oss.oracle.com > https://oss.oracle.com/mailman/listinfo/ocfs2-devel