This patch merges an assignment with an immediately following return of
the assigned variable. It also removes a variable that becomes unused due to this transformation.
The following Coccinelle semantic patch was used to make this transformation:
@r@
identifier ret;
identifier f;
@@
-ret =
+return
f(...);
-return ret;
@@
identifier r.ret;
expression e1;
type t;
@@
(
-t ret = e1;
|
-t ret;
)
... when != ret
when strict
Signed-off-by: Mahati Chamarthy <mahati.chamarthy@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
static unsigned int read_index(unsigned char index)
{
unsigned char __iomem *addr;
- unsigned int value;
/* addr = pci_addr_lin + DATA_PCI_OFF + ((index & 0xFF) << 2); */
addr = pci_addr_lin + ((index & 0xFF) << 2);
- value = readl(addr);
- return value;
+ return readl(addr);
}
static void write_index(unsigned char index, unsigned int reg_val)