[PATCH 13/18] HID-debug: Combine 11 seq_printf() calls into one call in hid_dump_field()
From: SF Markus Elfring
Date: Tue Feb 07 2017 - 15:03:46 EST
From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
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@xxxxxxxxxxxxxxxxxxxxx>
---
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