修訂 | 3deb15dd3fa5cad2d0bd4836c1c3e4508d8146ef (tree) |
---|---|
時間 | 2017-05-20 19:12:25 |
作者 | Chih-Wei Huang <cwhuang@linu...> |
Commiter | Chih-Wei Huang |
Clean up warnings
@@ -30,13 +30,15 @@ extern int delete_module(const char *, unsigned int); | ||
30 | 30 | #define CPU_ONLINE "1" |
31 | 31 | #define CPU_OFFLINE "0" |
32 | 32 | |
33 | +#define UNUSED __attribute__((__unused__)) | |
34 | + | |
33 | 35 | static void set_nonboot_cpu_state(const char *state) |
34 | 36 | { |
35 | 37 | static int cpu_n_fd; |
36 | 38 | char p[PATH_MAX]; |
37 | - int cpu_n = 1; | |
39 | + int cpu_n; | |
38 | 40 | |
39 | - for (;;) { | |
41 | + for (cpu_n = 1; ; cpu_n++) { | |
40 | 42 | snprintf(p, PATH_MAX, SYS_CPU "/cpu%d/online", cpu_n); |
41 | 43 | cpu_n_fd = open(p, O_RDWR); |
42 | 44 | if (cpu_n_fd < 0) { |
@@ -45,15 +47,14 @@ static void set_nonboot_cpu_state(const char *state) | ||
45 | 47 | ALOGV("Set CPU%d_online state %s ", cpu_n, state); |
46 | 48 | write(cpu_n_fd, state, 1); |
47 | 49 | close(cpu_n_fd); |
48 | - cpu_n++; | |
49 | 50 | } |
50 | 51 | } |
51 | 52 | |
52 | -static void power_init(struct power_module *module) | |
53 | +static void power_init(struct power_module *module UNUSED) | |
53 | 54 | { |
54 | 55 | } |
55 | 56 | |
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) | |
57 | 58 | { |
58 | 59 | char mod[PROPERTY_VALUE_MAX]; |
59 | 60 | 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) | ||
76 | 77 | set_nonboot_cpu_state(on ? CPU_ONLINE : CPU_OFFLINE); |
77 | 78 | } |
78 | 79 | |
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 | +{ | |
81 | 82 | switch (hint) { |
82 | 83 | default: |
83 | 84 | break; |