From patchwork Tue Jun 16 09:14:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiongfeng Wang X-Patchwork-Id: 11606933 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0FD1F618 for ; Tue, 16 Jun 2020 09:20:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 025282078E for ; Tue, 16 Jun 2020 09:20:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726261AbgFPJUZ (ORCPT ); Tue, 16 Jun 2020 05:20:25 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:6333 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725911AbgFPJUZ (ORCPT ); Tue, 16 Jun 2020 05:20:25 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id EFF4E7CABB7DC5C85B51; Tue, 16 Jun 2020 17:20:22 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.487.0; Tue, 16 Jun 2020 17:20:17 +0800 From: Xiongfeng Wang To: , CC: , , , Subject: [PATCH 1/2] ACPI: EC: add a newline when printing module parameter 'ec_event_clearing' Date: Tue, 16 Jun 2020 17:14:08 +0800 Message-ID: <1592298849-41530-2-git-send-email-wangxiongfeng2@huawei.com> X-Mailer: git-send-email 1.7.12.4 In-Reply-To: <1592298849-41530-1-git-send-email-wangxiongfeng2@huawei.com> References: <1592298849-41530-1-git-send-email-wangxiongfeng2@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org When I cat acpi module parameter '/sys/module/acpi/parameters/ec_event_clearing', it displays as follows. It is better to add a newline for easy reading. [root@hulk-202 ~]# cat /sys/module/acpi/parameters/ec_event_clearing query[root@hulk-202 ~]# Signed-off-by: Xiongfeng Wang --- drivers/acpi/ec.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 04ce2b9..fcddda3 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -2059,13 +2059,13 @@ static int param_get_event_clearing(char *buffer, { switch (ec_event_clearing) { case ACPI_EC_EVT_TIMING_STATUS: - return sprintf(buffer, "status"); + return sprintf(buffer, "status\n"); case ACPI_EC_EVT_TIMING_QUERY: - return sprintf(buffer, "query"); + return sprintf(buffer, "query\n"); case ACPI_EC_EVT_TIMING_EVENT: - return sprintf(buffer, "event"); + return sprintf(buffer, "event\n"); default: - return sprintf(buffer, "invalid"); + return sprintf(buffer, "invalid\n"); } return 0; } From patchwork Tue Jun 16 09:14:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiongfeng Wang X-Patchwork-Id: 11606937 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 351FC1392 for ; Tue, 16 Jun 2020 09:20:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1BDC720786 for ; Tue, 16 Jun 2020 09:20:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728106AbgFPJUd (ORCPT ); Tue, 16 Jun 2020 05:20:33 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:55440 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726052AbgFPJUa (ORCPT ); Tue, 16 Jun 2020 05:20:30 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 0DB4DAF247A6438F2798; Tue, 16 Jun 2020 17:20:28 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.487.0; Tue, 16 Jun 2020 17:20:17 +0800 From: Xiongfeng Wang To: , CC: , , , Subject: [PATCH 2/2] ACPI: sysfs: add missing newlines when printing module parameters Date: Tue, 16 Jun 2020 17:14:09 +0800 Message-ID: <1592298849-41530-3-git-send-email-wangxiongfeng2@huawei.com> X-Mailer: git-send-email 1.7.12.4 In-Reply-To: <1592298849-41530-1-git-send-email-wangxiongfeng2@huawei.com> References: <1592298849-41530-1-git-send-email-wangxiongfeng2@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Add newlines for several module parameters printed by sysfs. Signed-off-by: Xiongfeng Wang --- drivers/acpi/sysfs.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c index 3a89909..6ad142d 100644 --- a/drivers/acpi/sysfs.c +++ b/drivers/acpi/sysfs.c @@ -214,7 +214,7 @@ static int param_set_trace_method_name(const char *val, static int param_get_trace_method_name(char *buffer, const struct kernel_param *kp) { - return scnprintf(buffer, PAGE_SIZE, "%s", acpi_gbl_trace_method_name); + return scnprintf(buffer, PAGE_SIZE, "%s\n", acpi_gbl_trace_method_name); } static const struct kernel_param_ops param_ops_trace_method = { @@ -271,15 +271,15 @@ static int param_set_trace_state(const char *val, static int param_get_trace_state(char *buffer, const struct kernel_param *kp) { if (!(acpi_gbl_trace_flags & ACPI_TRACE_ENABLED)) - return sprintf(buffer, "disable"); + return sprintf(buffer, "disable\n"); else { if (acpi_gbl_trace_method_name) { if (acpi_gbl_trace_flags & ACPI_TRACE_ONESHOT) - return sprintf(buffer, "method-once"); + return sprintf(buffer, "method-once\n"); else - return sprintf(buffer, "method"); + return sprintf(buffer, "method\n"); } else - return sprintf(buffer, "enable"); + return sprintf(buffer, "enable\n"); } return 0; } @@ -302,7 +302,7 @@ static int param_get_acpica_version(char *buffer, { int result; - result = sprintf(buffer, "%x", ACPI_CA_VERSION); + result = sprintf(buffer, "%x\n", ACPI_CA_VERSION); return result; }