remove extra parentheses in return statement
[dpdk.git] / examples / qos_sched / args.c
old mode 100755 (executable)
new mode 100644 (file)
index 99469fe..3e7fd08
@@ -112,7 +112,7 @@ app_usage(const char *prgname)
 
 static inline int str_is(const char *str, const char *is)
 {
-       return (strcmp(str, is) == 0);
+       return strcmp(str, is) == 0;
 }
 
 /* returns core mask used by DPDK */
@@ -143,7 +143,7 @@ app_cpu_core_count(void)
        uint32_t ncores = 0;
 
        for(i = 0; i < RTE_MAX_LCORE; i++) {
-               len = rte_snprintf(path, sizeof(path), SYS_CPU_DIR, i);
+               len = snprintf(path, sizeof(path), SYS_CPU_DIR, i);
                if (len <= 0 || (unsigned)len >= sizeof(path))
                        continue;
 
@@ -264,17 +264,20 @@ app_parse_flow_conf(const char *conf_str)
        }
 
        if (pconf->rx_port >= RTE_MAX_ETHPORTS) {
-               RTE_LOG(ERR, APP, "pfc %u: invalid rx port %hu index\n", nb_pfc, pconf->rx_port);
+               RTE_LOG(ERR, APP, "pfc %u: invalid rx port %"PRIu8" index\n",
+                               nb_pfc, pconf->rx_port);
                return -1;
        }
        if (pconf->tx_port >= RTE_MAX_ETHPORTS) {
-               RTE_LOG(ERR, APP, "pfc %u: invalid tx port %hu index\n", nb_pfc, pconf->rx_port);
+               RTE_LOG(ERR, APP, "pfc %u: invalid tx port %"PRIu8" index\n",
+                               nb_pfc, pconf->rx_port);
                return -1;
        }
 
        mask = 1lu << pconf->rx_port;
        if (app_used_rx_port_mask & mask) {
-               RTE_LOG(ERR, APP, "pfc %u: rx port %hu is used already\n", nb_pfc, pconf->rx_port);
+               RTE_LOG(ERR, APP, "pfc %u: rx port %"PRIu8" is used already\n",
+                               nb_pfc, pconf->rx_port);
                return -1;
        }
        app_used_rx_port_mask |= mask;
@@ -282,7 +285,8 @@ app_parse_flow_conf(const char *conf_str)
 
        mask = 1lu << pconf->tx_port;
        if (app_used_tx_port_mask & mask) {
-               RTE_LOG(ERR, APP, "pfc %u: port %hu is used already\n", nb_pfc, pconf->tx_port);
+               RTE_LOG(ERR, APP, "pfc %u: port %"PRIu8" is used already\n",
+                               nb_pfc, pconf->tx_port);
                return -1;
        }
        app_used_tx_port_mask |= mask;
@@ -479,4 +483,3 @@ app_parse_args(int argc, char **argv)
 
        return 0;
 }
-