All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-trivial] [PATCH] Target-ppc: Remove unnecessary variable
@ 2015-09-04 19:20 Shraddha Barke
  2015-09-06 11:04 ` Michael Tokarev
  0 siblings, 1 reply; 2+ messages in thread
From: Shraddha Barke @ 2015-09-04 19:20 UTC (permalink / raw)
  To: Alexander Graf, qemu-ppc, qemu-trivial; +Cc: Shraddha Barke

Compress lines and remove the variable ret.

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>
---
 target-ppc/translate_init.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
index 16d7b16..b541473 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -8577,11 +8577,7 @@ static int register_ind_insn (opc_handler_t **ppc_opcodes,
                               unsigned char idx1, unsigned char idx2,
                               opc_handler_t *handler)
 {
-    int ret;
-
-    ret = register_ind_in_table(ppc_opcodes, idx1, idx2, handler);
-
-    return ret;
+    return register_ind_in_table(ppc_opcodes, idx1, idx2, handler);
 }
 
 static int register_dblind_insn (opc_handler_t **ppc_opcodes,
@@ -9350,8 +9346,7 @@ static ObjectClass *ppc_cpu_class_by_name(const char *name)
                 break;
         }
         if (i == 8) {
-            ret = OBJECT_CLASS(ppc_cpu_class_by_pvr(strtoul(name, NULL, 16)));
-            return ret;
+            return OBJECT_CLASS(ppc_cpu_class_by_pvr(strtoul(name, NULL, 16)));
         }
     }
 
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-trivial] [PATCH] Target-ppc: Remove unnecessary variable
  2015-09-04 19:20 [Qemu-trivial] [PATCH] Target-ppc: Remove unnecessary variable Shraddha Barke
@ 2015-09-06 11:04 ` Michael Tokarev
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Tokarev @ 2015-09-06 11:04 UTC (permalink / raw)
  To: Shraddha Barke, Alexander Graf, qemu-ppc, qemu-trivial

04.09.2015 22:20, Shraddha Barke wrote:
> Compress lines and remove the variable ret.

Applied to -trivial, thanks!

/mjt



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-06 11:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-04 19:20 [Qemu-trivial] [PATCH] Target-ppc: Remove unnecessary variable Shraddha Barke
2015-09-06 11:04 ` Michael Tokarev

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.