]> git.baikalelectronics.ru Git - kernel.git/commit
USB: serial: Eliminate useless code
authorJulia Lawall <julia@diku.dk>
Sat, 16 Jan 2010 15:59:51 +0000 (16:59 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 2 Mar 2010 22:54:34 +0000 (14:54 -0800)
commit4864340cdf25ed0d3791b653c769126d76a25998
treecd4113243e7a16574176b3c5543609ebea82340b
parentd7db1ebe7491fb63b50f5ee6384b6d754835b18d
USB: serial: Eliminate useless code

The variables priv and portdata are initialized twice to the same (side
effect-free) expressions.  Drop one initialization in each case.

A simplified version of the semantic match that finds this problem is:
(http://coccinelle.lip6.fr/)

// <smpl>
@forall@
idexpression *x;
identifier f!=ERR_PTR;
@@

x = f(...)
... when != x
(
x = f(...,<+...x...+>,...)
|
* x = f(...)
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/serial/cypress_m8.c
drivers/usb/serial/sierra.c