From 985a604f95555d62056b7d5f190bb71b2afe699e Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Tue, 22 Jan 2013 09:45:27 +0100 Subject: [PATCH] oui: Inline __do_lookup_inline() macro lookup_vendor() is the only user of __do_lookup_inline() so inline it there. Signed-off-by: Tobias Klauser --- src/oui.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/oui.c b/src/oui.c index cf672e90..45bceeec 100644 --- a/src/oui.c +++ b/src/oui.c @@ -21,19 +21,14 @@ struct vendor_id { struct vendor_id *next; }; -/* Note: this macro only applies to the lookup_* functions here in this file, - * mainly to remove redundand code. */ -#define __do_lookup_inline(id, struct_name, hash_ptr, struct_member) \ - ({ \ - struct struct_name *entry = lookup_hash(id, hash_ptr); \ - while (entry && id != entry->id) \ - entry = entry->next; \ - (entry && id == entry->id ? entry->struct_member : NULL); \ - }) - const char *lookup_vendor(unsigned int id) { - return __do_lookup_inline(id, vendor_id, &oui, vendor); + struct vendor_id *entry = lookup_hash(id, &oui); + + while (entry && id != entry->id) + entry = entry->next; + + return (entry && id == entry->id ? entry->vendor : NULL); } void dissector_init_oui(void) -- 2.11.4.GIT