From patchwork Tue Feb 7 19:59:21 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: 9561023 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 026BB6047A for ; Tue, 7 Feb 2017 20:00:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E91D52848D for ; Tue, 7 Feb 2017 20:00:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DDB8B28494; Tue, 7 Feb 2017 20:00:34 +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 8532B2848D for ; Tue, 7 Feb 2017 20:00:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754790AbdBGUAc (ORCPT ); Tue, 7 Feb 2017 15:00:32 -0500 Received: from mout.web.de ([212.227.17.12]:63856 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751336AbdBGUA3 (ORCPT ); Tue, 7 Feb 2017 15:00:29 -0500 Received: from [192.168.1.2] ([78.49.4.3]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0M25B9-1cHKW93N6J-00u4Xs; Tue, 07 Feb 2017 20:59:22 +0100 Subject: [PATCH 16/18] HID-debug: Add some spaces for better code readability 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: <68441f8a-c654-8fe2-a302-fc67e5485464@users.sourceforge.net> Date: Tue, 7 Feb 2017 20:59:21 +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:c5G9+lWE6nJ8QF5U6HgQVtoIOXu9hgDm0UXbwGjWrNiKmYa5ug4 M2OhIW2NTTnG3e+ZwIBovzK6XNy5qSsVbFLI8eU8J+J9vAyKQZwvqVjxY1NlPMOzEIDlOES rQr8Po9dlYGMZN32LunYnz4Gxeji0CrNfyXVyTghu6EzN3hzejn97wjerrmFQYfm6wj3OKH NvpUgUTI7+reR1ags4X4g== X-UI-Out-Filterresults: notjunk:1; V01:K0:skgiB5kWH1g=:4KxwsqkqQ2hR/yevx1jh2V O07zF1xUtUGt1Kby6qRBHJLKafpaD92DdihDJJqtICcAwIL9aVYUXyBY/qWtE5j8fpW3MnCLk 4N4jdcrqXRZi/Aa87T0i8MkVEtX9WOcCrH/B464p/K+lUbgOZnIzOVAe+Vw1pes0SfNAOAcl2 FGc1Xm/KhMWtwP1LuJZR2i5a0nCh/RSm0flP4jdwMAwhm4GklDs4R+fVfgjCNSXT7abOmgpah BL9vsLmYn8kBuIspwMm1QxsLM9TgkJ63hLvwCKTh+l5e+50tTjXX0Y/BEwZfW6xXFiNjootEr UBJlsXbGdAuWLeTjpSocsunP5iEybeaF4MTdxOGwyE0JmTaRHJLJyKSH+YKZ2C4RcoU8YACUE 8QVn2QujQmy6mWt0wAxtjrF/sSLZqeKa+xeFsKxoFTBZgIRDFACzs/pYChttydQm3cNC7dCZ6 w55Vu0kwPpSaUqfMzvMBX/o9JNrj7pJg0Dviy/X6p7MUMGgmtaECDIA6MAMdl0QrcOXwsovPy 4BlGgXyWyLaGkVQbQoBmNSCu1Durj1GQWjxZC4bDlYsSj/oJVYwGymQGpcAipvQ6JyUL73iHX fsUC5TLoqlt1kcBnP/df/IDvhM0PrGDnHrFYKdPJXDJC2OfujZ3V0YXNdlD9Dmn97+qbtDBxu bYgqeYIAMj3XFuy6hlFG//MVmLlVIlXxO30dFgtGdQbokI9Y7d2JG54nnaPAk1H25adQ6/5Vu IqDFYFkjmY1eQZyhv0MAj8sgzukNRUrRlaXJ11AH4+/nUZuqD4ddpyzpHj+ckDHZwPiXfsOFU JaYdE4o 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:10:40 +0100 Use space characters at some source code places according to the Linux coding style convention. Signed-off-by: Markus Elfring --- drivers/hid/hid-debug.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c index 60984e2906a7..044b12e32240 100644 --- a/drivers/hid/hid-debug.c +++ b/drivers/hid/hid-debug.c @@ -493,7 +493,7 @@ char *hid_resolv_usage(unsigned usage, struct seq_file *f) { if (!f) { len = strlen(buf); - snprintf(buf+len, max(0, HID_DEBUG_BUFSIZE - len), "."); + snprintf(buf + len, max(0, HID_DEBUG_BUFSIZE - len), "."); len++; } else { @@ -501,12 +501,14 @@ char *hid_resolv_usage(unsigned usage, struct seq_file *f) { } for (p = hid_usage_table; p->description; p++) if (p->page == (usage >> 16)) { - for(++p; p->description && p->usage != 0; p++) + for (++p; p->description && p->usage != 0; p++) if (p->usage == (usage & 0xffff)) { if (!f) snprintf(buf + len, - max(0,HID_DEBUG_BUFSIZE - len - 1), - "%s", p->description); + max(0, + HID_DEBUG_BUFSIZE + - len - 1), + "%s", p->description); else seq_puts(f, p->description); return buf; @@ -582,7 +584,7 @@ void hid_dump_field(struct hid_field *field, int n, struct seq_file *f) { sys = data & 0xf; data >>= 4; - if(sys > 4) { + if (sys > 4) { tab(n, f); seq_puts(f, "Unit(Invalid)\n"); } @@ -591,19 +593,19 @@ void hid_dump_field(struct hid_field *field, int n, struct seq_file *f) { tab(n, f); seq_printf(f, "Unit(%s : ", systems[sys]); - for (i=1 ; i>= 4; if (nibble != 0) { - if(earlier_unit++ > 0) + if (earlier_unit++ > 0) seq_putc(f, '*'); seq_puts(f, units[sys][i]); - if(nibble != 1) { + if (nibble != 1) { /* This is a _signed_ nibble(!) */ - int val = nibble & 0x7; - if(nibble & 0x08) - val = -((0x7 & ~val) +1); + + if (nibble & 0x08) + val = -((0x7 & ~val) + 1); seq_printf(f, "^%d", val); } } @@ -634,7 +636,7 @@ void hid_dump_device(struct hid_device *device, struct seq_file *f) struct hid_report_enum *report_enum; struct hid_report *report; struct list_head *list; - unsigned i,k; + unsigned int i, k; static const char *table[] = {"INPUT", "OUTPUT", "FEATURE"}; for (i = 0; i < HID_REPORT_TYPES; i++) {