Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

macintosh: change some data types from int to bool

Change the data type of the following variables from int to bool
across all macintosh drivers:

started
slots_started
pm121_started
wf_smu_started

Some of these issues were detected with the help of Coccinelle.

Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Gustavo A. R. Silva and committed by
Michael Ellerman
4f256d56 0bc00914

+17 -14
+2 -2
drivers/macintosh/therm_adt746x.c
··· 230 230 231 231 /* we don't care about local sensor, so we start at sensor 1 */ 232 232 for (i = 1; i < 3; i++) { 233 - int started = 0; 233 + bool started = false; 234 234 int fan_number = (th->type == ADT7460 && i == 2); 235 235 int var = th->temps[i] - th->limits[i]; 236 236 ··· 243 243 if (abs(var - th->last_var[fan_number]) < 2) 244 244 continue; 245 245 246 - started = 1; 246 + started = true; 247 247 new_speed = fan_speed + ((var-1)*step); 248 248 249 249 if (new_speed < fan_speed)
+4 -4
drivers/macintosh/windfarm_pm112.c
··· 96 96 static struct wf_pid_state backside_pid; 97 97 static int backside_tick; 98 98 static struct wf_pid_state slots_pid; 99 - static int slots_started; 99 + static bool slots_started; 100 100 static struct wf_pid_state drive_bay_pid; 101 101 static int drive_bay_tick; 102 102 103 103 static int nr_cores; 104 104 static int have_all_controls; 105 105 static int have_all_sensors; 106 - static int started; 106 + static bool started; 107 107 108 108 static int failure_state; 109 109 #define FAILURE_SENSOR 1 ··· 462 462 /* first time; initialize things */ 463 463 printk(KERN_INFO "windfarm: Slots control loop started.\n"); 464 464 wf_pid_init(&slots_pid, &slots_param); 465 - slots_started = 1; 465 + slots_started = true; 466 466 } 467 467 468 468 err = slots_power->ops->get_value(slots_power, &power); ··· 506 506 int i, last_failure; 507 507 508 508 if (!started) { 509 - started = 1; 509 + started = true; 510 510 printk(KERN_INFO "windfarm: CPUs control loops started.\n"); 511 511 for (i = 0; i < nr_cores; ++i) { 512 512 if (create_cpu_loop(i) < 0) {
+3 -2
drivers/macintosh/windfarm_pm121.c
··· 246 246 static struct wf_control *controls[N_CONTROLS] = {}; 247 247 248 248 /* Set to kick the control loop into life */ 249 - static int pm121_all_controls_ok, pm121_all_sensors_ok, pm121_started; 249 + static int pm121_all_controls_ok, pm121_all_sensors_ok; 250 + static bool pm121_started; 250 251 251 252 enum { 252 253 FAILURE_FAN = 1 << 0, ··· 807 806 pm121_create_sys_fans(i); 808 807 809 808 pm121_create_cpu_fans(); 810 - pm121_started = 1; 809 + pm121_started = true; 811 810 } 812 811 813 812 /* skipping ticks */
+1 -1
drivers/macintosh/windfarm_pm72.c
··· 611 611 int i, last_failure; 612 612 613 613 if (!started) { 614 - started = 1; 614 + started = true; 615 615 printk(KERN_INFO "windfarm: CPUs control loops started.\n"); 616 616 for (i = 0; i < nr_chips; ++i) { 617 617 if (cpu_setup_pid(i) < 0) {
+3 -2
drivers/macintosh/windfarm_pm81.c
··· 140 140 static struct wf_control *cpufreq_clamp; 141 141 142 142 /* Set to kick the control loop into life */ 143 - static int wf_smu_all_controls_ok, wf_smu_all_sensors_ok, wf_smu_started; 143 + static int wf_smu_all_controls_ok, wf_smu_all_sensors_ok; 144 + static bool wf_smu_started; 144 145 145 146 /* Failure handling.. could be nicer */ 146 147 #define FAILURE_FAN 0x01 ··· 550 549 DBG("wf: creating control loops !\n"); 551 550 wf_smu_create_sys_fans(); 552 551 wf_smu_create_cpu_fans(); 553 - wf_smu_started = 1; 552 + wf_smu_started = true; 554 553 } 555 554 556 555 /* Skipping ticks */
+3 -2
drivers/macintosh/windfarm_pm91.c
··· 75 75 static struct wf_control *cpufreq_clamp; 76 76 77 77 /* Set to kick the control loop into life */ 78 - static int wf_smu_all_controls_ok, wf_smu_all_sensors_ok, wf_smu_started; 78 + static int wf_smu_all_controls_ok, wf_smu_all_sensors_ok; 79 + static bool wf_smu_started; 79 80 static bool wf_smu_overtemp; 80 81 81 82 /* Failure handling.. could be nicer */ ··· 468 467 wf_smu_create_drive_fans(); 469 468 wf_smu_create_slots_fans(); 470 469 wf_smu_create_cpu_fans(); 471 - wf_smu_started = 1; 470 + wf_smu_started = true; 472 471 } 473 472 474 473 /* Skipping ticks */
+1 -1
drivers/macintosh/windfarm_rm31.c
··· 514 514 int i, last_failure; 515 515 516 516 if (!started) { 517 - started = 1; 517 + started = true; 518 518 printk(KERN_INFO "windfarm: CPUs control loops started.\n"); 519 519 for (i = 0; i < nr_chips; ++i) { 520 520 if (cpu_setup_pid(i) < 0) {