Linux Input Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] Input: ati_remote2 - add missing newlines when printing module parameters
@ 2020-07-20  9:21 Xiongfeng Wang
  2020-07-22  5:34 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Xiongfeng Wang @ 2020-07-20  9:21 UTC (permalink / raw)
  To: syrjala, dmitry.torokhov; +Cc: linux-input, linux-kernel, wangxiongfeng2

When I cat some module parameters by sysfs, it displays as follows. It's
better to add a newline for easy reading.

root@syzkaller:~# cat /sys/module/ati_remote2/parameters/mode_mask
0x1froot@syzkaller:~# cat /sys/module/ati_remote2/parameters/channel_mask
0xffffroot@syzkaller:~#

Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
---
 drivers/input/misc/ati_remote2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/input/misc/ati_remote2.c b/drivers/input/misc/ati_remote2.c
index 305f0160506a..8a36d78fed63 100644
--- a/drivers/input/misc/ati_remote2.c
+++ b/drivers/input/misc/ati_remote2.c
@@ -68,7 +68,7 @@ static int ati_remote2_get_channel_mask(char *buffer,
 {
 	pr_debug("%s()\n", __func__);
 
-	return sprintf(buffer, "0x%04x", *(unsigned int *)kp->arg);
+	return sprintf(buffer, "0x%04x\n", *(unsigned int *)kp->arg);
 }
 
 static int ati_remote2_set_mode_mask(const char *val,
@@ -84,7 +84,7 @@ static int ati_remote2_get_mode_mask(char *buffer,
 {
 	pr_debug("%s()\n", __func__);
 
-	return sprintf(buffer, "0x%02x", *(unsigned int *)kp->arg);
+	return sprintf(buffer, "0x%02x\n", *(unsigned int *)kp->arg);
 }
 
 static unsigned int channel_mask = ATI_REMOTE2_MAX_CHANNEL_MASK;
-- 
2.20.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Input: ati_remote2 - add missing newlines when printing module parameters
  2020-07-20  9:21 [PATCH] Input: ati_remote2 - add missing newlines when printing module parameters Xiongfeng Wang
@ 2020-07-22  5:34 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2020-07-22  5:34 UTC (permalink / raw)
  To: Xiongfeng Wang; +Cc: syrjala, linux-input, linux-kernel

On Mon, Jul 20, 2020 at 05:21:48PM +0800, Xiongfeng Wang wrote:
> When I cat some module parameters by sysfs, it displays as follows. It's
> better to add a newline for easy reading.
> 
> root@syzkaller:~# cat /sys/module/ati_remote2/parameters/mode_mask
> 0x1froot@syzkaller:~# cat /sys/module/ati_remote2/parameters/channel_mask
> 0xffffroot@syzkaller:~#
> 
> Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>

Applied, thank you.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-20  9:21 [PATCH] Input: ati_remote2 - add missing newlines when printing module parameters Xiongfeng Wang
2020-07-22  5:34 ` Dmitry Torokhov

Linux Input Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-input/0 linux-input/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-input linux-input/ https://lore.kernel.org/linux-input \
		linux-input@vger.kernel.org
	public-inbox-index linux-input

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-input


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git