Hi,

> +     /* First, locate the params for this model */
> +     for (i = 0; i < PM121_NUM_CONFIGS; i++) {
> +             param = &(pm121_sys_all_params[loop_id][i]);
> +             if (param->model_id == pm121_mach_model)
> +                     break;
> +     }
> +
> +     /* No params found, put fans to max */
> +     if (param == NULL) {
> +             printk(KERN_WARNING "pm121: %s fan config not found "
> +                    " for this machine model\n",
> +                    loop_names[loop_id]);
> +             goto fail;
> +     }

This part might be buggy. param NULL only when PM121_NUM_CONFIGS is 0.
The original code was :


+       for (i = 0; i < PM121_NUM_CONFIGS; i++) {
+               if (pm121_sys_all_params[loop_id][i].model_id == 
pm121_mach_model) {
+                       param = &(pm121_sys_all_params[loop_id][i]);
+                       break;
+               }
+       }

But the line is wider than 80 chars. An alternative would be  :


+       for (i = 0; i < PM121_NUM_CONFIGS; i++) {
+               param = &(pm121_sys_all_params[loop_id][i]);
+               if (param->model_id == pm121_mach_model)
+                       break;
+               else
+                       param = NULL;
+       }

I wonder if that's more readable.


Regards,
Étienne.
-- 
E Ultreïa !

Attachment: signature.asc
Description: Ceci est une partie de message numériquement signée

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Reply via email to