Staging: go7007: Move a dereference below a NULL test
authorJulia Lawall <julia@diku.dk>
Fri, 19 Dec 2008 17:11:25 +0000 (18:11 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 3 Apr 2009 21:53:27 +0000 (14:53 -0700)
commit41e847890acbee5db65430c1d4f8d7ac07813140
treeaed344ab9efbc81c7b6756bf56ceb67263029d42
parentfd1f72b1827075d05b09658e55923eafecbf115e
Staging: go7007: Move a dereference below a NULL test

In each case, if the NULL test is necessary, then the dereference should be
moved below the NULL test.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/).  The result has been modified to
move the initialization of usb down closer to where it is used.

// <smpl>
@@
type T;
expression E;
identifier i,fld;
statement S;
@@

- T i = E->fld;
+ T i;
  ... when != E
      when != i
  if (E == NULL) S
+ i = E->fld;
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/go7007/s2250-board.c