]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Staging: dgap: Remove unused variable
authorHaneen Mohammed <hamohammed.sa@gmail.com>
Sat, 7 Mar 2015 21:02:34 +0000 (00:02 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 Mar 2015 12:30:40 +0000 (13:30 +0100)
This patch removes variable that was used to store only the return value of a function call.

The issue was detected and resolved using the following coccinelle script:

@@
expression ret;
identifier f;
@@

-ret =
+return
f(...);
-return ret;

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/dgap/dgap.c

index d4d98a78f3acfe22640cc579e65af61ac0054bd2..cea5b26032d986396e797db1ba6d8a5a8fe6dee0 100644 (file)
@@ -1361,7 +1361,6 @@ static uint dgap_get_custom_baud(struct channel_t *ch)
 {
        u8 __iomem *vaddr;
        ulong offset;
-       uint value;
 
        if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
                return 0;
@@ -1384,8 +1383,7 @@ static uint dgap_get_custom_baud(struct channel_t *ch)
        offset = (ioread16(vaddr + ECS_SEG) << 4) + (ch->ch_portnum * 0x28)
               + LINE_SPEED;
 
-       value = readw(vaddr + offset);
-       return value;
+       return readw(vaddr + offset);
 }
 
 /*