From patchwork Wed May 10 15:15:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9720031 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 02C8C60236 for ; Wed, 10 May 2017 15:15:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E916E285E8 for ; Wed, 10 May 2017 15:15:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DCFA628614; Wed, 10 May 2017 15:15:58 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7A63C285E8 for ; Wed, 10 May 2017 15:15:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E642889654; Wed, 10 May 2017 15:15:57 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.web.de (mout.web.de [212.227.15.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id AEF2789654 for ; Wed, 10 May 2017 15:15:55 +0000 (UTC) Received: from [192.168.1.3] ([77.182.42.34]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0LfAbI-1doNfM3UDo-00orHB; Wed, 10 May 2017 17:15:36 +0200 Subject: [PATCH] tinydrm: mipi-dbi: Adjust buffer output in mipi_dbi_debugfs_command_show() To: dri-devel@lists.freedesktop.org, Daniel Vetter , David Airlie , Fengguang Wu , Joe Perches , =?UTF-8?Q?Noralf_Tr=c3=b8nnes?= , Thierry Reding References: <2795b611-dfb9-eaf6-e04d-10e27ce96772@users.sourceforge.net> <7a6e57ed-7d71-78bc-706e-3a6a1eea3a23@tronnes.org> <1494354199.20782.5.camel@perches.com> From: SF Markus Elfring Message-ID: Date: Wed, 10 May 2017 17:15:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <1494354199.20782.5.camel@perches.com> Content-Language: en-US X-Provags-ID: V03:K0:fP+FEDm0X8G6qOkydkkds8kpqs6K5xBxx2tBmT4zeGUFa2zuPAZ 5iVoTwmGZMSTv1kPVebqT9Wqemqe8i3T6X6cB6v9fjX5BhJIgw7D3JnawWS4UsW/aUZaj02 Hy8WGweBkG6D03ar4XC7SPQl27BDsy6ZxLxk4B4RW7fX/XfPGdhoAcvsVZULTY68Ut8uCHq 8dfbGYpaFKKjjEHfgAmXw== X-UI-Out-Filterresults: notjunk:1; V01:K0:sJX36iqV08A=:GSNT7ToETqPftVcI+V7Gc9 y9pZ80DXvzHMPcLC7F/hKlCh4TlHpzHeiNXJhlntCxc3WNmT7v0kvEvqEH71RyiNXoNmRujSP ThzGqWv2aE5/qwLFqTM3xEC8IYWeJn2R9mNrMkYC2+0iFcBkgq85s4P4eNHtCVvRuGITlzaxE etlMkrfWe6gXjBlQ166mErTlPobjFl84JvUZXXE1Crn+33EB55TMOymLSSxn/w9yymsbp3Ns/ zcJa5YbOKw4fpIllHSRNiwggN1p/Tia1Ji30ZPqzAiE+R2/au0q0MbRsi9Dzc57YnUo9A0oCi CjpBtvOdsRW6x/6u5AOSkT6LjHGTivlIRNPzyRoGcweYbmZMZvTN43ROFOaF6EBxxLe8vFCp8 RJ3rY+j+bmgeVaoTxKb2PuhhAIp01B2M6WicqkSvywiuakDZBLThHbsqGFCE67lbWbZ9ImATn 8D6ceNbULI7LXYh+AMMmWU8II0N6Gvd8oqON+Wp8nVBNlt9ctZQdQtW89NKOGi3x74lM3lyEc qhYpILHYvNGClpZg8yxGqFXFFt2fiem4r4cMMwX3FcyDzZwKv+kFU+WMuhi0fryvZ9yIwsCCl o7DrdlXm8WPs3/KGIYjowvLNiQH2zRwXETJJfa401+KRNNMZIlXTcmRb/rf8cHWvozh8SU9kN K3YU5MTPHss/KYvKZ0QZbLcsgtw1dcuT3hZhHAK5mBY8Bg+yNKzLsnImB31znQZ7w1RrMllfO 0CDUvTmJSUjtLMduPlJladciTYLwTP/9fMFs0kIaCvXDEj50ixdasFSpc5v2KBUQFnQ895XMW vMv3xIt Cc: kernel-janitors@vger.kernel.org, LKML X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Wed, 10 May 2017 17:03:20 +0200 * Use a special format string specification for the desired output of the array "val" into a sequence. * Adjust two local variables accordingly. This refactoring supersedes the update suggestion "tinydrm: mipi-dbi: Use seq_putc() in mipi_dbi_debugfs_command_show()" from 2017-05-08. https://patchwork.kernel.org/patch/9716119/ Fixes: 02dd95fe316936269a52d6ccb971bb956412b40a ("drm/tinydrm: Add MIPI DBI support") Suggested-by: Joe Perches Signed-off-by: Markus Elfring Acked-by: Noralf Trønnes --- drivers/gpu/drm/tinydrm/mipi-dbi.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/tinydrm/mipi-dbi.c b/drivers/gpu/drm/tinydrm/mipi-dbi.c index f4eb412f3604..2670259d1798 100644 --- a/drivers/gpu/drm/tinydrm/mipi-dbi.c +++ b/drivers/gpu/drm/tinydrm/mipi-dbi.c @@ -914,8 +914,7 @@ static int mipi_dbi_debugfs_command_show(struct seq_file *m, void *unused) { struct mipi_dbi *mipi = m->private; u8 cmd, val[4]; - size_t len, i; - int ret; + int len, ret; for (cmd = 0; cmd < 255; cmd++) { if (!mipi_dbi_command_is_read(mipi, cmd)) @@ -944,9 +943,7 @@ static int mipi_dbi_debugfs_command_show(struct seq_file *m, void *unused) continue; } - for (i = 0; i < len; i++) - seq_printf(m, "%02x", val[i]); - seq_puts(m, "\n"); + seq_printf(m, "%*phN\n", len, val); } return 0;