diff options
| author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2015-01-15 06:40:56 -0500 |
|---|---|---|
| committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2015-01-16 00:17:41 -0500 |
| commit | 5cdf5a87a2b80b913499281384112a281e02193a (patch) | |
| tree | 67e8ffed9338a8473e2516bc48a12fa92aeb6321 /drivers/target | |
| parent | 3c9786e59515ed18153bfa4a36e0a2e762c0dc68 (diff) | |
iscsi-target: use '%*ph' specifier to dump hex buffer
Instead of pushing each byte via stack the %*ph specifier allows to supply just
a pointer and length of the buffer. The patch converts code to use the
specifier.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
| -rw-r--r-- | drivers/target/iscsi/iscsi_target_configfs.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/target/iscsi/iscsi_target_configfs.c b/drivers/target/iscsi/iscsi_target_configfs.c index 9059c1e0b26e..526becd763cf 100644 --- a/drivers/target/iscsi/iscsi_target_configfs.c +++ b/drivers/target/iscsi/iscsi_target_configfs.c | |||
| @@ -674,12 +674,9 @@ static ssize_t lio_target_nacl_show_info( | |||
| 674 | rb += sprintf(page+rb, "InitiatorAlias: %s\n", | 674 | rb += sprintf(page+rb, "InitiatorAlias: %s\n", |
| 675 | sess->sess_ops->InitiatorAlias); | 675 | sess->sess_ops->InitiatorAlias); |
| 676 | 676 | ||
| 677 | rb += sprintf(page+rb, "LIO Session ID: %u " | 677 | rb += sprintf(page+rb, |
| 678 | "ISID: 0x%02x %02x %02x %02x %02x %02x " | 678 | "LIO Session ID: %u ISID: 0x%6ph TSIH: %hu ", |
| 679 | "TSIH: %hu ", sess->sid, | 679 | sess->sid, sess->isid, sess->tsih); |
| 680 | sess->isid[0], sess->isid[1], sess->isid[2], | ||
| 681 | sess->isid[3], sess->isid[4], sess->isid[5], | ||
| 682 | sess->tsih); | ||
| 683 | rb += sprintf(page+rb, "SessionType: %s\n", | 680 | rb += sprintf(page+rb, "SessionType: %s\n", |
| 684 | (sess->sess_ops->SessionType) ? | 681 | (sess->sess_ops->SessionType) ? |
| 685 | "Discovery" : "Normal"); | 682 | "Discovery" : "Normal"); |
| @@ -1758,9 +1755,7 @@ static u32 lio_sess_get_initiator_sid( | |||
| 1758 | /* | 1755 | /* |
| 1759 | * iSCSI Initiator Session Identifier from RFC-3720. | 1756 | * iSCSI Initiator Session Identifier from RFC-3720. |
| 1760 | */ | 1757 | */ |
| 1761 | return snprintf(buf, size, "%02x%02x%02x%02x%02x%02x", | 1758 | return snprintf(buf, size, "%6phN", sess->isid); |
| 1762 | sess->isid[0], sess->isid[1], sess->isid[2], | ||
| 1763 | sess->isid[3], sess->isid[4], sess->isid[5]); | ||
| 1764 | } | 1759 | } |
| 1765 | 1760 | ||
| 1766 | static int lio_queue_data_in(struct se_cmd *se_cmd) | 1761 | static int lio_queue_data_in(struct se_cmd *se_cmd) |
