hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/tools/power/cpupower/utils/cpupower-set.c
....@@ -1,7 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * (C) 2011 Thomas Renninger <trenn@suse.de>, Novell Inc.
3
- *
4
- * Licensed under the terms of the GNU GPL License version 2.
54 */
65
76
....@@ -11,6 +10,7 @@
1110 #include <errno.h>
1211 #include <string.h>
1312 #include <getopt.h>
13
+#include <sys/utsname.h>
1414
1515 #include "helpers/helpers.h"
1616 #include "helpers/sysfs.h"
....@@ -32,6 +32,7 @@
3232 extern char *optarg;
3333 extern int optind, opterr, optopt;
3434 unsigned int cpu;
35
+ struct utsname uts;
3536
3637 union {
3738 struct {
....@@ -41,6 +42,13 @@
4142 } params;
4243 int perf_bias = 0;
4344 int ret = 0;
45
+
46
+ ret = uname(&uts);
47
+ if (!ret && (!strcmp(uts.machine, "ppc64le") ||
48
+ !strcmp(uts.machine, "ppc64"))) {
49
+ fprintf(stderr, _("Subcommand not supported on POWER.\n"));
50
+ return ret;
51
+ }
4452
4553 setlocale(LC_ALL, "");
4654 textdomain(PACKAGE);
....@@ -64,7 +72,7 @@
6472 default:
6573 print_wrong_arg_exit();
6674 }
67
- };
75
+ }
6876
6977 if (!params.params)
7078 print_wrong_arg_exit();