Skip to content

Commit

Permalink
ipmi/watchdog: add missing newlines when printing parameters by sysfs
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Xiongfeng Wang authored and Corey Minyard committed Jul 21, 2020
1 parent a7f0f92 commit 634b06d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/char/ipmi/ipmi_watchdog.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}


Expand Down

0 comments on commit 634b06d

Please sign in to comment.