qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Shraddha Barke <shraddha.6596@gmail.com>
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	qemu-trivial@nongnu.org, Michael Tokarev <mjt@tls.msk.ru>
Cc: qemu-devel <qemu-devel@nongnu.org>,
	Shraddha Barke <shraddha.6596@gmail.com>
Subject: [Qemu-devel] [PATCH 2/2] Hw: timer: Remove unnecessary variable
Date: Fri, 25 Sep 2015 20:06:03 +0530	[thread overview]
Message-ID: <1443191763-3445-2-git-send-email-shraddha.6596@gmail.com> (raw)
In-Reply-To: <1443191763-3445-1-git-send-email-shraddha.6596@gmail.com>

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/timer/m48t59.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/hw/timer/m48t59.c b/hw/timer/m48t59.c
index 8ab683d..b3df8f9 100644
--- a/hw/timer/m48t59.c
+++ b/hw/timer/m48t59.c
@@ -590,10 +590,8 @@ static void nvram_writel (void *opaque, hwaddr addr, uint32_t value)
 static uint32_t nvram_readb (void *opaque, hwaddr addr)
 {
     M48t59State *NVRAM = opaque;
-    uint32_t retval;
 
-    retval = m48t59_read(NVRAM, addr);
-    return retval;
+    return m48t59_read(NVRAM, addr);
 }
 
 static uint32_t nvram_readw (void *opaque, hwaddr addr)
-- 
2.1.4

  reply	other threads:[~2015-09-25 14:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-25 14:36 [Qemu-devel] [PATCH 1/2] Hw: char: Remove unnecessary variable Shraddha Barke
2015-09-25 14:36 ` Shraddha Barke [this message]
2015-10-03 16:59   ` [Qemu-devel] [PATCH 2/2] Hw: timer: " Michael Tokarev
2015-10-05 15:29     ` Eric Blake
2015-10-08 16:45       ` Michael Tokarev
2015-10-03 17:01 ` [Qemu-devel] [PATCH 1/2] Hw: char: " Michael Tokarev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1443191763-3445-2-git-send-email-shraddha.6596@gmail.com \
    --to=shraddha.6596@gmail.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=mjt@tls.msk.ru \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).