mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jean Delvare" <khali@linux-fr.org>
To: greg@kroah.com
Cc: "Yani Ioannou" <yani.ioannou@gmail.com>,
	"LKML" <linux-kernel@vger.kernel.org>,
	"LM Sensors" <lm-sensors@lm-sensors.org>
Subject: Re: [lm-sensors] [PATCH 2.6.12-rc4 15/15] drivers/i2c/chips/adm1026.c: use dynamic sysfs callbacks
Date: Fri, 20 May 2005 09:46:29 +0200 (CEST)	[thread overview]
Message-ID: <v0eBIb5C.1116575188.8501740.khali@localhost> (raw)
In-Reply-To: <20050519213551.GA806@kroah.com>


Hi Greg,

> Hm, which makes me want to go look at trying to convert those attributes
> to an array right now...

I should probably develop my own thoughts and plans at this point then.

If you consider all the attributes of a given hardware monitoring driver,
you'll notice that, from a functional point of view, they can be
represented as two-dimension arrays rather than one-dimension ones. For
example, the temperature-related files of the it87 driver could be
represented this way:

+-------------+-------------+-------------+-------------+
| temp1_input | temp1_min   | temp1_max   | temp1_type  |
+-------------+-------------+-------------+-------------+
| temp2_input | temp2_min   | temp2_max   | temp2_type  |
+-------------+-------------+-------------+-------------+
| temp3_input | temp3_min   | temp3_max   | temp3_type  |
+-------------+-------------+-------------+-------------+

In the patch I just proposed, I made the choice to consider the colums of
the array above to create arrays of attributes, each column becoming a
different array. While it may sound like a sane choice, espcially when
there are many similar channels (e.g. voltages), it might not be the
best choice in the long run, for the following reason.

All measurement channels of the IT8705F and IT8712F can be individually
disabled. While this feature was almost not used so far, I think we
should have the driver not create interface files for disabled inputs.
In the case of temperature channels which can be dynamically enabled and
disabled. it would even make sense to dynamically create and delete
related sysfs files. Doing so would allow for memory savings and would
also be less error-prone for the user (presenting an interface for
disabled features is quite confusing IMHO).

For this reason, considering the lines of the array above, rather than
its columns, in order to define arrays of attributes, may be more subtle
and flexible in the long run.

Thanks
--
Jean Delvare

  reply	other threads:[~2005-05-20  7:54 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-17 10:47 Yani Ioannou
2005-05-17 11:04 ` [lm-sensors] " Jean Delvare
2005-05-17 11:18   ` Yani Ioannou
2005-05-17 20:23     ` Grant Coady
2005-05-17 20:56       ` Yani Ioannou
2005-05-17 23:13         ` Grant Coady
2005-05-17 23:21           ` Yani Ioannou
2005-05-18  1:58             ` Grant Coady
     [not found]     ` <253818670505172136613abb43@mail.gmail.com>
2005-05-19 20:02       ` Jean Delvare
2005-05-19 20:52         ` Greg KH
2005-05-19 20:57           ` Jean Delvare
2005-05-19 21:35             ` Greg KH
2005-05-20  7:46               ` Jean Delvare [this message]
2005-05-20  8:53                 ` Yani Ioannou
2005-05-22  1:58                   ` Dmitry Torokhov
2005-05-22  6:50                     ` Jean Delvare
2005-05-22  7:04                       ` Dmitry Torokhov
2005-05-22 12:15                         ` Yani Ioannou
2005-05-22 12:32                           ` Jean Delvare
2005-05-22 13:05                             ` Yani Ioannou
2005-05-22 13:39                               ` Jean Delvare
2005-05-19 21:14         ` Yani Ioannou
2005-06-05  8:51 ` Jean Delvare
2005-06-06  6:14   ` Greg KH

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=v0eBIb5C.1116575188.8501740.khali@localhost \
    --to=khali@linux-fr.org \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lm-sensors@lm-sensors.org \
    --cc=yani.ioannou@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

Powered by JetHome