lkml.org 
[lkml]   [2005]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ppc64: Thermal control for SMU based machines
Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
>
> + /* First, locate the params for this model */
> + for (i = 0; i < WF_SMU_SYS_FANS_NUM_CONFIGS; i++)
> + if (wf_smu_sys_all_params[i].model_id == mach_model) {

The loop control is a bit scary here. If you were to do

#define WF_SMU_SYS_FANS_NUM_CONFIGS ARRAY_SIZE(wf_smu_sys_all_params)

then we wouldn't need duplicated into in two places.

> + param = &wf_smu_sys_all_params[i];
> + break;
> + }
> + /* No params found, put fans to max */
> + if (param == NULL) {
> + printk(KERN_WARNING "windfarm: System fan config not found "
> + "for this machine model, max fan speed\n");
> + goto fail;
> + }
> +
> + /* Alloc & initialize state */
> + wf_smu_sys_fans = kmalloc(sizeof(struct wf_smu_sys_fans_state),
> + GFP_KERNEL);
> + if (wf_smu_sys_fans == NULL) {
> + printk(KERN_WARNING "windfarm: Memory allocation error"
> + " max fan speed\n");
> + goto fail;
> + }
> + wf_smu_sys_fans->ticks = 1;

whitespace broke.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-10-12 02:13    [W:0.060 / U:6.300 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site