linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] s390/dasd: Simplify code
@ 2017-12-09  6:29 Christophe JAILLET
  2017-12-12 16:20 ` Stefan Haberland
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2017-12-09  6:29 UTC (permalink / raw)
  To: sth, hoeppner, schwidefsky, heiko.carstens
  Cc: linux-s390, linux-kernel, kernel-janitors, Christophe JAILLET

Use 'seq_printf(m, "...%*phN...")' instead of duplicating its
implementation.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/s390/block/dasd_eckd.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index a2edf2a7ace9..29397a9dba68 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -5231,7 +5231,7 @@ static int dasd_hosts_print(struct dasd_device *device, struct seq_file *m)
 	struct dasd_ckd_path_group_entry *entry;
 	struct dasd_ckd_host_information *info;
 	char sysplex[9] = "";
-	int rc, i, j;
+	int rc, i;
 
 	access = kzalloc(sizeof(*access), GFP_NOIO);
 	if (!access) {
@@ -5251,10 +5251,7 @@ static int dasd_hosts_print(struct dasd_device *device, struct seq_file *m)
 		entry = (struct dasd_ckd_path_group_entry *)
 			(info->entry + i * info->entry_size);
 		/* PGID */
-		seq_puts(m, "pgid ");
-		for (j = 0; j < 11; j++)
-			seq_printf(m, "%02x", entry->pgid[j]);
-		seq_putc(m, '\n');
+		seq_printf(m, "pgid %*phN\n", 11, entry->pgid);
 		/* FLAGS */
 		seq_printf(m, "status_flags %02x\n", entry->status_flags);
 		/* SYSPLEX NAME */
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] s390/dasd: Simplify code
  2017-12-09  6:29 [PATCH] s390/dasd: Simplify code Christophe JAILLET
@ 2017-12-12 16:20 ` Stefan Haberland
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Haberland @ 2017-12-12 16:20 UTC (permalink / raw)
  To: Christophe JAILLET, hoeppner, schwidefsky, heiko.carstens
  Cc: linux-s390, linux-kernel, kernel-janitors

On 09.12.2017 07:29, Christophe JAILLET wrote:
> Use 'seq_printf(m, "...%*phN...")' instead of duplicating its
> implementation.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>

Thanks for the patch. Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-12-12 16:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-09  6:29 [PATCH] s390/dasd: Simplify code Christophe JAILLET
2017-12-12 16:20 ` Stefan Haberland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).