From: Andreas Mohr <andi@lisas.de>
To: Peter Feuerer <peter@piie.net>
Cc: Andreas Mohr <andi@lisas.de>,
Borislav Petkov <petkovbb@gmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: [Patch] acerhdf: Return temperature in milidegree
Date: Tue, 20 Oct 2009 07:25:47 +0200 [thread overview]
Message-ID: <20091020052547.GA10289@rhlx01.hs-esslingen.de> (raw)
In-Reply-To: <cone.1255987487.209127.3188.1000@deskpiie>
Hi,
On Mon, Oct 19, 2009 at 11:24:47PM +0200, Peter Feuerer wrote:
> I agree with you in these points, but I have also some disadvantages to discuss:
>
> Disadvantages:
> - Thinking about the implemenation such a macro would require, users may
> get confused. They would still set the fanon / fanoff trip points in
> degree, but when they read documentation or the current temperature,
> millidegree is used. - I think "TEMP_DEGREE_TO_SYS(59)" in code is not
> as good readable as "59000"
>
> what about writing something like "59 * 1000" insead of "59000"?
>
> Or something like that:
>
> #define FACTOR_MILLIDEGREE 1000
> 59 * FACTOR_MILLIDEGREE
>
> this solution has all your listed advantages and eliminates the
> disadvantages I see in the "TEMP_DEGREE_TO_SYS" solution.
Well, yes, much better, in fact TEMP_DEGREE_TO_SYS is simple overengineering
(using a generic, _cryptic_ name in order to keep using it in the somewhat unlikely
case of having the factor change when you could just as well have mass-renamed
the couple places that use the macro name)
Andreas
next prev parent reply other threads:[~2009-10-20 5:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-19 8:21 Peter Feuerer
2009-10-19 9:16 ` Andreas Mohr
2009-10-19 21:24 ` Peter Feuerer
2009-10-20 5:25 ` Andreas Mohr [this message]
2009-10-19 18:51 ` Borislav Petkov
2009-10-19 21:11 ` Peter Feuerer
2009-10-20 7:27 ` Borislav Petkov
2009-11-02 11:02 ` Peter Feuerer
2009-11-02 12:49 ` Borislav Petkov
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=20091020052547.GA10289@rhlx01.hs-esslingen.de \
--to=andi@lisas.de \
--cc=linux-kernel@vger.kernel.org \
--cc=peter@piie.net \
--cc=petkovbb@gmail.com \
/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
all inboxes | Powered by JetHome®