Skip to contentSkip to conversation

hwmon/pc87360 separate sysfs

PATCH In review Jim Cromie 2 participants 3 messages Sep 10, 2008 – Sep 11, 2008

Subsystems (2)
lore
Share & tools
lore

Jim Cromie

author maintainer
#0 lore raw

PATCH 4/6 hwmon/pc87360 separate sysfs

inlined and attached

From e1750cd32128cc7a17dfc15f3920f3d184b8bbff Mon Sep 17 00:00:00 2001
From: Jim Cromie <[email protected]>
Date: Sat, 28 Jun 2008 13:40:50 -0600
Subject: [PATCH] hwmon/pc87360 separate alarm files - define LDNI_MAX const

Driver handles 3 logical devices in fixed length array. Give this a define-d constant.

---
drivers/hwmon/pc87360.c | 5 +++--

1 files changed, 3 insertions(+), 2 deletions(-)
drivers/hwmon/pc87360.c +0 -0
index 6ffea41..ebb235b 100644
@@ -75,7 +75,8 @@ MODULE_PARM_DESC(force_id, "Override the detected device ID");

#define FSCM 0x09 /* Logical device: fans */

#define VLM    0x0d    /* Logical device: voltages */
#define TMS    0x0e    /* Logical device: temperatures */

-static const u8 logdev[3] = { FSCM, VLM, TMS }; +#define LDNI_MAX 3
+static const u8 logdev[LDNI_MAX] = { FSCM, VLM, TMS };

#define LD_FAN 0
#define LD_IN 1
@@ -1074,7 +1075,7 @@ static int __devinit pc87360_probe(struct platform_device *pdev)

    mutex_init(&data->update_lock);
    platform_set_drvdata(pdev, data);

- for (i = 0; i < 3; i++) {

+    for (i = 0; i < LDNI_MAX; i++) {
        if (((data->address[i] = extra_isa[i]))
         && !request_region(extra_isa[i], PC87360_EXTENT,
                     pc87360_driver.driver.name)) {
Signature · 1 line
1.5.5.1

From e1750cd32128cc7a17dfc15f3920f3d184b8bbff Mon Sep 17 00:00:00 2001
From: Jim Cromie <[email protected]>
Date: Sat, 28 Jun 2008 13:40:50 -0600
Subject: [PATCH] hwmon/pc87360 separate alarm files - define LDNI_MAX const

Driver handles 3 logical devices in fixed length array. Give this a define-d constant.

---
 drivers/hwmon/pc87360.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/hwmon/pc87360.c +3 -2
index 6ffea41..ebb235b 100644
@@ -75,7 +75,8 @@ MODULE_PARM_DESC(force_id, "Override the detected device ID");
 #define FSCM	0x09	/* Logical device: fans */
 #define VLM	0x0d	/* Logical device: voltages */
 #define TMS	0x0e	/* Logical device: temperatures */
-static const u8 logdev[3] = { FSCM, VLM, TMS };
+#define LDNI_MAX 3
+static const u8 logdev[LDNI_MAX] = { FSCM, VLM, TMS };
 
 #define LD_FAN		0
 #define LD_IN		1
@@ -1074,7 +1075,7 @@ static int __devinit pc87360_probe(struct platform_device *pdev)
 	mutex_init(&data->update_lock);
 	platform_set_drvdata(pdev, data);
 
-	for (i = 0; i < 3; i++) {
+	for (i = 0; i < LDNI_MAX; i++) {
 		if (((data->address[i] = extra_isa[i]))
 		 && !request_region(extra_isa[i], PC87360_EXTENT,
 		 		    pc87360_driver.driver.name)) {
Signature · 1 line
1.5.5.1

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#1 lore raw

Re: [lm-sensors] [patch 2.6.27-rc6 4/6 ] hwmon/pc87360 separate

Quoted 32 lines · On Wed, 10 Sep 2008 03:37:44 -0600 Jim Cromie <[email protected]> wrote:

Driver handles 3 logical devices in fixed length array. Give this a define-d constant.

---
 drivers/hwmon/pc87360.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/hwmon/pc87360.c +2 -1
index 6ffea41..ebb235b 100644
@@ -75,7 +75,8 @@ MODULE_PARM_DESC(force_id, "Override the detected 
 device ID");
 #define FSCM    0x09    /* Logical device: fans */
 #define VLM    0x0d    /* Logical device: voltages */
 #define TMS    0x0e    /* Logical device: temperatures */
-static const u8 logdev[3] = { FSCM, VLM, TMS };
+#define LDNI_MAX 3
+static const u8 logdev[LDNI_MAX] = { FSCM, VLM, TMS };
 
 #define LD_FAN        0

#define LD_IN 1

drivers/hwmon/pc87360.c +1 -1
@@ -1074,7 +1075,7 @@ static int __devinit pc87360_probe(struct 
 platform_device *pdev)
     mutex_init(&data->update_lock);
     platform_set_drvdata(pdev, data);
 
-    for (i = 0; i < 3; i++) {
+    for (i = 0; i < LDNI_MAX; i++) {
         if (((data->address[i] = extra_isa[i]))
          && !request_region(extra_isa[i], PC87360_EXTENT,
Quoted 1 line
                      pc87360_driver.driver.name)) {

Is this better than doing

static const u8 logdev[3] = { FSCM, VLM, TMS };

	for (i = 0; i < ARRAY_SIZE(logdev); i++) {

?

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

author maintainer
#2 lore raw

Re: [lm-sensors] [patch 2.6.27-rc6 4/6 ] hwmon/pc87360 separate

In reply to Jim Cromie
Quoted 41 lines · Andrew Morton
Quoted 32 lines · On Wed, 10 Sep 2008 03:37:44 -0600 Jim Cromie <[email protected]> wrote:

Driver handles 3 logical devices in fixed length array. Give this a define-d constant.

---
 drivers/hwmon/pc87360.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/hwmon/pc87360.c +2 -1
index 6ffea41..ebb235b 100644
@@ -75,7 +75,8 @@ MODULE_PARM_DESC(force_id, "Override the detected 
 device ID");
 #define FSCM    0x09    /* Logical device: fans */
 #define VLM    0x0d    /* Logical device: voltages */
 #define TMS    0x0e    /* Logical device: temperatures */
-static const u8 logdev[3] = { FSCM, VLM, TMS };
+#define LDNI_MAX 3
+static const u8 logdev[LDNI_MAX] = { FSCM, VLM, TMS };
 
 #define LD_FAN        0

#define LD_IN 1

drivers/hwmon/pc87360.c +1 -1
@@ -1074,7 +1075,7 @@ static int __devinit pc87360_probe(struct 
 platform_device *pdev)
     mutex_init(&data->update_lock);
     platform_set_drvdata(pdev, data);
 
-    for (i = 0; i < 3; i++) {
+    for (i = 0; i < LDNI_MAX; i++) {
         if (((data->address[i] = extra_isa[i]))
          && !request_region(extra_isa[i], PC87360_EXTENT,
Quoted 2 lines
                      pc87360_driver.driver.name)) {

Is this better than doing

Quoted 8 lines

static const u8 logdev[3] = { FSCM, VLM, TMS };

	for (i = 0; i < ARRAY_SIZE(logdev); i++) {

?

No, not really.
Ive reworked the patch your way, minus the unnecessary '3'

And rebased the patchset.
Im pleased (but not really surprised) that re-rebasing on same -r6 commit worked.

sending new patchset shortly.

thanks

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors