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
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 <[email protected]>
---
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
Add newlines for several module parameters printed by sysfs.
Signed-off-by: Xiongfeng Wang <[email protected]>
---
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
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!