eventdev: update references to removed function
[dpdk.git] / lib / librte_power / power_acpi_cpufreq.c
index 534efe8..5672c59 100644 (file)
@@ -12,6 +12,7 @@
 #include <signal.h>
 #include <limits.h>
 
+#include <rte_string_fns.h>
 #include <rte_memcpy.h>
 #include <rte_atomic.h>
 
@@ -147,6 +148,8 @@ power_set_governor_userspace(struct rte_power_info *pi)
 
        s = fgets(buf, sizeof(buf), f);
        FOPS_OR_NULL_GOTO(s, out);
+       /* Strip off terminating '\n' */
+       strtok(buf, "\n");
 
        /* Check if current governor is userspace */
        if (strncmp(buf, POWER_GOVERNOR_USERSPACE,
@@ -157,7 +160,7 @@ power_set_governor_userspace(struct rte_power_info *pi)
                goto out;
        }
        /* Save the original governor */
-       snprintf(pi->governor_ori, sizeof(pi->governor_ori), "%s", buf);
+       strlcpy(pi->governor_ori, buf, sizeof(pi->governor_ori));
 
        /* Write 'userspace' to the governor */
        val = fseek(f, 0, SEEK_SET);