]> git.baikalelectronics.ru Git - kernel.git/commit
USB: storage: Drop an unneeded a NULL test
authorJulia Lawall <julia@diku.dk>
Sun, 19 Jul 2009 15:29:57 +0000 (17:29 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 23 Sep 2009 13:46:29 +0000 (06:46 -0700)
commitf1bb056d42dde3a312e1e8642539a4c49569dd2a
treeb96e307aed23b98bd83c1096da8619e0d042849d
parent389336e34eb80b75d4284dd7656e50c1fc6c8417
USB: storage: Drop an unneeded a NULL test

In each case, the NULL test is not necessary because the function is static
and at the only places where it is called, the us argument has already been
dereferenced.

The semantic patch that finds the problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)

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

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

Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/storage/datafab.c
drivers/usb/storage/jumpshot.c