Skip to contentSkip to conversation

hwmon: (pc87360) Fix multi-line comments

PATCH Superseded Guenter Roeck 4 participants 5 messages Jan 19, 2012 – Jan 23, 2012

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Guenter Roeck

author maintainer
#0 lore raw

PATCH 51/82 hwmon: (pc87360) Fix multi-line comments

---
 drivers/hwmon/pc87360.c |   73 +++++++++++++++++++++++++++++-----------------
 1 files changed, 46 insertions(+), 27 deletions(-)
drivers/hwmon/pc87360.c +46 -27
index 51c97ca..7f95761 100644
@@ -531,9 +531,11 @@ static struct sensor_device_attribute in_max[] = {
 #define CHAN_ALM_MAX	0x04	/* max limit exceeded */
 #define TEMP_ALM_CRIT	0x08	/* temp crit exceeded (temp only) */
 
-/* show_in_min/max_alarm() reads data from the per-channel status
-   register (sec 11.5.12), not the vin event status registers (sec
-   11.5.2) that (legacy) show_in_alarm() resds (via data->in_alarms) */
+/*
+ * show_in_min/max_alarm() reads data from the per-channel status
+ * register (sec 11.5.12), not the vin event status registers (sec
+ * 11.5.2) that (legacy) show_in_alarm() resds (via data->in_alarms)
+ */
 
 static ssize_t show_in_min_alarm(struct device *dev,
 			struct device_attribute *devattr, char *buf)
@@ -748,9 +750,10 @@ static ssize_t set_therm_crit(struct device *dev,
 	return count;
 }
 
-/* the +11 term below reflects the fact that VLM units 11,12,13 are
-   used in the chip to measure voltage across the thermistors
-*/
+/*
+ * the +11 term below reflects the fact that VLM units 11,12,13 are
+ * used in the chip to measure voltage across the thermistors
+ */
 static struct sensor_device_attribute therm_input[] = {
 	SENSOR_ATTR(temp4_input, S_IRUGO, show_therm_input, NULL, 0 + 11),
 	SENSOR_ATTR(temp5_input, S_IRUGO, show_therm_input, NULL, 1 + 11),
@@ -786,8 +789,10 @@ static struct sensor_device_attribute therm_crit[] = {
 		    show_therm_crit, set_therm_crit, 2 + 11),
 };
 
-/* show_therm_min/max_alarm() reads data from the per-channel voltage
-   status register (sec 11.5.12) */
+/*
+ * show_therm_min/max_alarm() reads data from the per-channel voltage
+ * status register (sec 11.5.12)
+ */
 
 static ssize_t show_therm_min_alarm(struct device *dev,
 				struct device_attribute *devattr, char *buf)
@@ -1007,9 +1012,11 @@ static ssize_t show_temp_alarms(struct device *dev,
 
 static DEVICE_ATTR(alarms_temp, S_IRUGO, show_temp_alarms, NULL);
 
-/* show_temp_min/max_alarm() reads data from the per-channel status
-   register (sec 12.3.7), not the temp event status registers (sec
-   12.3.2) that show_temp_alarm() reads (via data->temp_alarms) */
+/*
+ * show_temp_min/max_alarm() reads data from the per-channel status
+ * register (sec 12.3.7), not the temp event status registers (sec
+ * 12.3.2) that show_temp_alarm() reads (via data->temp_alarms)
+ */
 
 static ssize_t show_temp_min_alarm(struct device *dev,
 			struct device_attribute *devattr, char *buf)
@@ -1172,9 +1179,11 @@ static int __init pc87360_find(int sioaddr, u8 *devid,
 		} else if (i = 1) { /* Voltages */
 			/* Are we using thermistors? */
 			if (*devid = 0xE9) { /* PC87366 */
-				/* These registers are not logical-device
-				   specific, just that we won't need them if
-				   we don't use the VLM device */
+				/*
+				 * These registers are not logical-device
+				 * specific, just that we won't need them if
+				 * we don't use the VLM device
+				 */
 				confreg[2] = superio_inb(sioaddr, 0x2B);
 				confreg[3] = superio_inb(sioaddr, 0x25);
 
@@ -1258,9 +1267,11 @@ static int __devinit pc87360_probe(struct platform_device *pdev)
 	if (data->fannr)
 		data->fan_conf = confreg[0] | (confreg[1] << 8);
 
-	/* Use the correct reference voltage
-	   Unless both the VLM and the TMS logical devices agree to
-	   use an external Vref, the internal one is used. */
+	/*
+	 * Use the correct reference voltage
+	 * Unless both the VLM and the TMS logical devices agree to
+	 * use an external Vref, the internal one is used.
+	 */
 	if (data->innr) {
 		i = pc87360_read_value(data, LD_IN, NO_BANK,
 				       PC87365_REG_IN_CONFIG);
@@ -1402,8 +1413,10 @@ static int __devexit pc87360_remove(struct platform_device *pdev)
 	return 0;
 }
 
-/* ldi is the logical device index
-   bank is for voltages and temperatures only */
+/*
+ * ldi is the logical device index
+ * bank is for voltages and temperatures only
+ */
 static int pc87360_read_value(struct pc87360_data *data, u8 ldi, u8 bank,
 			      u8 reg)
 {
@@ -1474,8 +1487,10 @@ static void pc87360_init_device(struct platform_device *pdev,
 		}
 	}
 
-	/* We can't blindly trust the Super-I/O space configuration bit,
-	   most BIOS won't set it properly */
+	/*
+	 * We can't blindly trust the Super-I/O space configuration bit,
+	 * most BIOS won't set it properly
+	 */
 	dev_dbg(&pdev->dev, "bios thermistors:%d\n", use_thermistors);
 	for (i = 11; i < data->innr; i++) {
 		reg = pc87360_read_value(data, LD_IN, i,
@@ -1506,8 +1521,10 @@ static void pc87360_init_device(struct platform_device *pdev,
 	if (use_thermistors) {
 		for (i = 11; i < data->innr; i++) {
 			if (init >= init_in[i]) {
-				/* The pin may already be used by thermal
-				   diodes */
+				/*
+				 * The pin may already be used by thermal
+				 * diodes
+				 */
 				reg = pc87360_read_value(data, LD_TEMP,
 				      (i - 11) / 2, PC87365_REG_TEMP_STATUS);
 				if (reg & CHAN_ENA) {
@@ -1560,10 +1577,12 @@ static void pc87360_init_device(struct platform_device *pdev,
 		if (init >= 2) {
 			/* Chip config as documented by National Semi. */
 			pc87360_write_value(data, LD_TEMP, 0xF, 0xA, 0x08);
-			/* We voluntarily omit the bank here, in case the
-			   sequence itself matters. It shouldn't be a problem,
-			   since nobody else is supposed to access the
-			   device at that point. */
+			/*
+			 * We voluntarily omit the bank here, in case the
+			 * sequence itself matters. It shouldn't be a problem,
+			 * since nobody else is supposed to access the
+			 * device at that point.
+			 */
 			pc87360_write_value(data, LD_TEMP, NO_BANK, 0xB, 0x04);
 			pc87360_write_value(data, LD_TEMP, NO_BANK, 0xC, 0x35);
 			pc87360_write_value(data, LD_TEMP, NO_BANK, 0xD, 0x05);
Signature · 7 lines
1.7.5.4


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
maintainer
#1 lore raw

are these checkpatch warnings ?

Quoted 154 lines · Guenter Roeck

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

 1 files changed, 46 insertions(+), 27 deletions(-)
drivers/hwmon/pc87360.c +18 -11
index 51c97ca..7f95761 100644
@@ -531,9 +531,11 @@ static struct sensor_device_attribute in_max[] = {
  #define CHAN_ALM_MAX   0x04    /* max limit exceeded */
  #define TEMP_ALM_CRIT  0x08    /* temp crit exceeded (temp only) */
 
-/* show_in_min/max_alarm() reads data from the per-channel status
-   register (sec 11.5.12), not the vin event status registers (sec
-   11.5.2) that (legacy) show_in_alarm() resds (via data->in_alarms) */
+/*
+ * show_in_min/max_alarm() reads data from the per-channel status
+ * register (sec 11.5.12), not the vin event status registers (sec
+ * 11.5.2) that (legacy) show_in_alarm() resds (via data->in_alarms)
+ */
 
  static ssize_t show_in_min_alarm(struct device *dev,
                        struct device_attribute *devattr, char *buf)
@@ -748,9 +750,10 @@ static ssize_t set_therm_crit(struct device *dev,
        return count;
  }
 
-/* the +11 term below reflects the fact that VLM units 11,12,13 are
-   used in the chip to measure voltage across the thermistors
-*/
+/*
+ * the +11 term below reflects the fact that VLM units 11,12,13 are
+ * used in the chip to measure voltage across the thermistors
+ */
  static struct sensor_device_attribute therm_input[] = {
        SENSOR_ATTR(temp4_input, S_IRUGO, show_therm_input, NULL, 0 + 11),
        SENSOR_ATTR(temp5_input, S_IRUGO, show_therm_input, NULL, 1 + 11),
@@ -786,8 +789,10 @@ static struct sensor_device_attribute therm_crit[] = {
                    show_therm_crit, set_therm_crit, 2 + 11),
  };
 
-/* show_therm_min/max_alarm() reads data from the per-channel voltage
-   status register (sec 11.5.12) */
+/*
+ * show_therm_min/max_alarm() reads data from the per-channel voltage
+ * status register (sec 11.5.12)
+ */
 
  static ssize_t show_therm_min_alarm(struct device *dev,
                                struct device_attribute *devattr, char *buf)
@@ -1007,9 +1012,11 @@ static ssize_t show_temp_alarms(struct device *dev,
 
  static DEVICE_ATTR(alarms_temp, S_IRUGO, show_temp_alarms, NULL);
 
-/* show_temp_min/max_alarm() reads data from the per-channel status
-   register (sec 12.3.7), not the temp event status registers (sec
-   12.3.2) that show_temp_alarm() reads (via data->temp_alarms) */
+/*
+ * show_temp_min/max_alarm() reads data from the per-channel status
+ * register (sec 12.3.7), not the temp event status registers (sec
+ * 12.3.2) that show_temp_alarm() reads (via data->temp_alarms)
+ */
 
  static ssize_t show_temp_min_alarm(struct device *dev,
                        struct device_attribute *devattr, char *buf)
@@ -1172,9 +1179,11 @@ static int __init pc87360_find(int sioaddr, u8 *devid,
                } else if (i == 1) { /* Voltages */
                        /* Are we using thermistors? */

                       if (*devid == 0xE9) { /* PC87366 */
-                               /* These registers are not logical-device
-                                  specific, just that we won't need them if
-                                  we don't use the VLM device */
+                               /*
+                                * These registers are not logical-device
+                                * specific, just that we won't need them if
+                                * we don't use the VLM device
+                                */
                               confreg[2] = superio_inb(sioaddr, 0x2B); confreg[3] = superio_inb(sioaddr, 0x25);

drivers/hwmon/pc87360.c +23 -14
@@ -1258,9 +1267,11 @@ static int __devinit pc87360_probe(struct platform_device *pdev)
        if (data->fannr)
                data->fan_conf = confreg[0] | (confreg[1] << 8);
 
-       /* Use the correct reference voltage
-          Unless both the VLM and the TMS logical devices agree to
-          use an external Vref, the internal one is used. */
+       /*
+        * Use the correct reference voltage
+        * Unless both the VLM and the TMS logical devices agree to
+        * use an external Vref, the internal one is used.
+        */
        if (data->innr) {
                i = pc87360_read_value(data, LD_IN, NO_BANK,
                                       PC87365_REG_IN_CONFIG);
@@ -1402,8 +1413,10 @@ static int __devexit pc87360_remove(struct platform_device *pdev)
        return 0;
  }
 
-/* ldi is the logical device index
-   bank is for voltages and temperatures only */
+/*
+ * ldi is the logical device index
+ * bank is for voltages and temperatures only
+ */
  static int pc87360_read_value(struct pc87360_data *data, u8 ldi, u8 bank,
                              u8 reg)
  {
@@ -1474,8 +1487,10 @@ static void pc87360_init_device(struct platform_device *pdev,
                }
        }
 
-       /* We can't blindly trust the Super-I/O space configuration bit,
-          most BIOS won't set it properly */
+       /*
+        * We can't blindly trust the Super-I/O space configuration bit,
+        * most BIOS won't set it properly
+        */
        dev_dbg(&pdev->dev, "bios thermistors:%d\n", use_thermistors);
        for (i = 11; i < data->innr; i++) {
                reg = pc87360_read_value(data, LD_IN, i,
@@ -1506,8 +1521,10 @@ static void pc87360_init_device(struct platform_device *pdev,
        if (use_thermistors) {
                for (i = 11; i < data->innr; i++) {
                        if (init >= init_in[i]) {
-                               /* The pin may already be used by thermal
-                                  diodes */
+                               /*
+                                * The pin may already be used by thermal
+                                * diodes
+                                */
                                reg = pc87360_read_value(data, LD_TEMP,
                                      (i - 11) / 2, PC87365_REG_TEMP_STATUS);
                                if (reg & CHAN_ENA) {
@@ -1560,10 +1577,12 @@ static void pc87360_init_device(struct platform_device *pdev,
                if (init >= 2) {
                        /* Chip config as documented by National Semi. */
                        pc87360_write_value(data, LD_TEMP, 0xF, 0xA, 0x08);
-                       /* We voluntarily omit the bank here, in case the
-                          sequence itself matters. It shouldn't be a problem,
-                          since nobody else is supposed to access the
-                          device at that point. */
+                       /*
+                        * We voluntarily omit the bank here, in case the
+                        * sequence itself matters. It shouldn't be a problem,
+                        * since nobody else is supposed to access the
+                        * device at that point.
+                        */
                        pc87360_write_value(data, LD_TEMP, NO_BANK, 0xB, 0x04);
                        pc87360_write_value(data, LD_TEMP, NO_BANK, 0xC, 0x35);
                        pc87360_write_value(data, LD_TEMP, NO_BANK, 0xD, 0x05);
--
Quoted 2 lines

1.7.5.4

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

#2 lore raw
In reply to Guenter Roeck
Quoted 1 line · Jim Cromie

are these checkpatch warnings ?

Not directly, but non-standard comment style can cause false positives in checkpatch.

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#3 lore raw
In reply to Guenter Roeck
Quoted 6 lines · Jean Delvare
Quoted 1 line · Jim Cromie

are these checkpatch warnings ?

Not directly, but non-standard comment style can cause false positives in checkpatch.

Exactly. Also, it was straightforward to write a little program to do it automatically, so it was not much effort.

Any comments on http://thread.gmane.org/gmane.linux.drivers.sensors/28266/focus(286 ?

Thanks,
Guenter

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

maintainer Acked-by on v1 51/82
#4 lore raw
In reply to Guenter Roeck
Quoted 11 lines · Guenter Roeck
Quoted 6 lines · Jean Delvare
Quoted 1 line · Jim Cromie

are these checkpatch warnings ?

Not directly, but non-standard comment style can cause false positives in checkpatch.

Exactly. Also, it was straightforward to write a little program to do it automatically, so it was not much effort.

Any comments on http://thread.gmane.org/gmane.linux.drivers.sensors/28266/focus(286 ?

Ive just built and modprobed it on voyage linux ( a debian derivative ) Given that this patch is just cleanup, thats good for an

Im a little puzzled though - I have no sensors or sensors-detect on voyage, and its apparently not available via dselect / aptitude.

So I pulled lm-sensors-3.3.1 and built it on laptop, copied it over to the soekris.
sensors-detect wont work, I cant install the dependencies - not enough memory there to do apt-get install.

sensors works though, and seems to have all the info.

pc87366-isa-6620

Adapter: ISA adapter
in0:          +3.01 V  (min =  +0.00 V, max =  +3.01 V)
in1:          +2.00 V  (min =  +0.00 V, max =  +3.01 V)
in2:          +2.49 V  (min =  +0.00 V, max =  +3.01 V)
in3:          +0.60 V  (min =  +0.00 V, max =  +3.01 V)
in4:          +2.46 V  (min =  +0.00 V, max =  +3.01 V)
in5:          +2.49 V  (min =  +0.00 V, max =  +3.01 V)
in6:          +0.00 V  (min =  +0.00 V, max =  +3.01 V)
3VSB:         +3.31 V  (min =  +0.00 V, max =  +6.03 V)
VDD:          +3.05 V  (min =  +0.00 V, max =  +6.03 V)
Vbat:         +0.00 V  (min =  +0.00 V, max =  +0.00 V)
AVDD:         +3.28 V  (min =  +0.00 V, max =  +6.03 V)
temp1:          FAULT  (low  = -55.0 C, high = +127.0 C)  ALARM (HIGH, CRIT)
                       (crit = +127.0 C)
temp2:          FAULT  (low  = -55.0 C, high = +127.0 C)  ALARM (HIGH, CRIT)
                       (crit = +127.0 C)
SIO Temp:     +91.0 C  (low  = -55.0 C, high = +127.0 C)
                       (crit = +127.0 C)
temp4:         +0.0 C  (low  =  +0.0 C, high =  +0.0 C)
                       (crit =  +0.0 C)
temp5:         +0.0 C  (low  =  +0.0 C, high =  +0.0 C)
                       (crit =  +0.0 C)
temp6:         +0.0 C  (low  =  +0.0 C, high =  +0.0 C)
                       (crit =  +0.0 C)

cpu0_vid: +0.000 V

I'll have to go digging for a customized sensors3.conf to know better.

FTR, and so Ive written it down, to check (compare against) your last cleanup patch:

root@voyage:/sys/class/hwmon/hwmon0/device# ls | wc
    128     128    1472
root@voyage:/sys/class/hwmon/hwmon0/device# ls temp* | wc
     51      51     666
root@voyage:/sys/class/hwmon/hwmon0/device# ls temp1* |wc
      9       9     117
root@voyage:/sys/class/hwmon/hwmon0/device# ls temp6* |wc
      8       8     105
root@voyage:/sys/class/hwmon/hwmon0/device# ls in* | wc
     66      66     721
root@voyage:/sys/class/hwmon/hwmon0/device# ls in1* | wc
     12      12     136
root@voyage:/sys/class/hwmon/hwmon0/device# ls in10* | wc
      6       6      71

I'll build all 3 patches together, and report back soon.

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