lkml.org 
[lkml]   [2017]   [May]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 1/3] s390/dasd: Adjust buffer output in dasd_hosts_print()
From
Date
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
\
 
 \ /
  Last update: 2017-05-10 21:22    [W:0.061 / U:5.680 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site