[Qemu-devel] [RFC PATCH 07/32] qapi: Drop superfluous allow_optional=True

Markus Armbruster posted 32 patches 8 years, 4 months ago
[Qemu-devel] [RFC PATCH 07/32] qapi: Drop superfluous allow_optional=True
Posted by Markus Armbruster 8 years, 4 months ago
check_command() passes allow_optional=True to check_type().  Useless
unless you also pass allow_dict=True, which check_command() doesn't.
Drop the superfluous argument.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 scripts/qapi.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/qapi.py b/scripts/qapi.py
index 43a54bf40f..248af89b0b 100644
--- a/scripts/qapi.py
+++ b/scripts/qapi.py
@@ -695,7 +695,7 @@ def check_command(expr, info):
         returns_meta += ['built-in', 'alternate', 'enum']
     check_type(info, "'returns' for command '%s'" % name,
                expr.get('returns'), allow_array=True,
-               allow_optional=True, allow_metas=returns_meta)
+               allow_metas=returns_meta)
 
 
 def check_event(expr, info):
-- 
2.13.6


Re: [Qemu-devel] [RFC PATCH 07/32] qapi: Drop superfluous allow_optional=True
Posted by Marc-André Lureau 8 years, 4 months ago
On Mon, Oct 2, 2017 at 5:25 PM, Markus Armbruster <armbru@redhat.com> wrote:
> check_command() passes allow_optional=True to check_type().  Useless
> unless you also pass allow_dict=True, which check_command() doesn't.
> Drop the superfluous argument.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


> ---
>  scripts/qapi.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/qapi.py b/scripts/qapi.py
> index 43a54bf40f..248af89b0b 100644
> --- a/scripts/qapi.py
> +++ b/scripts/qapi.py
> @@ -695,7 +695,7 @@ def check_command(expr, info):
>          returns_meta += ['built-in', 'alternate', 'enum']
>      check_type(info, "'returns' for command '%s'" % name,
>                 expr.get('returns'), allow_array=True,
> -               allow_optional=True, allow_metas=returns_meta)
> +               allow_metas=returns_meta)
>
>
>  def check_event(expr, info):
> --
> 2.13.6
>
>



-- 
Marc-André Lureau