Re: [lm-sensors] [PATCH 2/8] hwmon: applesmc: Introduce a register lookup table

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Guenter Roeck
Date: Wednesday, November 3, 2010 - 9:21 pm

Hi Henrik,

On Sun, Oct 31, 2010 at 03:50:28AM -0400, Henrik Rydberg wrote:

unnecessary blank line


One thing I don't understand about the whole caching scheme - why don't you just
return (and use) a pointer to the cached entry ? Seems to me that would be much simpler.
If you want to return error types, you could use ERR_PTR, PTR_ERR, and IS_ERR.


This one is a bit odd. cache->len is an u8. You are reading 6 bytes into it.
I assume this is supposed to fill both cache->len and cache->type in a single operation.

Not sure if this is a good idea. Seems to depend a lot on the assumption that
fields are consecutive. Might be safer to read the data into a temporary
6 byte buffer and copy it into ->len and ->type afterwards.

If that is not acceptable, please add a comment describing what you are doing here
and why.


Why read 6 bytes above if you overwrite the last byte anyway ?


Do you also have to reset init_complete ?

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/8] hwmon: applesmc: Dynamic configuration rewrite, Henrik Rydberg, (Sun Oct 31, 12:50 am)
[PATCH 4/8] hwmon: applesmc: Handle new temperature format, Henrik Rydberg, (Sun Oct 31, 12:50 am)
[PATCH 6/8] hwmon: applesmc: Dynamic creation of fan files, Henrik Rydberg, (Sun Oct 31, 12:50 am)
[PATCH 7/8] hwmon: applesmc: Simplify feature sysfs handling, Henrik Rydberg, (Sun Oct 31, 12:50 am)
[PATCH 8/8] hwmon: applesmc: Update copyright information, Henrik Rydberg, (Sun Oct 31, 12:50 am)
Re: [lm-sensors] [PATCH 2/8] hwmon: applesmc: Introduce a ..., Guenter Roeck, (Wed Nov 3, 9:21 pm)