From: Youngjae Cho Date: Fri, 17 May 2024 04:31:47 +0000 (+0900) Subject: halcc: Remove spamming error log X-Git-Tag: accepted/tizen/unified/20240611.122614~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8522eafc9d40aee896aa93100db5d927a6bfe15e;p=platform%2Fhal%2Fapi%2Fcommon.git halcc: Remove spamming error log Those removed logs used to be emitted even when the manifest xml is well structured because current xml scheme doesn't use all the text node but selectively on some elements. Therefore such elements that have no text node used to emit error log quite frequently. Change-Id: I6e2c256033efbb6033969ace020e2e8a30d45b29 Signed-off-by: Youngjae Cho --- diff --git a/src/hal-api-compatibility-checker-object.c b/src/hal-api-compatibility-checker-object.c index 6dffe73..b0318fe 100644 --- a/src/hal-api-compatibility-checker-object.c +++ b/src/hal-api-compatibility-checker-object.c @@ -299,10 +299,8 @@ int halcc_manifest_find_hal(halcc_manifest *manifest, } h = hashtable_hal_lookup(manifest->hals, hal_name); - if (!h) { - printf("Failed to find hal=%s\n", hal_name); + if (!h) return -ENOTSUP; - } if (hal) *hal = g_steal_pointer(&h); @@ -526,15 +524,11 @@ bool halcc_hal_is_compatible_with_version(halcc_hal *hal, int major, int minor) } for (int i = 0; i < hal->num_version_list; ++i) { - if (hal->version_list[i].major != major) { - printf("Major not matched\n"); + if (hal->version_list[i].major != major) continue; - } - if (hal->version_list[i].minor < minor) { - printf("Minor not supported\n"); + if (hal->version_list[i].minor < minor) continue; - } return true; } diff --git a/src/hal-api-compatibility-checker-parser.c b/src/hal-api-compatibility-checker-parser.c index 63da72e..bb3d26d 100644 --- a/src/hal-api-compatibility-checker-parser.c +++ b/src/hal-api-compatibility-checker-parser.c @@ -66,10 +66,8 @@ static int parse_hal(xmlNode *node, halcc_manifest *manifest) assert(node); assert(manifest); - if (!xmlStrEqual(node->name, "hal")) { - printf("Invalid hal node, %s\n", node->name); + if (!xmlStrEqual(node->name, "hal")) return -EINVAL; - } for (xmlNode *child = node->children; child; child = child->next) { if (xmlStrEqual(child->name, "name")) { @@ -163,10 +161,8 @@ static int parse_manifest(xmlNode *node, halcc_manifest *manifest) assert(node); assert(manifest); - if (!xmlStrEqual(node->name, "manifest")) { - printf("Invalid manifest node, %s\n", node->name); + if (!xmlStrEqual(node->name, "manifest")) return -EINVAL; - } // version prop = xmlGetProp(node, "platform-version"); @@ -189,13 +185,8 @@ static int parse_manifest(xmlNode *node, halcc_manifest *manifest) return -EINVAL; } - for (xmlNode *child = node->children; child; child = child->next) { - int ret; - - ret = parse_hal(child, manifest); - if (ret != 0) - printf("Failed to parse_hal(), ret=%d\n", ret); - } + for (xmlNode *child = node->children; child; child = child->next) + parse_hal(child, manifest); return 0; } @@ -222,10 +213,8 @@ static int parse_xml_doc(xmlDoc *doc, halcc_manifest *manifest) for (xmlNode *child = root->children; child; child = child->next) { ret = parse_manifest(child, manifest); - if (ret != 0) { - printf("Failed to parse_manifest(), ret=%d\n", ret); + if (ret != 0) continue; - } } return 0;