* [PATCH 0/2] ACPI: sysfs: add missing newlines when printing acpi module parameters
@ 2020-06-16 9:14 Xiongfeng Wang
2020-06-16 9:14 ` [PATCH 1/2] ACPI: EC: add a newline when printing module parameter 'ec_event_clearing' Xiongfeng Wang
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Xiongfeng Wang @ 2020-06-16 9:14 UTC (permalink / raw)
To: rjw, lenb; +Cc: linux-acpi, linux-kernel, guohanjun, wangxiongfeng2
When I cat module parameters in '/sys/module/acpi/parameters/',
I found several parameters need a newline.
[root@hulk-202 ~]# cd /sys/module/acpi/parameters/
[root@hulk-202 parameters]# cat acpica_version
20180810[root@hulk-202 parameters]# cat ec_event_clearing
query[root@hulk-202 parameters]#
[root@localhost parameters]# cat trace_method_name
(null)[root@localhost parameters]# cat trace_state
disable[root@localhost parameters]#
Xiongfeng Wang (2):
ACPI: EC: add a newline when printing module parameter
'ec_event_clearing'
ACPI: sysfs: add missing newlines when printing module parameters
drivers/acpi/ec.c | 8 ++++----
drivers/acpi/sysfs.c | 12 ++++++------
2 files changed, 10 insertions(+), 10 deletions(-)
--
1.7.12.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] ACPI: EC: add a newline when printing module parameter 'ec_event_clearing'
2020-06-16 9:14 [PATCH 0/2] ACPI: sysfs: add missing newlines when printing acpi module parameters Xiongfeng Wang
@ 2020-06-16 9:14 ` Xiongfeng Wang
2020-06-16 9:14 ` [PATCH 2/2] ACPI: sysfs: add missing newlines when printing module parameters Xiongfeng Wang
2020-06-22 15:50 ` [PATCH 0/2] ACPI: sysfs: add missing newlines when printing acpi " Rafael J. Wysocki
2 siblings, 0 replies; 4+ messages in thread
From: Xiongfeng Wang @ 2020-06-16 9:14 UTC (permalink / raw)
To: rjw, lenb; +Cc: linux-acpi, linux-kernel, guohanjun, wangxiongfeng2
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 <wangxiongfeng2@huawei.com>
---
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;
}
--
1.7.12.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] ACPI: sysfs: add missing newlines when printing module parameters
2020-06-16 9:14 [PATCH 0/2] ACPI: sysfs: add missing newlines when printing acpi module parameters Xiongfeng Wang
2020-06-16 9:14 ` [PATCH 1/2] ACPI: EC: add a newline when printing module parameter 'ec_event_clearing' Xiongfeng Wang
@ 2020-06-16 9:14 ` Xiongfeng Wang
2020-06-22 15:50 ` [PATCH 0/2] ACPI: sysfs: add missing newlines when printing acpi " Rafael J. Wysocki
2 siblings, 0 replies; 4+ messages in thread
From: Xiongfeng Wang @ 2020-06-16 9:14 UTC (permalink / raw)
To: rjw, lenb; +Cc: linux-acpi, linux-kernel, guohanjun, wangxiongfeng2
Add newlines for several module parameters printed by sysfs.
Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
---
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;
}
--
1.7.12.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] ACPI: sysfs: add missing newlines when printing acpi module parameters
2020-06-16 9:14 [PATCH 0/2] ACPI: sysfs: add missing newlines when printing acpi module parameters Xiongfeng Wang
2020-06-16 9:14 ` [PATCH 1/2] ACPI: EC: add a newline when printing module parameter 'ec_event_clearing' Xiongfeng Wang
2020-06-16 9:14 ` [PATCH 2/2] ACPI: sysfs: add missing newlines when printing module parameters Xiongfeng Wang
@ 2020-06-22 15:50 ` Rafael J. Wysocki
2 siblings, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2020-06-22 15:50 UTC (permalink / raw)
To: Xiongfeng Wang; +Cc: lenb, linux-acpi, linux-kernel, guohanjun
On Tuesday, June 16, 2020 11:14:07 AM CEST Xiongfeng Wang wrote:
> When I cat module parameters in '/sys/module/acpi/parameters/',
> I found several parameters need a newline.
>
> [root@hulk-202 ~]# cd /sys/module/acpi/parameters/
> [root@hulk-202 parameters]# cat acpica_version
> 20180810[root@hulk-202 parameters]# cat ec_event_clearing
> query[root@hulk-202 parameters]#
> [root@localhost parameters]# cat trace_method_name
> (null)[root@localhost parameters]# cat trace_state
> disable[root@localhost parameters]#
>
> Xiongfeng Wang (2):
> ACPI: EC: add a newline when printing module parameter
> 'ec_event_clearing'
> ACPI: sysfs: add missing newlines when printing module parameters
>
> drivers/acpi/ec.c | 8 ++++----
> drivers/acpi/sysfs.c | 12 ++++++------
> 2 files changed, 10 insertions(+), 10 deletions(-)
>
>
Both patches applied as 5.9 material, thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-06-22 15:50 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-16 9:14 [PATCH 0/2] ACPI: sysfs: add missing newlines when printing acpi module parameters Xiongfeng Wang
2020-06-16 9:14 ` [PATCH 1/2] ACPI: EC: add a newline when printing module parameter 'ec_event_clearing' Xiongfeng Wang
2020-06-16 9:14 ` [PATCH 2/2] ACPI: sysfs: add missing newlines when printing module parameters Xiongfeng Wang
2020-06-22 15:50 ` [PATCH 0/2] ACPI: sysfs: add missing newlines when printing acpi " Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).