lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 7 Feb 2017 20:52:54 +0100
From:   SF Markus Elfring <elfring@...rs.sourceforge.net>
To:     linux-input@...r.kernel.org,
        Benjamin Tissoires <benjamin.tissoires@...hat.com>,
        Bruno Prémont <bonbons@...ux-vserver.org>,
        Jiri Kosina <jikos@...nel.org>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        kernel-janitors@...r.kernel.org
Subject: [PATCH 10/18] HID-debug: Replace five seq_printf() calls by
 seq_putc()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Tue, 7 Feb 2017 19:21:17 +0100

Single characters should be put into a sequence.
Thus use the corresponding function "seq_putc".

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 drivers/hid/hid-debug.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c
index acfb522a432a..383a4a838351 100644
--- a/drivers/hid/hid-debug.c
+++ b/drivers/hid/hid-debug.c
@@ -497,7 +497,7 @@ char *hid_resolv_usage(unsigned usage, struct seq_file *f) {
 		len++;
 	}
 	else {
-		seq_printf(f, ".");
+		seq_putc(f, '.');
 	}
 	for (p = hid_usage_table; p->description; p++)
 		if (p->page == (usage >> 16)) {
@@ -548,7 +548,9 @@ void hid_dump_field(struct hid_field *field, int n, struct seq_file *f) {
 	}
 	tab(n, f); seq_printf(f, "Usage(%d)\n", field->maxusage);
 	for (j = 0; j < field->maxusage; j++) {
-		tab(n+2, f); hid_resolv_usage(field->usage[j].hid, f); seq_printf(f, "\n");
+		tab(n + 2, f);
+		hid_resolv_usage(field->usage[j].hid, f);
+		seq_putc(f, '\n');
 	}
 	if (field->logical_minimum != field->logical_maximum) {
 		tab(n, f); seq_printf(f, "Logical Minimum(%d)\n", field->logical_minimum);
@@ -592,7 +594,7 @@ void hid_dump_field(struct hid_field *field, int n, struct seq_file *f) {
 				data >>= 4;
 				if (nibble != 0) {
 					if(earlier_unit++ > 0)
-						seq_printf(f, "*");
+						seq_putc(f, '*');
 					seq_printf(f, "%s", units[sys][i]);
 					if(nibble != 1) {
 						/* This is a _signed_ nibble(!) */
@@ -1037,7 +1039,7 @@ static void hid_dump_input_mapping(struct hid_device *hid, struct seq_file *f)
 					hid_resolv_usage(usage->hid, f);
 					seq_printf(f, " ---> ");
 					hid_resolv_event(usage->type, usage->code, f);
-					seq_printf(f, "\n");
+					seq_putc(f, '\n');
 				}
 			}
 		}
@@ -1064,7 +1066,7 @@ static int hid_debug_rdesc_show(struct seq_file *f, void *p)
 
 	/* dump parsed data and input mappings */
 	hid_dump_device(hdev, f);
-	seq_printf(f, "\n");
+	seq_putc(f, '\n');
 	hid_dump_input_mapping(hdev, f);
 
 	return 0;
-- 
2.11.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ