diff options
author | Julia Lawall <julia@diku.dk> | 2009-07-27 12:15:25 -0400 |
---|---|---|
committer | Felix Blyakher <felixb@sgi.com> | 2009-07-31 01:00:47 -0400 |
commit | ede58517ca93277547a0d054728c352618212d85 (patch) | |
tree | c719d90f95bf03e2e7fe69f32dfe3c7d584caa50 /lib/bcd.c | |
parent | 5c04c78afba4805846519f29f0b55ac8759e0d48 (diff) |
fs/xfs: Correct redundant test
bp was tested for NULL a few lines before, followed by a return, and there
is no intervening modification of its value.
A simplified version of the semantic match that finds this problem is as
follows: (http://www.emn.fr/x-info/coccinelle/)
// <smpl>
@r exists@
local idexpression x;
expression E;
position p1,p2;
@@
if (x == NULL || ...) { ... when forall
return ...; }
... when != \(x=E\|x--\|x++\|--x\|++x\|x-=E\|x+=E\|x|=E\|x&=E\|&x\)
(
*x == NULL
|
*x != NULL
)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Felix Blyakher <felixb@sgi.com>
Signed-off-by: Felix Blyakher <felixb@sgi.com>
Diffstat (limited to 'lib/bcd.c')
0 files changed, 0 insertions, 0 deletions