Skip to contentSkip to conversation

tools/xsplice: cleanup unnecessary "j = ARRAY_SIZE(action_options); "

PATCH In review Dongli Zhang 3 participants 4 messages May 30, 2016 – Jun 9, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/xsplice: cleanup unnecessary "j = ARRAY_SIZE(action_options); "

Local variable "j" would be used only when "i == ARRAY_SIZE(main_options)" is true. Thus, it is not necessary to update "j" when "i == ARRAY_SIZE(main_options)" is false.

---
 tools/misc/xen-xsplice.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
tools/misc/xen-xsplice.c +1 -2
index ddaa079..811dc57 100644
@@ -435,8 +435,7 @@ int main(int argc, char *argv[])
                    "'xen-xsplice help'\n", argv[1]);
             return 1;
         }
-    } else
-        j = ARRAY_SIZE(action_options);
+    }
 
     xch = xc_interface_open(0,0,0);
     if ( !xch )
Signature · 7 lines
1.9.1


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Dongli Zhang

Local variable "j" would be used only when "i == ARRAY_SIZE(main_options)" is true. Thus, it is not necessary to update "j" when "i == ARRAY_SIZE(main_options)" is false.

Wei, it is up to you whether it should go in 4.7 or in 4.8. This is a cleanup so it has no effect on the code.

Quoted 21 lines
---
 tools/misc/xen-xsplice.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
tools/misc/xen-xsplice.c +1 -2
index ddaa079..811dc57 100644
@@ -435,8 +435,7 @@ int main(int argc, char *argv[])
                    "'xen-xsplice help'\n", argv[1]);
             return 1;
         }
-    } else
-        j = ARRAY_SIZE(action_options);
+    }
 
     xch = xc_interface_open(0,0,0);
     if ( !xch )
Signature · 1 line
1.9.1

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

#2 lore raw
Quoted 5 lines · Konrad Rzeszutek Wilk
Quoted 4 lines · Dongli Zhang

Local variable "j" would be used only when "i == ARRAY_SIZE(main_options)" is true. Thus, it is not necessary to update "j" when "i == ARRAY_SIZE(main_options)" is false.

Quoted 7 lines
Quoted 1 line

Wei, it is up to you whether it should go in 4.7 or in 4.8. This is a cleanup so it has no effect on the code.

This can wait.

You obviously have more important code churn then this. Do want to make your life harder.

Wei.

Quoted 16 lines
Quoted 16 lines
---
 tools/misc/xen-xsplice.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
tools/misc/xen-xsplice.c +1 -2
index ddaa079..811dc57 100644
@@ -435,8 +435,7 @@ int main(int argc, char *argv[])
                    "'xen-xsplice help'\n", argv[1]);
             return 1;
         }
-    } else
-        j = ARRAY_SIZE(action_options);
+    }
 
Quoted 5 lines
Quoted 5 lines
tools/misc/xen-xsplice.c +0 -0
     xch = xc_interface_open(0,0,0);
     if ( !xch )
Signature · 1 line
1.9.1

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

#3 lore raw
In reply to Dongli Zhang
Quoted 14 lines · Dongli Zhang

Local variable "j" would be used only when "i == ARRAY_SIZE(main_options)" is true. Thus, it is not necessary to update "j" when "i == ARRAY_SIZE(main_options)" is false.

---
 tools/misc/xen-xsplice.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
tools/misc/xen-xsplice.c +0 -0
index ddaa079..811dc57 100644

tools/misc/xen-xsplice.c int main(int argc, char *argv[]) · line 439

Quoted 7 lines
tools/misc/xen-xsplice.c +1 -2
@@ -435,8 +435,7 @@ int main(int argc, char *argv[])
                    "'xen-xsplice help'\n", argv[1]);
             return 1;
         }
-    } else
-        j = ARRAY_SIZE(action_options);
+    }
 

And of course since xsplice doesn't exist anymore, this patch won't apply.

Dongli, can you resubmit this patch and update the subject line accordingly?

You can of course keep Konrad's Review-by tag. I don't expect him to object.

Wei.

Quoted 5 lines
tools/misc/xen-xsplice.c +0 -0
     xch = xc_interface_open(0,0,0);
     if ( !xch )
Signature · 1 line
1.9.1

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