Android-x86
Fork
捐款

  • R/O
  • HTTP
  • SSH
  • HTTPS

hardware-x86power: 提交

hardware/x86power


Commit MetaInfo

修訂3deb15dd3fa5cad2d0bd4836c1c3e4508d8146ef (tree)
時間2017-05-20 19:12:25
作者Chih-Wei Huang <cwhuang@linu...>
CommiterChih-Wei Huang

Log Message

Clean up warnings

Change Summary

差異

--- a/power.c
+++ b/power.c
@@ -30,13 +30,15 @@ extern int delete_module(const char *, unsigned int);
3030 #define CPU_ONLINE "1"
3131 #define CPU_OFFLINE "0"
3232
33+#define UNUSED __attribute__((__unused__))
34+
3335 static void set_nonboot_cpu_state(const char *state)
3436 {
3537 static int cpu_n_fd;
3638 char p[PATH_MAX];
37- int cpu_n = 1;
39+ int cpu_n;
3840
39- for (;;) {
41+ for (cpu_n = 1; ; cpu_n++) {
4042 snprintf(p, PATH_MAX, SYS_CPU "/cpu%d/online", cpu_n);
4143 cpu_n_fd = open(p, O_RDWR);
4244 if (cpu_n_fd < 0) {
@@ -45,15 +47,14 @@ static void set_nonboot_cpu_state(const char *state)
4547 ALOGV("Set CPU%d_online state %s ", cpu_n, state);
4648 write(cpu_n_fd, state, 1);
4749 close(cpu_n_fd);
48- cpu_n++;
4950 }
5051 }
5152
52-static void power_init(struct power_module *module)
53+static void power_init(struct power_module *module UNUSED)
5354 {
5455 }
5556
56-static void power_set_interactive(struct power_module *module, int on)
57+static void power_set_interactive(struct power_module *module UNUSED, int on)
5758 {
5859 char mod[PROPERTY_VALUE_MAX];
5960 if ((!property_get("wlan.no-unload-driver", mod, NULL) || strcmp(mod, "1"))
@@ -76,8 +77,8 @@ static void power_set_interactive(struct power_module *module, int on)
7677 set_nonboot_cpu_state(on ? CPU_ONLINE : CPU_OFFLINE);
7778 }
7879
79-static void power_hint(struct power_module *module, power_hint_t hint,
80- void *data) {
80+static void power_hint(struct power_module *module UNUSED, power_hint_t hint, void *data UNUSED)
81+{
8182 switch (hint) {
8283 default:
8384 break;
Show on old repository browser