From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-iio@vger.kernel.org, linux-input@vger.kernel.org,
"Benjamin Tissoires" <benjamin.tissoires@redhat.com>,
"Bruno Prémont" <bonbons@linux-vserver.org>,
"Henrik Rydberg" <rydberg@bitmath.org>,
"Jiri Kosina" <jikos@kernel.org>,
"Jonathan Cameron" <jic23@kernel.org>,
"Srinivas Pandruvada" <srinivas.pandruvada@linux.intel.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 4/7] HID: debug: Replace five seq_printf() calls by seq_putc()
Date: Mon, 24 Apr 2017 22:20:10 +0200 [thread overview]
Message-ID: <f7ad5a57-2f41-cc0a-5015-e99d58239a2d@users.sourceforge.net> (raw)
In-Reply-To: <2d526d72-a740-367b-04a9-ed698435f8ed@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 24 Apr 2017 20:34:29 +0200
Five 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@users.sourceforge.net>
---
drivers/hid/hid-debug.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c
index 5271db593478..d47d5085bc99 100644
--- a/drivers/hid/hid-debug.c
+++ b/drivers/hid/hid-debug.c
@@ -499,7 +499,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)) {
@@ -550,7 +550,8 @@ 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);
@@ -594,7 +595,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(!) */
@@ -1041,5 +1042,5 @@ static void hid_dump_input_mapping(struct hid_device *hid, struct seq_file *f)
hid_resolv_event(usage->type, usage->code, f);
- seq_printf(f, "\n");
+ seq_putc(f, '\n');
}
}
}
@@ -1066,7 +1067,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.12.2
next prev parent reply other threads:[~2017-04-24 20:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-24 20:12 [PATCH 0/7] HID: Fine-tuning for some function implementations SF Markus Elfring
2017-04-24 20:16 ` [PATCH 1/7] HID: sensor-hub: Use devm_kcalloc() in sensor_hub_probe() SF Markus Elfring
2017-04-24 20:17 ` [PATCH 2/7] HID: sensor-hub: Delete error messages for failed memory allocations " SF Markus Elfring
2017-04-27 18:16 ` SF Markus Elfring
2017-04-24 20:18 ` [PATCH 3/7] HID: sensor-hub: Adjust two checks for null pointers " SF Markus Elfring
2017-04-24 20:20 ` SF Markus Elfring [this message]
2017-04-24 20:21 ` [PATCH 5/7] HID: debug: Replace 12 seq_printf() calls by seq_puts() SF Markus Elfring
2017-04-24 20:22 ` [PATCH 6/7] HID: debug: Combine two seq_printf() calls into one call in hid_dump_device() SF Markus Elfring
2017-04-24 20:23 ` [PATCH 7/7] HID: picoLCD: Replace two seq_printf() calls by seq_puts() in picolcd_debug_reset_show() SF Markus Elfring
2017-04-25 6:40 ` Bruno Prémont
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f7ad5a57-2f41-cc0a-5015-e99d58239a2d@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=benjamin.tissoires@redhat.com \
--cc=bonbons@linux-vserver.org \
--cc=jic23@kernel.org \
--cc=jikos@kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rydberg@bitmath.org \
--cc=srinivas.pandruvada@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome