From: Tahhan, Maryam Date: Tue, 23 May 2017 10:02:01 +0000 (+0100) Subject: mcelog: code review fix X-Git-Tag: collectd-5.8.0~109^2~6 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=c6350b3e442d2e1b5175bde3b16696c43f25c46f;p=collectd.git mcelog: code review fix Get rid of verbose mcelog_get_dimm() function and use llist_search() instead. Change-Id: Iccc5c083cf254b82c74f6f77df4a0659ba14282c Signed-off-by: Tahhan, Maryam --- diff --git a/src/mcelog.c b/src/mcelog.c index 4f3f9b0c..654305d3 100644 --- a/src/mcelog.c +++ b/src/mcelog.c @@ -115,17 +115,6 @@ static void mcelog_free_dimms_list_records(llist_t *dimms_list) { } -static llentry_t *mcelog_get_dimm(const char *name, llist_t *dimms_list) { - if (dimms_list == NULL) - return NULL; - - llentry_t *le = llist_search(g_mcelog_config.dimms_list, name); - if (le != NULL) - return le; - - return NULL; -} - /* Create or get dimm by dimm name/location */ static llentry_t *mcelog_dimm(const mcelog_memory_rec_t *rec, llist_t *dimms_list) { @@ -138,7 +127,7 @@ static llentry_t *mcelog_dimm(const mcelog_memory_rec_t *rec, } else sstrncpy(dimm_name, rec->location, sizeof(dimm_name)); - llentry_t *dimm_le = mcelog_get_dimm(dimm_name, dimms_list); + llentry_t *dimm_le = llist_search(g_mcelog_config.dimms_list, dimm_name); if (dimm_le == NULL) { mcelog_memory_rec_t *dimm_mr = calloc(1, sizeof(*dimm_mr));