Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5fbea518dab712af63076aed897fce89cd7faec3 Commit: 5fbea518dab712af63076aed897fce89cd7faec3 Parent: 2ed4263308971af3a7a0f20bef6b2257ea230a71 Author: Jean Delvare <[EMAIL PROTECTED]> AuthorDate: Sun Oct 7 22:44:33 2007 +0200 Committer: Mark M. Hoffman <[EMAIL PROTECTED]> CommitDate: Tue Oct 9 22:56:32 2007 -0400
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 <[EMAIL PROTECTED]> Acked-by: Hans de Goede <[EMAIL PROTECTED]> Signed-off-by: Mark M. Hoffman <[EMAIL PROTECTED]> --- Documentation/hwmon/sysfs-interface | 32 +++++++++++++++----------------- 1 files changed, 15 insertions(+), 17 deletions(-) diff --git a/Documentation/hwmon/sysfs-interface b/Documentation/hwmon/sysfs-interface index a2153c4..a17b692 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 */ - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html