From patchwork Mon Apr 24 20:20:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9697147 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AE3EE601E9 for ; Mon, 24 Apr 2017 20:20:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A14EE28066 for ; Mon, 24 Apr 2017 20:20:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9396C28425; Mon, 24 Apr 2017 20:20:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2983D28066 for ; Mon, 24 Apr 2017 20:20:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933237AbdDXUUd (ORCPT ); Mon, 24 Apr 2017 16:20:33 -0400 Received: from mout.web.de ([212.227.17.12]:55732 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1428274AbdDXUU0 (ORCPT ); Mon, 24 Apr 2017 16:20:26 -0400 Received: from [192.168.1.2] ([77.181.233.174]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0M8Qtq-1c73TI072w-00vv34; Mon, 24 Apr 2017 22:20:14 +0200 Subject: [PATCH 4/7] HID: debug: Replace five seq_printf() calls by seq_putc() From: SF Markus Elfring To: linux-iio@vger.kernel.org, linux-input@vger.kernel.org, Benjamin Tissoires , =?UTF-8?Q?Bruno_Pr=c3=a9mont?= , Henrik Rydberg , Jiri Kosina , Jonathan Cameron , Srinivas Pandruvada Cc: LKML , kernel-janitors@vger.kernel.org References: <2d526d72-a740-367b-04a9-ed698435f8ed@users.sourceforge.net> Message-ID: Date: Mon, 24 Apr 2017 22:20:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 MIME-Version: 1.0 In-Reply-To: <2d526d72-a740-367b-04a9-ed698435f8ed@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:oo1BBHBrKvb9vjl1E4JmiX0RQQ8Ykot5/ealFUzQeDDs+vLD5TD BitPtYJxDg7XW0x+fL2d43IrCKNfuI7OUr9FW46XaWR/PcWL2VWevJPoUUzf9yhwQn2DhpY YBB14/+l1obR3PNiBMPHSEEXbkp80S+4Qwj+uxq/Zmig9eJK0U9RD3bF3MbvTXXhv87mjFd mAb090w+svoLyosSpUnxQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:8vyPNpW4VXQ=:j50UPks3+RhNm+R1FWLssA +sYWMv3i56wQ9I25k/9nS/5m0lch8V9iXWnjutLlLgzGKLRyPIRyAL/GkewzLlqhTc3X84oc3 EmM7WY/JPyprBLN4NmQPupXm7dIPqXHqn82YBPoVc4SehTS8P54Gg7RUzEdoip1XciQw9qu7q FAg2tJdw0WbZ2BAD6jOCAdIvBJXxkXgNcGup4t7iywfwVsx5UIR59HDHQQhAx2PXMLVXcdgeQ eMnk53bqk4MEWsgvvbOotx/zftR1otgYp09m3K0qQulgwMOV45eh+TRVhYj4WbzZj1vxFJzjX jPKYwh7yUQneCpsDMKU4iUXW/LnpRajJqoNNdtlxsdOapZ4AbK1U3REkATf+LqUjx2D1l+ry1 2XBmppQSRjsjr1dIK3EylAdHamVKTpI9wAGKy6owm+jPo/1PCGLubCLYT749E0pnr8ZOVZRZS ZTH7bjKduhp2TOhrXQTChRuzXjn9+hnV3tjinwjGwzMG2usDKO8jtV1OjkYV7wDt1Nd+gFNNI 8pG5sCkLr6ATqeKriO8O8aYQPMzQEj/bdCCFww6SxMQKkiX2sHJmAGklwcHun5jHzO0XWhzKg s9Y2qP0m2p9uQAEdkzUEKdh+ZFsKZ96GwPvI5I74EEbUZO+7zTLBMGdAbysTEBTilI+45YCoV BFyoBxf7w1q/9kY33I/+LzRvrrcKq7YhzZ+nfTrP+0QrrRjkJgdiy9vAnBM54nLyavjN8xkPz EgEFC4tpJ0kAJPMuiCedFUvWa5WUKtj5QHp5KGbiqdfgqs6OiW8RqXdwZpBR3cue0R38JT7VK /m6rkmi Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring 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 --- 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;