* [lm-sensors] [PATCH 1/3] hwmon: (f71882fg) Secure chip property
@ 2011-03-23 20:47 Jean Delvare
2011-03-24 3:30 ` Guenter Roeck
2011-03-24 8:13 ` Hans de Goede
0 siblings, 2 replies; 3+ messages in thread
From: Jean Delvare @ 2011-03-23 20:47 UTC (permalink / raw)
To: lm-sensors
Using C99-style array initialization will ensure definitions won't
drift if the chips enum gets new values added.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Hans de Goede <hdegoede@redhat.com>
---
drivers/hwmon/f71882fg.c | 48 +++++++++++++++++++++++-----------------------
1 file changed, 24 insertions(+), 24 deletions(-)
--- linux-2.6.39-rc0.orig/drivers/hwmon/f71882fg.c 2011-03-23 10:34:23.000000000 +0100
+++ linux-2.6.39-rc0/drivers/hwmon/f71882fg.c 2011-03-23 14:53:29.000000000 +0100
@@ -120,36 +120,36 @@ static const char *f71882fg_names[] = {
};
static const char f71882fg_has_in[8][F71882FG_MAX_INS] = {
- { 1, 1, 1, 1, 1, 1, 0, 1, 1 }, /* f71808e */
- { 1, 1, 1, 0, 0, 0, 0, 0, 0 }, /* f71858fg */
- { 1, 1, 1, 1, 1, 1, 1, 1, 1 }, /* f71862fg */
- { 1, 1, 1, 1, 1, 1, 1, 1, 1 }, /* f71869 */
- { 1, 1, 1, 1, 1, 1, 1, 1, 1 }, /* f71882fg */
- { 1, 1, 1, 1, 1, 1, 1, 1, 1 }, /* f71889fg */
- { 1, 1, 1, 1, 1, 1, 1, 1, 1 }, /* f71889ed */
- { 1, 1, 1, 0, 0, 0, 0, 0, 0 }, /* f8000 */
+ [f71808e] = { 1, 1, 1, 1, 1, 1, 0, 1, 1 },
+ [f71858fg] = { 1, 1, 1, 0, 0, 0, 0, 0, 0 },
+ [f71862fg] = { 1, 1, 1, 1, 1, 1, 1, 1, 1 },
+ [f71869] = { 1, 1, 1, 1, 1, 1, 1, 1, 1 },
+ [f71882fg] = { 1, 1, 1, 1, 1, 1, 1, 1, 1 },
+ [f71889fg] = { 1, 1, 1, 1, 1, 1, 1, 1, 1 },
+ [f71889ed] = { 1, 1, 1, 1, 1, 1, 1, 1, 1 },
+ [f8000] = { 1, 1, 1, 0, 0, 0, 0, 0, 0 },
};
static const char f71882fg_has_in1_alarm[8] = {
- 0, /* f71808e */
- 0, /* f71858fg */
- 0, /* f71862fg */
- 0, /* f71869 */
- 1, /* f71882fg */
- 1, /* f71889fg */
- 1, /* f71889ed */
- 0, /* f8000 */
+ [f71808e] = 0,
+ [f71858fg] = 0,
+ [f71862fg] = 0,
+ [f71869] = 0,
+ [f71882fg] = 1,
+ [f71889fg] = 1,
+ [f71889ed] = 1,
+ [f8000] = 0,
};
static const char f71882fg_has_beep[8] = {
- 0, /* f71808e */
- 0, /* f71858fg */
- 1, /* f71862fg */
- 1, /* f71869 */
- 1, /* f71882fg */
- 1, /* f71889fg */
- 1, /* f71889ed */
- 0, /* f8000 */
+ [f71808e] = 0,
+ [f71858fg] = 0,
+ [f71862fg] = 1,
+ [f71869] = 1,
+ [f71882fg] = 1,
+ [f71889fg] = 1,
+ [f71889ed] = 1,
+ [f8000] = 0,
};
static struct platform_device *f71882fg_pdev;
--
Jean Delvare
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [lm-sensors] [PATCH 1/3] hwmon: (f71882fg) Secure chip property
2011-03-23 20:47 [lm-sensors] [PATCH 1/3] hwmon: (f71882fg) Secure chip property Jean Delvare
@ 2011-03-24 3:30 ` Guenter Roeck
2011-03-24 8:13 ` Hans de Goede
1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2011-03-24 3:30 UTC (permalink / raw)
To: lm-sensors
On Wed, Mar 23, 2011 at 04:47:02PM -0400, Jean Delvare wrote:
> Using C99-style array initialization will ensure definitions won't
> drift if the chips enum gets new values added.
>
> Signed-off-by: Jean Delvare <khali@linux-fr.org>
> Cc: Hans de Goede <hdegoede@redhat.com>
Excellent idea.
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [lm-sensors] [PATCH 1/3] hwmon: (f71882fg) Secure chip property
2011-03-23 20:47 [lm-sensors] [PATCH 1/3] hwmon: (f71882fg) Secure chip property Jean Delvare
2011-03-24 3:30 ` Guenter Roeck
@ 2011-03-24 8:13 ` Hans de Goede
1 sibling, 0 replies; 3+ messages in thread
From: Hans de Goede @ 2011-03-24 8:13 UTC (permalink / raw)
To: lm-sensors
Hi,
I like.
Acked-by: Hans de Goede <hdegoede@redhat.com>
Regards,
Hans
On 03/23/2011 09:47 PM, Jean Delvare wrote:
> Using C99-style array initialization will ensure definitions won't
> drift if the chips enum gets new values added.
>
> Signed-off-by: Jean Delvare<khali@linux-fr.org>
> Cc: Hans de Goede<hdegoede@redhat.com>
> ---
> drivers/hwmon/f71882fg.c | 48 +++++++++++++++++++++++-----------------------
> 1 file changed, 24 insertions(+), 24 deletions(-)
>
> --- linux-2.6.39-rc0.orig/drivers/hwmon/f71882fg.c 2011-03-23 10:34:23.000000000 +0100
> +++ linux-2.6.39-rc0/drivers/hwmon/f71882fg.c 2011-03-23 14:53:29.000000000 +0100
> @@ -120,36 +120,36 @@ static const char *f71882fg_names[] = {
> };
>
> static const char f71882fg_has_in[8][F71882FG_MAX_INS] = {
> - { 1, 1, 1, 1, 1, 1, 0, 1, 1 }, /* f71808e */
> - { 1, 1, 1, 0, 0, 0, 0, 0, 0 }, /* f71858fg */
> - { 1, 1, 1, 1, 1, 1, 1, 1, 1 }, /* f71862fg */
> - { 1, 1, 1, 1, 1, 1, 1, 1, 1 }, /* f71869 */
> - { 1, 1, 1, 1, 1, 1, 1, 1, 1 }, /* f71882fg */
> - { 1, 1, 1, 1, 1, 1, 1, 1, 1 }, /* f71889fg */
> - { 1, 1, 1, 1, 1, 1, 1, 1, 1 }, /* f71889ed */
> - { 1, 1, 1, 0, 0, 0, 0, 0, 0 }, /* f8000 */
> + [f71808e] = { 1, 1, 1, 1, 1, 1, 0, 1, 1 },
> + [f71858fg] = { 1, 1, 1, 0, 0, 0, 0, 0, 0 },
> + [f71862fg] = { 1, 1, 1, 1, 1, 1, 1, 1, 1 },
> + [f71869] = { 1, 1, 1, 1, 1, 1, 1, 1, 1 },
> + [f71882fg] = { 1, 1, 1, 1, 1, 1, 1, 1, 1 },
> + [f71889fg] = { 1, 1, 1, 1, 1, 1, 1, 1, 1 },
> + [f71889ed] = { 1, 1, 1, 1, 1, 1, 1, 1, 1 },
> + [f8000] = { 1, 1, 1, 0, 0, 0, 0, 0, 0 },
> };
>
> static const char f71882fg_has_in1_alarm[8] = {
> - 0, /* f71808e */
> - 0, /* f71858fg */
> - 0, /* f71862fg */
> - 0, /* f71869 */
> - 1, /* f71882fg */
> - 1, /* f71889fg */
> - 1, /* f71889ed */
> - 0, /* f8000 */
> + [f71808e] = 0,
> + [f71858fg] = 0,
> + [f71862fg] = 0,
> + [f71869] = 0,
> + [f71882fg] = 1,
> + [f71889fg] = 1,
> + [f71889ed] = 1,
> + [f8000] = 0,
> };
>
> static const char f71882fg_has_beep[8] = {
> - 0, /* f71808e */
> - 0, /* f71858fg */
> - 1, /* f71862fg */
> - 1, /* f71869 */
> - 1, /* f71882fg */
> - 1, /* f71889fg */
> - 1, /* f71889ed */
> - 0, /* f8000 */
> + [f71808e] = 0,
> + [f71858fg] = 0,
> + [f71862fg] = 1,
> + [f71869] = 1,
> + [f71882fg] = 1,
> + [f71889fg] = 1,
> + [f71889ed] = 1,
> + [f8000] = 0,
> };
>
> static struct platform_device *f71882fg_pdev;
>
>
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-03-24 8:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-23 20:47 [lm-sensors] [PATCH 1/3] hwmon: (f71882fg) Secure chip property Jean Delvare
2011-03-24 3:30 ` Guenter Roeck
2011-03-24 8:13 ` Hans de Goede
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.