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:56:24 +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 13/18] HID-debug: Combine 11 seq_printf() calls into one call
 in hid_dump_field()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Tue, 7 Feb 2017 20:04:28 +0100

Some data were printed into a sequence by eleven separate function calls.
Print the same data by a single function call instead.

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

diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c
index 2ce809eb4c97..aafa963e8a04 100644
--- a/drivers/hid/hid-debug.c
+++ b/drivers/hid/hid-debug.c
@@ -614,19 +614,18 @@ void hid_dump_field(struct hid_field *field, int n, struct seq_file *f) {
 	tab(n, f); seq_printf(f, "Report Size(%u)\n", field->report_size);
 	tab(n, f); seq_printf(f, "Report Count(%u)\n", field->report_count);
 	tab(n, f); seq_printf(f, "Report Offset(%u)\n", field->report_offset);
-
-	tab(n, f); seq_printf(f, "Flags( ");
+	tab(n, f);
 	j = field->flags;
-	seq_printf(f, "%s", HID_MAIN_ITEM_CONSTANT & j ? "Constant " : "");
-	seq_printf(f, "%s", HID_MAIN_ITEM_VARIABLE & j ? "Variable " : "Array ");
-	seq_printf(f, "%s", HID_MAIN_ITEM_RELATIVE & j ? "Relative " : "Absolute ");
-	seq_printf(f, "%s", HID_MAIN_ITEM_WRAP & j ? "Wrap " : "");
-	seq_printf(f, "%s", HID_MAIN_ITEM_NONLINEAR & j ? "NonLinear " : "");
-	seq_printf(f, "%s", HID_MAIN_ITEM_NO_PREFERRED & j ? "NoPreferredState " : "");
-	seq_printf(f, "%s", HID_MAIN_ITEM_NULL_STATE & j ? "NullState " : "");
-	seq_printf(f, "%s", HID_MAIN_ITEM_VOLATILE & j ? "Volatile " : "");
-	seq_printf(f, "%s", HID_MAIN_ITEM_BUFFERED_BYTE & j ? "BufferedByte " : "");
-	seq_printf(f, ")\n");
+	seq_printf(f, "Flags( %s%s%s%s%s%s%s%s%s)\n",
+		   HID_MAIN_ITEM_CONSTANT & j ? "Constant " : "",
+		   HID_MAIN_ITEM_VARIABLE & j ? "Variable " : "Array ",
+		   HID_MAIN_ITEM_RELATIVE & j ? "Relative " : "Absolute ",
+		   HID_MAIN_ITEM_WRAP & j ? "Wrap " : "",
+		   HID_MAIN_ITEM_NONLINEAR & j ? "NonLinear " : "",
+		   HID_MAIN_ITEM_NO_PREFERRED & j ? "NoPreferredState " : "",
+		   HID_MAIN_ITEM_NULL_STATE & j ? "NullState " : "",
+		   HID_MAIN_ITEM_VOLATILE & j ? "Volatile " : "",
+		   HID_MAIN_ITEM_BUFFERED_BYTE & j ? "BufferedByte " : "");
 }
 EXPORT_SYMBOL_GPL(hid_dump_field);
 
-- 
2.11.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ