Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1406935ybh; Sun, 19 Jul 2020 19:11:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjma3Kuv2fOBximk5Q45RtXJfO5sfxuUZL4vWgnO8a8EE3TVvH64ZkP0V7zwzLty1/wj0T X-Received: by 2002:a17:906:87c8:: with SMTP id zb8mr18421234ejb.35.1595211101645; Sun, 19 Jul 2020 19:11:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595211101; cv=none; d=google.com; s=arc-20160816; b=hTbu0mKzXSO2dWKF+eIYgVFJ2FSk+83orTphlnp0m7R/lTOEAli4/7bZFuNbbgZSl7 XqO+d9qvPsrX6/S5rW/XxNlIpwIDQsjiGP5S1jn/OqguoS+RRhPNLU8ZCSI2irEqhne3 i6MumGXV5wjovc0P1J2nT/e7pKoEoU8WGxKRitA97ZBKZ9Yx5dw0jUSOsucsGwDlsqQy 6DSHtddFVmSaGIOnqJRg0Sj5Yr8Xxwo+L8y5vBfyLG8vObXofXPYsDi6ulaR+l5pVGYA br7d7y+BnUeHVgVmPVytPDLhNkqJOq+VIaiNl6MK14IPfSf34Kpz6A8F5R4ZCPAq3zkA 3d1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=PeSB9StbIKOw15GWrDEVYBppkcIz4H/ZDkdpBr4DHvQ=; b=YYC5YZMCQHB4w967Hy4mscq1Komr4uI+auTSVn5HEeZvrZUsRGH/PHxtdPR8Qu5qBA zIlll0fDb5rQSzjWfD+yATIO0Q4E1aTB+M7rJo7fMT66ej4AzotbJDW8/QPI3sIphJUr VfL1ZDnifWlilOL/y2HQQLUnGrzpYAey7oOF4mDMFJYFR08MgdpwcZHlnjn49kS0ZPeF 8DHD0ty+K/+5+zM/4Bldy9Rviy0kOyGjFec5C2ZQMjE4LKUaZBSG115z7xvIRPSi9PYR frqi1dtCpJ4QyShjvRsyd2uOJMZBRg9tUrXAHOFsxpLvjH0ZDd31SKCv7Ihwk+ESvFRz gJXg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u25si10338023ejr.632.2020.07.19.19.11.19; Sun, 19 Jul 2020 19:11:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726601AbgGTCKK (ORCPT + 99 others); Sun, 19 Jul 2020 22:10:10 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:33928 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726225AbgGTCKK (ORCPT ); Sun, 19 Jul 2020 22:10:10 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 47382CF4D255012AAD7D; Mon, 20 Jul 2020 10:10:08 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.487.0; Mon, 20 Jul 2020 10:10:02 +0800 From: Xiongfeng Wang To: , , CC: , , , Subject: [PATCH] ipmi/watchdog: add missing newlines when printing parameters by sysfs Date: Mon, 20 Jul 2020 10:03:25 +0800 Message-ID: <1595210605-27888-1-git-send-email-wangxiongfeng2@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/char/ipmi/ipmi_watchdog.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c index 55986e1..3e05a1d 100644 --- a/drivers/char/ipmi/ipmi_watchdog.c +++ b/drivers/char/ipmi/ipmi_watchdog.c @@ -232,12 +232,16 @@ 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); + len += sprintf(buffer + len, "\n"); + + return len; } -- 1.7.12.4