From: "Étienne Bersac" <bersace@gmail.com>
To: linuxppc-dev <linuxppc-dev@ozlabs.org>
Subject: Re: [PATCH] windfarm: add PowerMac 12,1 support
Date: Thu, 06 Dec 2007 16:30:51 +0100 [thread overview]
Message-ID: <1196955051.6862.10.camel@thilivren> (raw)
In-Reply-To: <1196904050.7132.36.camel@thilivren>
[-- Attachment #1: Type: text/plain, Size: 1090 bytes --]
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 #2: Ceci est une partie de message numériquement signée --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2007-12-06 15:30 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-06 1:20 [PATCH] windfarm: add PowerMac 12,1 support Étienne Bersac
2007-12-06 15:30 ` Étienne Bersac [this message]
2007-12-10 15:11 ` Étienne Bersac
2007-12-10 15:39 ` Arnd Bergmann
2007-12-10 17:17 ` Étienne Bersac
2007-12-10 17:22 ` Étienne Bersac
-- strict thread matches above, loose matches on Subject: below --
2008-01-26 11:55 Étienne Bersac
2008-03-22 19:35 ` David Woodhouse
2008-03-22 22:13 ` Benjamin Herrenschmidt
2008-03-22 23:02 ` David Woodhouse
2008-03-22 23:14 ` David Woodhouse
2008-03-22 23:25 ` Benjamin Herrenschmidt
2008-03-22 23:25 ` Stephen Rothwell
2008-03-22 23:31 ` David Woodhouse
2008-03-23 1:01 ` Andreas Schwab
2008-03-23 5:38 ` Stephen Rothwell
2008-04-29 5:39 Benjamin Herrenschmidt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1196955051.6862.10.camel@thilivren \
--to=bersace@gmail.com \
--cc=linuxppc-dev@ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).