From patchwork Tue Feb 7 19:56:24 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: 9561037 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 54F676047A for ; Tue, 7 Feb 2017 20:03:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 47D582848D for ; Tue, 7 Feb 2017 20:03:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3C5FF28496; Tue, 7 Feb 2017 20:03: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=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 C92272848D for ; Tue, 7 Feb 2017 20:03:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932104AbdBGUDm (ORCPT ); Tue, 7 Feb 2017 15:03:42 -0500 Received: from mout.web.de ([212.227.17.12]:50063 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754690AbdBGUDh (ORCPT ); Tue, 7 Feb 2017 15:03:37 -0500 Received: from [192.168.1.2] ([78.49.4.3]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0Lmu6S-1bweWr2hjQ-00h6DQ; Tue, 07 Feb 2017 20:56:25 +0100 Subject: [PATCH 13/18] HID-debug: Combine 11 seq_printf() calls into one call in hid_dump_field() 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: <99abe158-ba41-99eb-95e1-e9aed7bafb53@users.sourceforge.net> Date: Tue, 7 Feb 2017 20:56:24 +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:fHDIa5BPPJ+4m+7qXGRdTdyzacyU7G1u4d4DhXIiBb7EKFforVP Rul529jOtnUjCMwO5VAqFjkk8HccHF4ZWjQcUKwCi5cypXHtD7sMBMfh/iww1DqEMM8vcMh beMGGLqhLTxpXfNUcDx1hTd/UtxJIpir2P87yjLI8LegUrSHADIDVfRRQwQQtWD5ZXiqTx7 VpuzJsq+yaZ5Dz6NXa5Wg== X-UI-Out-Filterresults: notjunk:1; V01:K0:UhqHdjJA/Ks=:JuVX7wr38HvbtEpACt5uUW yZsSm6uGkYqri5v/sbr+Qgg1wnZRnpIukdf5r1cN3l8UwBwgBDJkNPXMW9V8PFbjmP+fmTmHz Avh3NAeDxpc9D8eH+nL3ClrtyFO8cVX5lIBgYQAw/LYJtSu9GP0a5Bu/B0Kky/ajxEEqzqxwB BEltArKQwAV1Js7kA5uyLtjdogLIrehGQiZ1u9NJJlS+JEDUOx39GGga9YR55Q7u3PZY/3yuY rJsd4k2aJy86IqLAXZUd/aAZGdXO0gP0vsxo3gyiLM2SCyRVT4L24+EYsan/kW5ipGBMZGHuT e/MgH+nt+dYfoH+tUheFPgZUaFEwaqkT+V1T1Dn7gGidXvs/Qkcbnn+QDwtG6zzR+ghxSDL3f i/dwyKzKff/NS6SvyFDFdu9QWdz/uvaPkAruomTAK5Iowm4yo22LrEJusfpzL9KpgSdA9Zm3d 0wI9qWNXQi/KCor0X8sKhR8RfYGpjhcVSWUTkmy2O+g/ut1vwH0wY1NqVts29o96T6mfPWs5b oS2zVFAKCmHKRbwtZIffc84uJGS3TiL1SKeX/vnmPEyOzRRMlIIc18k9Y1TeRBen1ubX0YGED tc3AHXZXV9fpkFatl/2np+vvnVfTecodbwtefDHSs0ED4M82c6ij61zCJD2+HW+6u8Qyo2dN3 isameoTzFSQpllcaTMxrFy3rVZ+3jSIjd0Zpc+lwIBEOamh2SRefM08mVfhecACx69AQnq5tC AjJH7O5jB/W25gquGVfZ26Lt4/ocLUjDvHcKjgkFSSPb8eltFycFB4/dbrBk58PqPQX82wqQG AFIzTJE 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:04:28 +0100 Some data were printed into a sequence by eleven separate function calls. Print the same data by a single function call instead. Signed-off-by: Markus Elfring --- drivers/hid/hid-debug.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c index 2ce809eb4c97..aafa963e8a04 100644 --- a/drivers/hid/hid-debug.c +++ b/drivers/hid/hid-debug.c @@ -614,19 +614,18 @@ void hid_dump_field(struct hid_field *field, int n, struct seq_file *f) { tab(n, f); seq_printf(f, "Report Size(%u)\n", field->report_size); tab(n, f); seq_printf(f, "Report Count(%u)\n", field->report_count); tab(n, f); seq_printf(f, "Report Offset(%u)\n", field->report_offset); - - tab(n, f); seq_printf(f, "Flags( "); + tab(n, f); j = field->flags; - seq_printf(f, "%s", HID_MAIN_ITEM_CONSTANT & j ? "Constant " : ""); - seq_printf(f, "%s", HID_MAIN_ITEM_VARIABLE & j ? "Variable " : "Array "); - seq_printf(f, "%s", HID_MAIN_ITEM_RELATIVE & j ? "Relative " : "Absolute "); - seq_printf(f, "%s", HID_MAIN_ITEM_WRAP & j ? "Wrap " : ""); - seq_printf(f, "%s", HID_MAIN_ITEM_NONLINEAR & j ? "NonLinear " : ""); - seq_printf(f, "%s", HID_MAIN_ITEM_NO_PREFERRED & j ? "NoPreferredState " : ""); - seq_printf(f, "%s", HID_MAIN_ITEM_NULL_STATE & j ? "NullState " : ""); - seq_printf(f, "%s", HID_MAIN_ITEM_VOLATILE & j ? "Volatile " : ""); - seq_printf(f, "%s", HID_MAIN_ITEM_BUFFERED_BYTE & j ? "BufferedByte " : ""); - seq_printf(f, ")\n"); + seq_printf(f, "Flags( %s%s%s%s%s%s%s%s%s)\n", + HID_MAIN_ITEM_CONSTANT & j ? "Constant " : "", + HID_MAIN_ITEM_VARIABLE & j ? "Variable " : "Array ", + HID_MAIN_ITEM_RELATIVE & j ? "Relative " : "Absolute ", + HID_MAIN_ITEM_WRAP & j ? "Wrap " : "", + HID_MAIN_ITEM_NONLINEAR & j ? "NonLinear " : "", + HID_MAIN_ITEM_NO_PREFERRED & j ? "NoPreferredState " : "", + HID_MAIN_ITEM_NULL_STATE & j ? "NullState " : "", + HID_MAIN_ITEM_VOLATILE & j ? "Volatile " : "", + HID_MAIN_ITEM_BUFFERED_BYTE & j ? "BufferedByte " : ""); } EXPORT_SYMBOL_GPL(hid_dump_field);