halcc: Remove spamming error log 71/311271/7
authorYoungjae Cho <y0.cho@samsung.com>
Fri, 17 May 2024 04:31:47 +0000 (13:31 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Mon, 20 May 2024 06:03:16 +0000 (15:03 +0900)
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 <y0.cho@samsung.com>
src/hal-api-compatibility-checker-object.c
src/hal-api-compatibility-checker-parser.c

index 6dffe7380b13642ad53121b75e007b90cdbc288f..b0318feebd9c832622126c8eaf39db529dd75afd 100644 (file)
@@ -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;
        }
index 63da72e3aa5b28eef52e9619b9abdcd4380092c9..bb3d26d3bf4350b0c12e21d4972f9e033fd93ec2 100644 (file)
@@ -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;