lkml.org 
[lkml]   [2005]   [Oct]   [11]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateTue, 11 Oct 2005 17:10:52 -0700
FromAndrew Morton <>
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 00:13    [from the cache]
©2003-2008