From: khali@linux-fr.org (Jean Delvare)
To: lm-sensors@vger.kernel.org
Subject: lm77 on national sc1100
Date: Thu, 19 May 2005 06:25:05 +0000 [thread overview]
Message-ID: <20040707142145.2e723267.khali@linux-fr.org> (raw)
In-Reply-To: <1088690691.2862.25.camel@null>
> Sorry for the late answer, I didn't receive your mail, just found
> it in the mailing list archive.
I was wondering. I got an error on my mail stating:
"<drewie@freemail.hu>: conversation with fmx.freemail.hu[195.228.242.194] timed
out while sending end of data -- message may be sent more than once"
And I thought "in the worse case he'll get it twice". Looks like I was
wrong...
> Attached is a patch against 2.6.7-mm6, reworked to comply with your
> comments. I chose to store the temperatures as `int' and not `s16'
> because I store the converted values and eg. 80000 would hardly
> fit in s16.
Ah OK. We usually store "raw" register values and convert them right
before "exporting" them. But I admit your way is more efficient. Still
your comment "Register values" is now misleading, you should consider
changing it.
> I guess it's time to admit that I've never written anything longer
> than 10 lines in C before, so this is why it's going so slow. Thanks
> for your time and patience :-)
No problem. You couldn't possibly know the kernel folks (strange)
choices for coding style, nor the common patterns in our chip drivers.
Patience is the way only way i know to learn.
A few more comments:
1* Alignment. Kernel folks are being a bit strict when it comes to
alignment. You are not allowed to use spaces to align your defines, nor
your structure members. I know it's a bit restrictive, but that's the
way it goes.
2* Do you have a personal need for exporting the configuration register
to user-space? Other drivers don't. It's assumed that the chip is
configured for proper operation by either the bios or the driver init
process (or in extreme cases module parameter) and should not need to be
changed in runtime. What's more, the format is chip-dependant, and
changing some bits may be extremely sensible (polarity for example).
3* Watch your indentation. In several places you have 8 spaces instead
of a tab (reading the patch is an easy way to catch them). There are
also problem on "goto exit_free" lines.
4* According to out sysfs-interface standard, the alarms file should be
named "alarms", not "alarm".
5* Is it just me or:
+ if (((cur & 0x00f0) != 0xf && (cur & 0x00f0) != 0x0)
+ || ((hyst & 0x00f0) != 0xf && (hyst & 0x00f0) != 0x0)
+ || ((crit & 0x00f0) != 0xf && (crit & 0x00f0) != 0x0)
+ || ((min & 0x00f0) != 0xf && (min & 0x00f0) != 0x0)
+ || ((max & 0x00f0) != 0xf && (max & 0x00f0) != 0x0))
is broken? I guess you'd need to test != 0xf0, not 0xf.
6* It's a bit weird that you use a wrapper to read from the smbus and
still read the alarm bits directly. I think that your wrapper should
just do its job, ie get the values. The temperature conversions don't
belong there. See how it is done in the other drivers. I admit that your
code works, but it's not consistent.
7* Don't define an ID for the LM77. It's not needed, you can just omit it.
Sorry to insist on things you might consider are details. They certainly
are, but if I don't have you correct them now, chances are that your
patch will not be accepted by kernel folks. It's also important that all
our drivers are as similar as possible for the ease of maintainance.
Thanks.
--
Jean Delvare
http://khali.linux-fr.org/
next prev parent reply other threads:[~2005-05-19 6:25 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-19 6:25 lm77 on national sc1100 Andras BALI
2005-05-19 6:25 ` Jean Delvare
2005-05-19 6:25 ` Andras BALI
2005-05-19 6:25 ` Andras BALI
2005-05-19 6:25 ` Jean Delvare
2005-05-19 6:25 ` Mark M. Hoffman
2005-05-19 6:25 ` Andras BALI
2005-05-19 6:25 ` Mark M. Hoffman
2005-05-19 6:25 ` Mark M. Hoffman
2005-05-19 6:25 ` Jean Delvare
2005-05-19 6:25 ` Jean Delvare
2005-05-19 6:25 ` Andras BALI
2005-05-19 6:25 ` Andras BALI
2005-05-19 6:25 ` Jean Delvare
2005-05-19 6:25 ` Mark M. Hoffman
2005-05-19 6:25 ` Andras BALI
2005-05-19 6:25 ` Jean Delvare
2005-05-19 6:25 ` Jean Delvare
2005-05-19 6:25 ` Andras BALI
2005-05-19 6:25 ` Jean Delvare
2005-05-19 6:25 ` Andras BALI
2005-05-19 6:25 ` Jean Delvare
2005-05-19 6:25 ` Andras BALI
2005-05-19 6:25 ` Jean Delvare
2005-05-19 6:25 ` Jean Delvare
2005-05-19 6:25 ` Andras BALI
2005-05-19 6:25 ` Jean Delvare
2005-05-19 6:25 ` Jean Delvare
2005-05-19 6:25 ` Jean Delvare [this message]
2005-05-19 6:25 ` Andras BALI
2005-05-19 6:25 ` Andras BALI
2005-05-19 6:25 ` Andras BALI
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=20040707142145.2e723267.khali@linux-fr.org \
--to=khali@linux-fr.org \
--cc=lm-sensors@vger.kernel.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 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.