From: Joe Perches <joe@perches.com>
To: Peter Feuerer <peter@piie.net>
Cc: LKML <linux-kernel@vger.kernel.org>,
lenb@kernel.org, Matthew Garrett <mjg59@srcf.ucam.org>
Subject: Re: [PATCH] Acer Aspire One Fan Control
Date: Sun, 26 Apr 2009 15:20:54 -0700 [thread overview]
Message-ID: <1240784454.22585.14.camel@localhost> (raw)
In-Reply-To: <cone.1240648971.372002.7492.1000@mentalhome>
On Sat, 2009-04-25 at 10:42 +0200, Peter Feuerer wrote:
> The patch is compiled and tested against current git/torvalds/linux-2.6.git checkout.
>
> What do you think? Do you have any questions?
Trivial comments:
> diff --git a/drivers/platform/x86/acerhdf.c b/drivers/platform/x86/acerhdf.c
> new file mode 100644
> index 0000000..63dc485
> --- /dev/null
> +++ b/drivers/platform/x86/acerhdf.c
> @@ -0,0 +1,594 @@
> +/*
> + * acerhdf - A kernelmodule which monitors the temperature
kernel module
> + * of the aspire one netbook, turns on/off the fan
> + * as soon as the upper/lower threshold is reached.
> + *
> + * (C) 2009 - Peter Feuerer peter (a) piie.net
> + * http://piie.net
> + *
> + *
> + *
> + * Inspired by and many thanks to:
> + * o acerfand - Rachel Greenham
> + * o acer_ec.pl - Michael Kurz michi.kurz (at) googlemail.com
> + * - Petr Tomasek tomasek (#) etf,cuni,cz
> + * - Carlos Corbacho cathectic (at) gmail.com
> + *
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
> + *
> + *
> + * 06-February-2009: Version 0.1:
> + * - first relase, containing absolutely no bugs! ;)
[]
> + * 25-April-2009: Version 0.5:
> + * - ported to 2.6.30
> + * - removed kthread and used polling of thermal api
Version information in comments isn't generally useful
> +/* print currend operation mode - kernel / user */
current
> +static int set_mode(struct thermal_zone_device *thermal,
> + enum thermal_device_mode mode)
> +{
> + if (mode == THERMAL_DEVICE_DISABLED) {
> + if (verbose)
> + printk(KERN_NOTICE "acerhdf: kernelmode OFF\n");
> + thermal->polling_delay = 0;
> + thermal_zone_device_update(thermal);
> + change_fanstate(1);
> + /* silly hack - let the polling thread disable
> + * kernelmode. This ensures, that the polling thread
> + * doesn't switch off the fan again */
> + recently_changed = 1;
> + } else if (mode == THERMAL_DEVICE_ENABLED) {
> + if (verbose)
> + printk(KERN_NOTICE "acerhdf: kernelmode ON\n");
> + thermal->polling_delay = interval*1000;
> + thermal_zone_device_update(thermal);
> + kernelmode = 1;
> + }
> + return 0;
> +}
There's no other thermal device_mode state than ENABLED/DISABLED.
Maybe just if/else?
> +/* print the name of the trip point */
> +static int get_trip_type(struct thermal_zone_device *thermal,
> + int trip, enum thermal_trip_type *type)
> +{
> + if (trip == 0)
> + *type = THERMAL_TRIP_ACTIVE;
> + return 0;
> +}
Comment doesn't match code. I see no printing here.
> +/* print the temperature at which the trip point gets active */
> +static int get_trip_temp(struct thermal_zone_device *thermal,
> + int trip, unsigned long *temp)
> +{
> + if (trip == 0)
> + *temp = fanon;
> + return 0;
> +}
No printing here either.
You could #define pr_fmt(fmt) "acerhd: " fmt
instead of prefixing all the printks with "acerhd:"
next prev parent reply other threads:[~2009-04-26 22:21 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-25 1:45 [PATCH] Acer Aspire One Fan Control Peter Feuerer
2009-04-25 8:42 ` Peter Feuerer
2009-04-26 15:31 ` Matthew Garrett
2009-04-27 18:25 ` Peter Feuerer
2009-04-26 17:29 ` Borislav Petkov
2009-04-27 18:57 ` Peter Feuerer
2009-04-28 7:25 ` Borislav Petkov
2009-04-28 10:04 ` Maxim Levitsky
2009-04-28 20:17 ` Peter Feuerer
2009-04-28 20:31 ` Maxim Levitsky
2009-05-02 21:21 ` Peter Feuerer
2009-05-03 18:46 ` Borislav Petkov
2009-05-06 19:41 ` Peter Feuerer
2009-05-06 22:17 ` Peter Feuerer
2009-05-09 17:14 ` Borislav Petkov
2009-05-11 18:05 ` Peter Feuerer
2009-05-12 6:02 ` Borislav Petkov
2009-05-18 18:04 ` Peter Feuerer
2009-05-18 20:20 ` Joe Perches
2009-05-19 6:47 ` Peter Feuerer
2009-05-19 7:06 ` Joe Perches
2009-05-24 19:22 ` Borislav Petkov
2009-06-01 14:12 ` Peter Feuerer
2009-06-03 7:35 ` Borislav Petkov
2009-06-03 8:10 ` Peter Feuerer
2009-06-03 10:52 ` Borislav Petkov
2009-06-03 11:29 ` Peter Feuerer
2009-06-03 13:07 ` Peter Feuerer
2009-06-03 14:49 ` Borislav Petkov
2009-06-01 14:18 ` Peter Feuerer
2009-06-03 7:39 ` Borislav Petkov
2009-06-03 7:52 ` Peter Feuerer
2009-06-03 8:00 ` Borislav Petkov
2009-05-19 20:30 ` Pavel Machek
2009-05-22 11:50 ` Borislav Petkov
2009-05-22 14:09 ` Pavel Machek
2009-05-22 14:53 ` Borislav Petkov
2009-05-24 11:13 ` Peter Feuerer
2009-05-22 16:10 ` [PATCH] Acer Aspire One Fan Contro Andreas Mohr
2009-05-22 18:24 ` Borislav Petkov
2009-05-22 19:35 ` Andreas Mohr
2009-04-26 22:20 ` Joe Perches [this message]
2009-04-27 19:03 ` [PATCH] Acer Aspire One Fan Control Peter Feuerer
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=1240784454.22585.14.camel@localhost \
--to=joe@perches.com \
--cc=lenb@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mjg59@srcf.ucam.org \
--cc=peter@piie.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.