diff options
author | Markus Armbruster <armbru@redhat.com> | 2017-08-24 10:45:57 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2017-09-04 13:09:13 +0200 |
commit | 06c60b6c468ca7cde004fe7c3ce35de312855f55 (patch) | |
tree | 33e164badc15e320421ba47f5a26a622f4d85dee /block/gluster.c | |
parent | 64355088e0213b564eb6ef5d2658210accfcc32f (diff) |
qapi: Drop superfluous qapi_enum_parse() parameter max
The lookup tables have a sentinel, no need to make callers pass their
size.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <1503564371-26090-3-git-send-email-armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
[Rebased, commit message corrected]
Diffstat (limited to 'block/gluster.c')
-rw-r--r-- | block/gluster.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/block/gluster.c b/block/gluster.c index 3064a45047..8367e806d0 100644 --- a/block/gluster.c +++ b/block/gluster.c @@ -544,8 +544,7 @@ static int qemu_gluster_parse_json(BlockdevOptionsGluster *gconf, if (!strcmp(ptr, "tcp")) { ptr = "inet"; /* accept legacy "tcp" */ } - type = qapi_enum_parse(SocketAddressType_lookup, ptr, - SOCKET_ADDRESS_TYPE__MAX, -1, NULL); + type = qapi_enum_parse(SocketAddressType_lookup, ptr, -1, NULL); if (type != SOCKET_ADDRESS_TYPE_INET && type != SOCKET_ADDRESS_TYPE_UNIX) { error_setg(&local_err, @@ -1002,8 +1001,7 @@ static int qemu_gluster_create(const char *filename, BDRV_SECTOR_SIZE); tmp = qemu_opt_get_del(opts, BLOCK_OPT_PREALLOC); - prealloc = qapi_enum_parse(PreallocMode_lookup, tmp, - PREALLOC_MODE__MAX, PREALLOC_MODE_OFF, + prealloc = qapi_enum_parse(PreallocMode_lookup, tmp, PREALLOC_MODE_OFF, &local_err); g_free(tmp); if (local_err) { |