Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751304AbdLIG3v (ORCPT ); Sat, 9 Dec 2017 01:29:51 -0500 Received: from smtp02.smtpout.orange.fr ([80.12.242.124]:49599 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751147AbdLIG3u (ORCPT ); Sat, 9 Dec 2017 01:29:50 -0500 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 09 Dec 2017 07:29:48 +0100 X-ME-IP: 86.236.211.195 From: Christophe JAILLET To: sth@linux.vnet.ibm.com, hoeppner@linux.vnet.ibm.com, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] s390/dasd: Simplify code Date: Sat, 9 Dec 2017 07:29:26 +0100 Message-Id: <20171209062926.31515-1-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.14.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1218 Lines: 35 Use 'seq_printf(m, "...%*phN...")' instead of duplicating its implementation. Signed-off-by: Christophe JAILLET --- 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