Home
last modified time | relevance | path

Searched hist:a0f7bfd3429fc48f4d1aa5364b9428d75798ba04 (Results 1 – 1 of 1) sorted by relevance

/linux/fs/xfs/
H A Dxfs_trans_buf.cdiff a0f7bfd3429fc48f4d1aa5364b9428d75798ba04 Mon Jul 27 18:15:25 CEST 2009 Julia Lawall <julia@diku.dk> 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>