From patchwork Tue Feb 7 19:55:09 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: 9561011 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 C58CE60547 for ; Tue, 7 Feb 2017 19:55:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B848E28489 for ; Tue, 7 Feb 2017 19:55:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A93202848B; Tue, 7 Feb 2017 19:55:44 +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 5680E2848B for ; Tue, 7 Feb 2017 19:55:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755466AbdBGTzY (ORCPT ); Tue, 7 Feb 2017 14:55:24 -0500 Received: from mout.web.de ([212.227.17.12]:51949 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754715AbdBGTzV (ORCPT ); Tue, 7 Feb 2017 14:55:21 -0500 Received: from [192.168.1.2] ([78.49.4.3]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MIN6p-1cZooY1YZL-004Ap1; Tue, 07 Feb 2017 20:55:13 +0100 Subject: [PATCH 12/18] HID-debug: Replace 12 seq_printf() calls by seq_puts() 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: <5e7692e4-b857-f708-080c-013ddcdcfe0f@users.sourceforge.net> Date: Tue, 7 Feb 2017 20:55:09 +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:MMk9WGlKLcFrgEKqfzawNi7cOPRuqlpUaTsQpNTiUruYAQitFAq 2hzzn0IKIbTbWONroV9QywVxOngq6xccTeTBfoDefLJQH95cUzI/Mx0u7IIk19DdNTtezAG eySrmvUEwSjuClA8teUq3xZc3tt7/oBQJBpKAunkdKm9dRukqpy7O60oq5RRJVugzVfXTIp qs/T1WdtI9HCyCRUTZRwQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:n8WZ5s7NeB8=:GrE7SesDUaNfPvgiNEwC9+ hYDYqZrL0E32USNvbd1FzLwpYsp7sYP4aLjtylVMuCyyiRflBO/GVtlVezRIQxPNLaLFvnlS0 RDFiUIT9EVCMK/SVsvOVMq6ic5rB4RUHS8+LwCxDxd7s8kF71BQKdoxJvDRZ0ZYlCibSQOp1C kfcwfTHdzrNb3J2SGu2pFcG/m3NvCVt5gOpPn1GuWTO69NyTWO7WFQqtjl3zcOy7laaoXYUt4 2Jw0nGYLs+DfVbKn66kEGXuYJVyY500M31454RIPSnxf7udI9GyJIxy1qaTLFue7xsOwSGDrC d01TjQxrL2eFcGRm1+YRAIaiBr4SUF2pTlAdsDBFRPiq0gKeYUlCmpVwxrcULMA7ECrhp44FF PKJTZkpv8PRyvE60m+2VRIfTfw7bXCe0FjI04pHXTOG6QfQc4RIrbBeZcarmgOHOIz7oN/SCX 1ahH5pMaRTA+r9RMmqGONtGoifWleicOCRcC8dXnYBaAqs4IVfiw3QOQ1LpSb5V+pObhwqJRJ 1RH86xkmm9BWI4C1YCk8Zjou3hjdey3ffp5NM0akDOg7iSSDt0lUh6tekM/cmxGxqQZvGbzkd 0ryR89SCsJ/I+0u9betPbEaJv/wQhib4pB7DEhMIoWlVyzHyTxkaZkGt2lpLwuuLJt9XgBbWG Jpjo692TMbwAr34Pm8C0NmwGl2gmu+wmxxPd2oeKJAv3hsKtbr6V53hMRdhkkUOdtRnFW8Ds8 MXtBZ2MspOWREhRnPIZxQcm/5vWRZ4IV/xDkjz7G7XpgJXUdbGF4MyDGGBri3khNbggprny7g g9fumS9 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 20:02:45 +0100 Strings which did not contain data format specifications should be put into a sequence. Thus use the corresponding function "seq_puts". This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/hid/hid-debug.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c index 8d019d0db4f3..2ce809eb4c97 100644 --- a/drivers/hid/hid-debug.c +++ b/drivers/hid/hid-debug.c @@ -508,9 +508,7 @@ char *hid_resolv_usage(unsigned usage, struct seq_file *f) { max(0,HID_DEBUG_BUFSIZE - len - 1), "%s", p->description); else - seq_printf(f, - "%s", - p->description); + seq_puts(f, p->description); return buf; } break; @@ -533,18 +531,21 @@ void hid_dump_field(struct hid_field *field, int n, struct seq_file *f) { if (field->physical) { tab(n, f); - seq_printf(f, "Physical("); - hid_resolv_usage(field->physical, f); seq_printf(f, ")\n"); + seq_puts(f, "Physical("); + hid_resolv_usage(field->physical, f); + seq_puts(f, ")\n"); } if (field->logical) { tab(n, f); - seq_printf(f, "Logical("); - hid_resolv_usage(field->logical, f); seq_printf(f, ")\n"); + seq_puts(f, "Logical("); + hid_resolv_usage(field->logical, f); + seq_puts(f, ")\n"); } if (field->application) { tab(n, f); - seq_printf(f, "Application("); - hid_resolv_usage(field->application, f); seq_printf(f, ")\n"); + seq_puts(f, "Application("); + hid_resolv_usage(field->application, f); + seq_puts(f, ")\n"); } tab(n, f); seq_printf(f, "Usage(%d)\n", field->maxusage); for (j = 0; j < field->maxusage; j++) { @@ -582,7 +583,8 @@ void hid_dump_field(struct hid_field *field, int n, struct seq_file *f) { data >>= 4; if(sys > 4) { - tab(n, f); seq_printf(f, "Unit(Invalid)\n"); + tab(n, f); + seq_puts(f, "Unit(Invalid)\n"); } else { int earlier_unit = 0; @@ -595,7 +597,7 @@ void hid_dump_field(struct hid_field *field, int n, struct seq_file *f) { if (nibble != 0) { if(earlier_unit++ > 0) seq_putc(f, '*'); - seq_printf(f, "%s", units[sys][i]); + seq_puts(f, units[sys][i]); if(nibble != 1) { /* This is a _signed_ nibble(!) */ @@ -606,7 +608,7 @@ void hid_dump_field(struct hid_field *field, int n, struct seq_file *f) { } } } - seq_printf(f, ")\n"); + seq_puts(f, ")\n"); } } tab(n, f); seq_printf(f, "Report Size(%u)\n", field->report_size); @@ -1036,7 +1038,7 @@ static void hid_dump_input_mapping(struct hid_device *hid, struct seq_file *f) for ( j = 0; j < report->field[i]->maxusage; j++) { usage = report->field[i]->usage + j; hid_resolv_usage(usage->hid, f); - seq_printf(f, " ---> "); + seq_puts(f, " ---> "); hid_resolv_event(usage->type, usage->code, f); seq_putc(f, '\n'); } @@ -1061,7 +1063,7 @@ static int hid_debug_rdesc_show(struct seq_file *f, void *p) /* dump HID report descriptor */ for (i = 0; i < rsize; i++) seq_printf(f, "%02x ", rdesc[i]); - seq_printf(f, "\n\n"); + seq_puts(f, "\n\n"); /* dump parsed data and input mappings */ hid_dump_device(hdev, f);