mirror of
https://github.com/mii443/qemu.git
synced 2025-08-22 23:25:48 +00:00
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]
This commit is contained in:
@ -16,7 +16,7 @@
|
||||
#include "qapi/util.h"
|
||||
|
||||
int qapi_enum_parse(const char * const lookup[], const char *buf,
|
||||
int max, int def, Error **errp)
|
||||
int def, Error **errp)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -24,7 +24,7 @@ int qapi_enum_parse(const char * const lookup[], const char *buf,
|
||||
return def;
|
||||
}
|
||||
|
||||
for (i = 0; i < max; i++) {
|
||||
for (i = 0; lookup[i]; i++) {
|
||||
if (!strcmp(buf, lookup[i])) {
|
||||
return i;
|
||||
}
|
||||
|
Reference in New Issue
Block a user