linux-s390.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-s390@vger.kernel.org,
	"Heiko Carstens" <heiko.carstens@de.ibm.com>,
	"Jan Höppner" <hoeppner@linux.vnet.ibm.com>,
	"Martin Schwidefsky" <schwidefsky@de.ibm.com>,
	"Stefan Haberland" <sth@linux.vnet.ibm.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 1/3] s390/dasd: Adjust buffer output in dasd_hosts_print()
Date: Wed, 10 May 2017 20:01:17 +0200	[thread overview]
Message-ID: <deb83447-9b77-d297-135c-a8af8055b3af@users.sourceforge.net> (raw)
In-Reply-To: <4af00744-1c8a-6b33-22c8-d26d569f6c5f@users.sourceforge.net>

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 10 May 2017 18:52:28 +0200

* Use a special format string specification for the desired output of the
  array "pgid" into a sequence.

  This issue was detected by using the Coccinelle software.

* Delete the local variable "j" and a call of the function "seq_puts"
  wich became unnecessary with this refactoring.

Fixes: 5a3b7b112884f80ff19b18028fabeb4f9c035518 ("s390/dasd: add query host access to volume support")
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/s390/block/dasd_eckd.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index 122456e4db89..b3709d3cba54 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -5288,7 +5288,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) {
@@ -5308,10 +5308,8 @@ 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",
+			   ARRAY_SIZE(entry->pgid), entry->pgid);
 		/* FLAGS */
 		seq_printf(m, "status_flags %02x\n", entry->status_flags);
 		/* SYSPLEX NAME */
-- 
2.12.3

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

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-10 18:00 [PATCH 0/3] S390-DASD: Fine-tuning for some function implementations SF Markus Elfring
2017-05-10 18:01 ` SF Markus Elfring [this message]
2017-05-10 19:28   ` [PATCH 1/3] s390/dasd: Adjust buffer output in dasd_hosts_print() Dan Carpenter
2017-05-10 22:30   ` kbuild test robot
2017-05-10 18:02 ` [PATCH 2/3] s390/dasd: Fix typos in two comment lines SF Markus Elfring
2017-05-10 18:03 ` [PATCH 3/3] s390/dasd: Adjust six checks for null pointers SF Markus Elfring
2017-12-14 10:34 ` [PATCH 0/3] S390-DASD: Fine-tuning for some function implementations SF Markus Elfring
2017-12-14 11:07   ` Heiko Carstens

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=deb83447-9b77-d297-135c-a8af8055b3af@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --cc=heiko.carstens@de.ibm.com \
    --cc=hoeppner@linux.vnet.ibm.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=sth@linux.vnet.ibm.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;
as well as URLs for NNTP newsgroup(s).