Commit 634b06de authored by Xiongfeng Wang's avatar Xiongfeng Wang Committed by Corey Minyard

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: default avatarXiongfeng Wang <wangxiongfeng2@huawei.com>
Message-Id: <1595313309-43881-1-git-send-email-wangxiongfeng2@huawei.com>
Signed-off-by: default avatarCorey Minyard <cminyard@mvista.com>
parent a7f0f92a
...@@ -232,12 +232,17 @@ static int set_param_str(const char *val, const struct kernel_param *kp) ...@@ -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) static int get_param_str(char *buffer, const struct kernel_param *kp)
{ {
action_fn fn = (action_fn) kp->arg; action_fn fn = (action_fn) kp->arg;
int rv; int rv, len;
rv = fn(NULL, buffer); rv = fn(NULL, buffer);
if (rv) if (rv)
return rv; return rv;
return strlen(buffer);
len = strlen(buffer);
buffer[len++] = '\n';
buffer[len] = 0;
return len;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment