[PATCH] vmstate-static-checker:remove this redundant return

dinglimin posted 1 patch 1 year, 7 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20220928090312.2537-1-dinglimin@cmss.chinamobile.com
Maintainers: John Snow <jsnow@redhat.com>, Cleber Rosa <crosa@redhat.com>, Juan Quintela <quintela@redhat.com>, "Dr. David Alan Gilbert" <dgilbert@redhat.com>
scripts/vmstate-static-checker.py | 1 -
1 file changed, 1 deletion(-)
[PATCH] vmstate-static-checker:remove this redundant return
Posted by dinglimin 1 year, 7 months ago
Jump statements, such as return and continue let you
change the default flow of program execution,
but jump statements that direct the control flow to
the original direction are just a waste of keystrokes.

Signed-off-by: dinglimin <dinglimin@cmss.chinamobile.com>
---
 scripts/vmstate-static-checker.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/scripts/vmstate-static-checker.py b/scripts/vmstate-static-checker.py
index b369388360..dfeee8231a 100755
--- a/scripts/vmstate-static-checker.py
+++ b/scripts/vmstate-static-checker.py
@@ -367,7 +367,6 @@ def check_machine_type(s, d):
     if s["Name"] != d["Name"]:
         print("Warning: checking incompatible machine types:", end=' ')
         print("\"" + s["Name"] + "\", \"" + d["Name"] + "\"")
-    return
 
 
 def main():
-- 
2.30.0.windows.2
Re: [PATCH] vmstate-static-checker:remove this redundant return
Posted by Laurent Vivier 1 year, 6 months ago
Le 28/09/2022 à 11:03, dinglimin a écrit :
> Jump statements, such as return and continue let you
> change the default flow of program execution,
> but jump statements that direct the control flow to
> the original direction are just a waste of keystrokes.
> 
> Signed-off-by: dinglimin <dinglimin@cmss.chinamobile.com>
> ---
>   scripts/vmstate-static-checker.py | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/scripts/vmstate-static-checker.py b/scripts/vmstate-static-checker.py
> index b369388360..dfeee8231a 100755
> --- a/scripts/vmstate-static-checker.py
> +++ b/scripts/vmstate-static-checker.py
> @@ -367,7 +367,6 @@ def check_machine_type(s, d):
>       if s["Name"] != d["Name"]:
>           print("Warning: checking incompatible machine types:", end=' ')
>           print("\"" + s["Name"] + "\", \"" + d["Name"] + "\"")
> -    return
>   
>   
>   def main():

Applied to my trivial-patches branch.

Thanks,
Laurent


Re: [PATCH] vmstate-static-checker:remove this redundant return
Posted by John Snow 1 year, 6 months ago
On Wed, Sep 28, 2022 at 5:06 AM dinglimin
<dinglimin@cmss.chinamobile.com> wrote:
>
> Jump statements, such as return and continue let you
> change the default flow of program execution,
> but jump statements that direct the control flow to
> the original direction are just a waste of keystrokes.
>
> Signed-off-by: dinglimin <dinglimin@cmss.chinamobile.com>
> ---
>  scripts/vmstate-static-checker.py | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/scripts/vmstate-static-checker.py b/scripts/vmstate-static-checker.py
> index b369388360..dfeee8231a 100755
> --- a/scripts/vmstate-static-checker.py
> +++ b/scripts/vmstate-static-checker.py
> @@ -367,7 +367,6 @@ def check_machine_type(s, d):
>      if s["Name"] != d["Name"]:
>          print("Warning: checking incompatible machine types:", end=' ')
>          print("\"" + s["Name"] + "\", \"" + d["Name"] + "\"")
> -    return
>
>
>  def main():
> --
> 2.30.0.windows.2
>

This can go through the trivial branch.

Reviewed-by: John Snow <jsnow@redhat.com>