Skip to contentSkip to conversation

xen-hvm: Remove redandant varialbe 'xstate'

PATCH In review Chen Gang 4 participants 6 messages Nov 11, 2014

lore
Share & tools
lore

Chen Gang

author
#0 lore raw

PATCH 1/1 xen-hvm: Remove redandant varialbe 'xstate'

In xen_hvm_change_state_handler(), can pass 'opaque' with type cast to xen_main_loop_prepare() directly, need not use additional variable for it.

---
 xen-hvm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
xen-hvm.c +1 -2
index 21f1cbb..7548794 100644
@@ -993,9 +993,8 @@ static void xen_main_loop_prepare(XenIOState *state)
 static void xen_hvm_change_state_handler(void *opaque, int running,
                                          RunState rstate)
 {
-    XenIOState *xstate = opaque;
     if (running) {
-        xen_main_loop_prepare(xstate);
+        xen_main_loop_prepare((XenIOState *)opaque);
     }
 }
 
Signature · 1 line
1.8.5.2 (Apple Git-48)
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Chen Gang

In xen_hvm_change_state_handler(), can pass 'opaque' with type cast to xen_main_loop_prepare() directly, need not use additional variable for it.

Quoted 21 lines
 xen-hvm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
xen-hvm.c +1 -2
index 21f1cbb..7548794 100644
@@ -993,9 +993,8 @@ static void xen_main_loop_prepare(XenIOState *state)
 static void xen_hvm_change_state_handler(void *opaque, int running,
                                          RunState rstate)
 {
-    XenIOState *xstate = opaque;
     if (running) {
-        xen_main_loop_prepare(xstate);
+        xen_main_loop_prepare((XenIOState *)opaque);
     }
 }
 
Signature · 1 line
1.8.5.2 (Apple Git-48)
#2 lore raw
Quoted 4 lines · Stefano Stabellini
Quoted 3 lines · Chen Gang

In xen_hvm_change_state_handler(), can pass 'opaque' with type cast to xen_main_loop_prepare() directly, need not use additional variable for it.

The title of your patch should say 'variable'.

Quoted 32 lines
Quoted 2 lines
Quoted 21 lines
 xen-hvm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
xen-hvm.c +1 -2
index 21f1cbb..7548794 100644
@@ -993,9 +993,8 @@ static void xen_main_loop_prepare(XenIOState *state)
 static void xen_hvm_change_state_handler(void *opaque, int running,
                                          RunState rstate)
 {
-    XenIOState *xstate = opaque;
     if (running) {
-        xen_main_loop_prepare(xstate);
+        xen_main_loop_prepare((XenIOState *)opaque);
     }
 }
 
Signature · 1 line
1.8.5.2 (Apple Git-48)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

author
#3 lore raw
Quoted 7 lines · Konrad Rzeszutek Wilk
Quoted 4 lines · Stefano Stabellini
Quoted 3 lines · Chen Gang

In xen_hvm_change_state_handler(), can pass 'opaque' with type cast to xen_main_loop_prepare() directly, need not use additional variable for it.

The title of your patch should say 'variable'.

Oh, yes, thanks. If necessary to send patch v2 for it, please let me know.

Thanks.

Quoted 32 lines
Quoted 32 lines
Quoted 2 lines
Quoted 21 lines
 xen-hvm.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
xen-hvm.c +1 -2
index 21f1cbb..7548794 100644
@@ -993,9 +993,8 @@ static void xen_main_loop_prepare(XenIOState *state)
 static void xen_hvm_change_state_handler(void *opaque, int running,
                                          RunState rstate)
 {
-    XenIOState *xstate = opaque;
     if (running) {
-        xen_main_loop_prepare(xstate);
+        xen_main_loop_prepare((XenIOState *)opaque);
     }
 }
 
Signature · 1 line
1.8.5.2 (Apple Git-48)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

Signature · 3 lines
Chen Gang

Open, share, and attitude like air, water, and life which God blessed
#5 lore raw
In reply to Chen Gang
Quoted 3 lines · Chen Gang

In xen_hvm_change_state_handler(), can pass 'opaque' with type cast to xen_main_loop_prepare() directly, need not use additional variable for it.

gcc most likely eliminates it anyway, but heck, why not? Applied to -trivial, thank you!

/mjt

#4 lore raw
In reply to Chen Gang
Quoted 4 lines · Chen Gang
Quoted 1 line

The title of your patch should say 'variable'.

Oh, yes, thanks. If necessary to send patch v2 for it, please let me know.

Not only 'varialbe', but also 'redandant'. I fixed both on commit, plus fixed grammar in commit message.

Thanks,

/mjt