summaryrefslogtreecommitdiffstats
path: root/sys-utils/chcpu.c
diff options
context:
space:
mode:
authorBoris Egorov2015-06-19 21:40:59 +0200
committerKarel Zak2015-06-25 12:08:45 +0200
commite3ca1312a20424501144cebe6c2e6e78a5bf6db1 (patch)
tree8308000b8bfb0ea1796254b155d04d0f31701660 /sys-utils/chcpu.c
parentrename: allow full-path renames (diff)
downloadkernel-qcow2-util-linux-e3ca1312a20424501144cebe6c2e6e78a5bf6db1.tar.gz
kernel-qcow2-util-linux-e3ca1312a20424501144cebe6c2e6e78a5bf6db1.tar.xz
kernel-qcow2-util-linux-e3ca1312a20424501144cebe6c2e6e78a5bf6db1.zip
sys-utils/disk-utils/lib: fix printf format types [cppcheck]
Fix 'invalidPrintfArgType' cppcheck warnings Signed-off-by: Boris Egorov <egorov@linux.com>
Diffstat (limited to 'sys-utils/chcpu.c')
-rw-r--r--sys-utils/chcpu.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/sys-utils/chcpu.c b/sys-utils/chcpu.c
index 428fdc271..50b834c0a 100644
--- a/sys-utils/chcpu.c
+++ b/sys-utils/chcpu.c
@@ -84,22 +84,22 @@ static int cpu_enable(cpu_set_t *cpu_set, size_t setsize, int enable)
if (!CPU_ISSET(cpu, cpu_set))
continue;
if (!path_exist(_PATH_SYS_CPU "/cpu%d", cpu)) {
- warnx(_("CPU %d does not exist"), cpu);
+ warnx(_("CPU %u does not exist"), cpu);
fails++;
continue;
}
if (!path_exist(_PATH_SYS_CPU "/cpu%d/online", cpu)) {
- warnx(_("CPU %d is not hot pluggable"), cpu);
+ warnx(_("CPU %u is not hot pluggable"), cpu);
fails++;
continue;
}
online = path_read_s32(_PATH_SYS_CPU "/cpu%d/online", cpu);
if ((online == 1) && (enable == 1)) {
- printf(_("CPU %d is already enabled\n"), cpu);
+ printf(_("CPU %u is already enabled\n"), cpu);
continue;
}
if ((online == 0) && (enable == 0)) {
- printf(_("CPU %d is already disabled\n"), cpu);
+ printf(_("CPU %u is already disabled\n"), cpu);
continue;
}
if (path_exist(_PATH_SYS_CPU "/cpu%d/configure", cpu))
@@ -107,25 +107,25 @@ static int cpu_enable(cpu_set_t *cpu_set, size_t setsize, int enable)
if (enable) {
rc = path_write_str("1", _PATH_SYS_CPU "/cpu%d/online", cpu);
if ((rc == -1) && (configured == 0)) {
- warn(_("CPU %d enable failed (CPU is deconfigured)"), cpu);
+ warn(_("CPU %u enable failed (CPU is deconfigured)"), cpu);
fails++;
} else if (rc == -1) {
- warn(_("CPU %d enable failed"), cpu);
+ warn(_("CPU %u enable failed"), cpu);
fails++;
} else
- printf(_("CPU %d enabled\n"), cpu);
+ printf(_("CPU %u enabled\n"), cpu);
} else {
if (onlinecpus && num_online_cpus() == 1) {
- warnx(_("CPU %d disable failed (last enabled CPU)"), cpu);
+ warnx(_("CPU %u disable failed (last enabled CPU)"), cpu);
fails++;
continue;
}
rc = path_write_str("0", _PATH_SYS_CPU "/cpu%d/online", cpu);
if (rc == -1) {
- warn(_("CPU %d disable failed"), cpu);
+ warn(_("CPU %u disable failed"), cpu);
fails++;
} else {
- printf(_("CPU %d disabled\n"), cpu);
+ printf(_("CPU %u disabled\n"), cpu);
if (onlinecpus)
CPU_CLR(cpu, onlinecpus);
}
@@ -176,44 +176,44 @@ static int cpu_configure(cpu_set_t *cpu_set, size_t setsize, int configure)
if (!CPU_ISSET(cpu, cpu_set))
continue;
if (!path_exist(_PATH_SYS_CPU "/cpu%d", cpu)) {
- warnx(_("CPU %d does not exist"), cpu);
+ warnx(_("CPU %u does not exist"), cpu);
fails++;
continue;
}
if (!path_exist(_PATH_SYS_CPU "/cpu%d/configure", cpu)) {
- warnx(_("CPU %d is not configurable"), cpu);
+ warnx(_("CPU %u is not configurable"), cpu);
fails++;
continue;
}
current = path_read_s32(_PATH_SYS_CPU "/cpu%d/configure", cpu);
if ((current == 1) && (configure == 1)) {
- printf(_("CPU %d is already configured\n"), cpu);
+ printf(_("CPU %u is already configured\n"), cpu);
continue;
}
if ((current == 0) && (configure == 0)) {
- printf(_("CPU %d is already deconfigured\n"), cpu);
+ printf(_("CPU %u is already deconfigured\n"), cpu);
continue;
}
if ((current == 1) && (configure == 0) && onlinecpus &&
is_cpu_online(cpu)) {
- warnx(_("CPU %d deconfigure failed (CPU is enabled)"), cpu);
+ warnx(_("CPU %u deconfigure failed (CPU is enabled)"), cpu);
fails++;
continue;
}
if (configure) {
rc = path_write_str("1", _PATH_SYS_CPU "/cpu%d/configure", cpu);
if (rc == -1) {
- warn(_("CPU %d configure failed"), cpu);
+ warn(_("CPU %u configure failed"), cpu);
fails++;
} else
- printf(_("CPU %d configured\n"), cpu);
+ printf(_("CPU %u configured\n"), cpu);
} else {
rc = path_write_str("0", _PATH_SYS_CPU "/cpu%d/configure", cpu);
if (rc == -1) {
- warn(_("CPU %d deconfigure failed"), cpu);
+ warn(_("CPU %u deconfigure failed"), cpu);
fails++;
} else
- printf(_("CPU %d deconfigured\n"), cpu);
+ printf(_("CPU %u deconfigured\n"), cpu);
}
}