From: Jean Delvare Date: Sun, 7 Oct 2007 20:44:33 +0000 (+0200) Subject: hwmon: Fix the code examples in documentation X-Git-Tag: v2.6.24-rc1~1299^2~15 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5fbea518dab712af63076aed897fce89cd7faec3;p=linux-2.6 hwmon: Fix the code examples in documentation Fix a bug in the code examples, make them comply with CodingStyle, and indent them for a better redability. Signed-off-by: Jean Delvare Acked-by: Hans de Goede Signed-off-by: Mark M. Hoffman --- diff --git a/Documentation/hwmon/sysfs-interface b/Documentation/hwmon/sysfs-interface index a2153c4616..a17b692d26 100644 --- a/Documentation/hwmon/sysfs-interface +++ b/Documentation/hwmon/sysfs-interface @@ -450,22 +450,20 @@ continuous like for example a tempX_type, then when an invalid value is written, -EINVAL should be returned. Example1, temp1_max, register is a signed 8 bit value (-128 - 127 degrees): ---- begin code --- -long v = simple_strtol(buf, NULL, 10) / 1000; -SENSORS_LIMIT(v, -128, 127); -/* write v to register */ ---- end code --- + + long v = simple_strtol(buf, NULL, 10) / 1000; + v = SENSORS_LIMIT(v, -128, 127); + /* write v to register */ Example2, fan divider setting, valid values 2, 4 and 8: ---- begin code --- -unsigned long v = simple_strtoul(buf, NULL, 10); - -switch (v) { - case 2: v = 1; break; - case 4: v = 2; break; - case 8: v = 3; break; - default: - return -EINVAL; -} -/* write v to register */ ---- end code --- + + unsigned long v = simple_strtoul(buf, NULL, 10); + + switch (v) { + case 2: v = 1; break; + case 4: v = 2; break; + case 8: v = 3; break; + default: + return -EINVAL; + } + /* write v to register */