diff mbox

[1/2] Hw: char: Remove unnecessary variable

Message ID 1443191763-3445-1-git-send-email-shraddha.6596@gmail.com
State New
Headers show

Commit Message

Shraddha Barke Sept. 25, 2015, 2:36 p.m. UTC
Compress lines and remove the variable.

Change made using Coccinelle script

@@
expression ret;
@@
- if (ret) return ret;
- return 0;
+ return ret;
@@
local idexpression ret;
expression e;
@@
- ret = e;
- return ret;
+ return e;
@@
type T; identifier i;
@@
- T i;
... when != i

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
---
 hw/char/etraxfs_ser.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Michael Tokarev Oct. 3, 2015, 5:01 p.m. UTC | #1
25.09.2015 17:36, Shraddha Barke wrote:
> Compress lines and remove the variable.

Applied to -trivial, removing the Coccinelle script
from the commit message.

Thanks!

/mjt
diff mbox

Patch

diff --git a/hw/char/etraxfs_ser.c b/hw/char/etraxfs_ser.c
index 857c136..562021e 100644
--- a/hw/char/etraxfs_ser.c
+++ b/hw/char/etraxfs_ser.c
@@ -182,15 +182,13 @@  static void serial_receive(void *opaque, const uint8_t *buf, int size)
 static int serial_can_receive(void *opaque)
 {
     ETRAXSerial *s = opaque;
-    int r;
 
     /* Is the receiver enabled?  */
     if (!(s->regs[RW_REC_CTRL] & (1 << 3))) {
         return 0;
     }
 
-    r = sizeof(s->rx_fifo) - s->rx_fifo_len;
-    return r;
+    return sizeof(s->rx_fifo) - s->rx_fifo_len;
 }
 
 static void serial_event(void *opaque, int event)