public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: dri-devel@lists.freedesktop.org,
	"Daniel Vetter" <daniel.vetter@ffwll.ch>,
	"David Airlie" <airlied@linux.ie>,
	"Fengguang Wu" <fengguang.wu@intel.com>,
	"Joe Perches" <joe@perches.com>,
	"Noralf Trønnes" <noralf@tronnes.org>,
	"Thierry Reding" <treding@nvidia.com>
Cc: kernel-janitors@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] tinydrm: mipi-dbi: Adjust buffer output in mipi_dbi_debugfs_command_show()
Date: Wed, 10 May 2017 15:15:33 +0000	[thread overview]
Message-ID: <f385d46e-cd60-ce57-d9c5-da23ad69e262@users.sourceforge.net> (raw)
In-Reply-To: <1494354199.20782.5.camel@perches.com>

From: Markus Elfring <elfring@users.sourceforge.net>
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 <joe@perches.com>
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 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;
-- 
2.12.3


  reply	other threads:[~2017-05-10 15:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-08 11:54 [PATCH] tinydrm: mipi-dbi: Use seq_putc() in mipi_dbi_debugfs_command_show() SF Markus Elfring
2017-05-09 17:29 ` Noralf Trønnes
2017-05-09 18:23   ` Joe Perches
2017-05-10 15:15     ` SF Markus Elfring [this message]
2017-05-10 16:31       ` [PATCH] tinydrm: mipi-dbi: Adjust buffer output " Noralf Trønnes
2017-05-10 19:26       ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f385d46e-cd60-ce57-d9c5-da23ad69e262@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=airlied@linux.ie \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=fengguang.wu@intel.com \
    --cc=joe@perches.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=noralf@tronnes.org \
    --cc=treding@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox