Commit a579c978 authored by Mahati Chamarthy's avatar Mahati Chamarthy Committed by Greg Kroah-Hartman

Staging: media: lirc: Merge two lines and remove unused variable

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: default avatarMahati Chamarthy <mahati.chamarthy@gmail.com>
Acked-by: default avatarJulia Lawall <julia.lawall@lip6.fr>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 707505b5
...@@ -387,11 +387,9 @@ static unsigned char do_get_bits(void) ...@@ -387,11 +387,9 @@ static unsigned char do_get_bits(void)
static unsigned int read_index(unsigned char index) static unsigned int read_index(unsigned char index)
{ {
unsigned char __iomem *addr; unsigned char __iomem *addr;
unsigned int value;
/* addr = pci_addr_lin + DATA_PCI_OFF + ((index & 0xFF) << 2); */ /* addr = pci_addr_lin + DATA_PCI_OFF + ((index & 0xFF) << 2); */
addr = pci_addr_lin + ((index & 0xFF) << 2); addr = pci_addr_lin + ((index & 0xFF) << 2);
value = readl(addr); return readl(addr);
return value;
} }
static void write_index(unsigned char index, unsigned int reg_val) static void write_index(unsigned char index, unsigned int reg_val)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment