diff options
author | Xiongfeng Wang <wangxiongfeng2@huawei.com> | 2020-07-21 09:35:09 +0300 |
---|---|---|
committer | Corey Minyard <cminyard@mvista.com> | 2020-07-21 14:29:15 +0300 |
commit | 634b06def11cf7ecf6282c79735f08004e323983 (patch) | |
tree | ef08b899964e3d47bdbe344377c636f581e56236 /drivers | |
parent | a7f0f92aa82fced7df891282b67387d247e44ca8 (diff) | |
download | linux-634b06def11cf7ecf6282c79735f08004e323983.tar.xz |
ipmi/watchdog: add missing newlines when printing parameters by sysfs
When I cat some ipmi_watchdog parameters by sysfs, it displays as
follows. It's better to add a newline for easy reading.
root@(none):/# cat /sys/module/ipmi_watchdog/parameters/action
resetroot@(none):/# cat /sys/module/ipmi_watchdog/parameters/preaction
pre_noneroot@(none):/# cat /sys/module/ipmi_watchdog/parameters/preop
preop_noneroot@(none):/#
Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
Message-Id: <1595313309-43881-1-git-send-email-wangxiongfeng2@huawei.com>
Signed-off-by: Corey Minyard <cminyard@mvista.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/ipmi/ipmi_watchdog.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c index 55986e10a124..f78156d93c3f 100644 --- a/drivers/char/ipmi/ipmi_watchdog.c +++ b/drivers/char/ipmi/ipmi_watchdog.c @@ -232,12 +232,17 @@ static int set_param_str(const char *val, const struct kernel_param *kp) static int get_param_str(char *buffer, const struct kernel_param *kp) { action_fn fn = (action_fn) kp->arg; - int rv; + int rv, len; rv = fn(NULL, buffer); if (rv) return rv; - return strlen(buffer); + + len = strlen(buffer); + buffer[len++] = '\n'; + buffer[len] = 0; + + return len; } |