From 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Mon, 13 May 2024 10:30:14 +0000
Subject: [PATCH] modify sin led gpio
---
kernel/tools/power/cpupower/utils/cpupower-info.c | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/kernel/tools/power/cpupower/utils/cpupower-info.c b/kernel/tools/power/cpupower/utils/cpupower-info.c
index c7caa8e..0ba61a2 100644
--- a/kernel/tools/power/cpupower/utils/cpupower-info.c
+++ b/kernel/tools/power/cpupower/utils/cpupower-info.c
@@ -1,7 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0-only
/*
* (C) 2011 Thomas Renninger <trenn@suse.de>, Novell Inc.
- *
- * Licensed under the terms of the GNU GPL License version 2.
*/
@@ -11,6 +10,7 @@
#include <errno.h>
#include <string.h>
#include <getopt.h>
+#include <sys/utsname.h>
#include "helpers/helpers.h"
#include "helpers/sysfs.h"
@@ -31,6 +31,7 @@
extern char *optarg;
extern int optind, opterr, optopt;
unsigned int cpu;
+ struct utsname uts;
union {
struct {
@@ -39,6 +40,13 @@
int params;
} params = {};
int ret = 0;
+
+ ret = uname(&uts);
+ if (!ret && (!strcmp(uts.machine, "ppc64le") ||
+ !strcmp(uts.machine, "ppc64"))) {
+ fprintf(stderr, _("Subcommand not supported on POWER.\n"));
+ return ret;
+ }
setlocale(LC_ALL, "");
textdomain(PACKAGE);
@@ -54,7 +62,7 @@
default:
print_wrong_arg_exit();
}
- };
+ }
if (!params.params)
params.params = 0x7;
--
Gitblit v1.6.2