From patchwork Tue Feb 7 19:52:54 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: 9561001 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 5AB6E60236 for ; Tue, 7 Feb 2017 19:53:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4CD3428487 for ; Tue, 7 Feb 2017 19:53:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3FE0728489; Tue, 7 Feb 2017 19:53:39 +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=unavailable 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 EE2F128488 for ; Tue, 7 Feb 2017 19:53:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754912AbdBGTxH (ORCPT ); Tue, 7 Feb 2017 14:53:07 -0500 Received: from mout.web.de ([212.227.17.11]:55466 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754249AbdBGTxG (ORCPT ); Tue, 7 Feb 2017 14:53:06 -0500 Received: from [192.168.1.2] ([78.49.4.3]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LgpNC-1c73jq2UDe-00oFtx; Tue, 07 Feb 2017 20:52:57 +0100 Subject: [PATCH 10/18] HID-debug: Replace five seq_printf() calls by seq_putc() To: linux-input@vger.kernel.org, Benjamin Tissoires , =?UTF-8?Q?Bruno_Pr=c3=a9mont?= , Jiri Kosina References: Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Message-ID: Date: Tue, 7 Feb 2017 20:52:54 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: X-Provags-ID: V03:K0:vSkvMfBHoKeVE31nJudE9BJ0nDGJEswSK/4nxRff7M++3Ee7JhL 7TXUsdjRZUUavpdXmZ0tj/jiVSXffiGPO5UcKqRz7Y53jX+pnsOH5XMf6QXXYadaNHLC17a 8R02gi3CJZZeuvxBMjUkj+ryKpea/KhwcDdw7K3XXhuUYra9AOWIVrHnCENJFSS9SjA6KpW ICry2bSPSPlUKmY8XdOFA== X-UI-Out-Filterresults: notjunk:1; V01:K0:H0TKARSo6rU=:DijosFPkQW6ohX14pO6USI ljBD2Dooa6227Dk6xQI2gqW7OPvqy0xPbDJQsuwg2WBHbzk0ryB8xiJEEsW2g6CcQLEPGp2MK fcq7aRguSEYRhWfAd/BfuZY92E64ThhXhuMhOVS+Laz28a4CUz4WJNPYYcEAeyhBlzjyaFCba iPRb/TAz0ego5BD1tXLZzB5guMwCT31H5ooEMqlgPUnKTixMVlmkTGPjjpeo12J9BBukfy76V Hjh5PhS6jd39npXs57DP1Gl50PYf6tNiIfZYN1Otmg/W/wqVa95GhZJsa5XocQjv6X2yhKQze KivCXlWSRRSwJrrQpfmtBmTpubkUMCnJA4RsREmf0Ms5dwV7gefX8sT+DM9oBNXnaHCoreYo5 xb8lD4gfdfLAKIwAG28cvUss7G9YsI7e+QftsANlgmmTSMI6d0k8xKRxrs5PcyJYOrIDyIAGv dRWJBlxokeXSssbfwXaaIZyH5aw/E3ksopL8EB6h3Sq2qHvsq1sUTelX+LynX4VhgyEP21StA K+o+VMVJqnfyvwLPxXws2V8/j820qXw/cn32d80g28WLnLmbkTjAwXEoVANQ4Oh7EKfVNw3u5 9it3SF5Yo9AgBZVlRfU+3K6MGV0xgUThU3h7JdjYWJuKoFNPJHvJvHVsP070mHu+a2LDf0yna jHme1JMI6R5Y0h67LNox7ctED+CkmnJdDlQ9hfJVwksVzz6U6672oUEG1n31wS2iUIJ8WHev/ p8xKR5qUtrwGFO5kHftddkzLgKv48V1EdjRMKAWaaH8nO9/W8aBezpq3SwijR/Of1F5l+rynA GcEYm4T 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: 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 --- 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;