lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f385d46e-cd60-ce57-d9c5-da23ad69e262@users.sourceforge.net>
Date:   Wed, 10 May 2017 17:15:33 +0200
From:   SF Markus Elfring <elfring@...rs.sourceforge.net>
To:     dri-devel@...ts.freedesktop.org,
        Daniel Vetter <daniel.vetter@...ll.ch>,
        David Airlie <airlied@...ux.ie>,
        Fengguang Wu <fengguang.wu@...el.com>,
        Joe Perches <joe@...ches.com>,
        Noralf Trønnes <noralf@...nnes.org>,
        Thierry Reding <treding@...dia.com>
Cc:     kernel-janitors@...r.kernel.org,
        LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH] tinydrm: mipi-dbi: Adjust buffer output in
 mipi_dbi_debugfs_command_show()

From: Markus Elfring <elfring@...rs.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@...ches.com>
Signed-off-by: Markus Elfring <elfring@...rs.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ