hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/tools/power/cpupower/utils/cpupower-info.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"
....@@ -31,6 +31,7 @@
3131 extern char *optarg;
3232 extern int optind, opterr, optopt;
3333 unsigned int cpu;
34
+ struct utsname uts;
3435
3536 union {
3637 struct {
....@@ -39,6 +40,13 @@
3940 int params;
4041 } params = {};
4142 int ret = 0;
43
+
44
+ ret = uname(&uts);
45
+ if (!ret && (!strcmp(uts.machine, "ppc64le") ||
46
+ !strcmp(uts.machine, "ppc64"))) {
47
+ fprintf(stderr, _("Subcommand not supported on POWER.\n"));
48
+ return ret;
49
+ }
4250
4351 setlocale(LC_ALL, "");
4452 textdomain(PACKAGE);
....@@ -54,7 +62,7 @@
5462 default:
5563 print_wrong_arg_exit();
5664 }
57
- };
65
+ }
5866
5967 if (!params.params)
6068 params.params = 0x7;