From: Corey Minyard <minyard@acm.org>
To: Xiongfeng Wang <wangxiongfeng2@huawei.com>
Cc: arnd@arndb.de, gregkh@linuxfoundation.org,
openipmi-developer@lists.sourceforge.net,
linux-kernel@vger.kernel.org, guohanjun@huawei.com,
joe@perches.com
Subject: Re: [PATCH v2] ipmi/watchdog: add missing newlines when printing parameters by sysfs
Date: Tue, 21 Jul 2020 06:31:49 -0500 [thread overview]
Message-ID: <20200721113149.GH2952@minyard.net> (raw)
In-Reply-To: <1595313309-43881-1-git-send-email-wangxiongfeng2@huawei.com>
On Tue, Jul 21, 2020 at 02:35:09PM +0800, Xiongfeng Wang wrote:
> 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>
Thanks, included in my queue for next release.
-corey
> ---
> drivers/char/ipmi/ipmi_watchdog.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c
> index 55986e1..f78156d 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;
> }
>
>
> --
> 1.7.12.4
>
prev parent reply other threads:[~2020-07-21 11:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-21 6:35 [PATCH v2] ipmi/watchdog: add missing newlines when printing parameters by sysfs Xiongfeng Wang
2020-07-21 11:31 ` Corey Minyard [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200721113149.GH2952@minyard.net \
--to=minyard@acm.org \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=guohanjun@huawei.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=openipmi-developer@lists.sourceforge.net \
--cc=wangxiongfeng2@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.