All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/6] ibmvfc: byte swap login_buf.resp values in attribute show functions
@ 2020-11-12  1:04 ` Tyrel Datwyler
  0 siblings, 0 replies; 32+ messages in thread
From: Tyrel Datwyler @ 2020-11-12  1:04 UTC (permalink / raw)
  To: james.bottomley
  Cc: martin.petersen, linux-scsi, linuxppc-dev, linux-kernel, brking,
	Tyrel Datwyler

Both ibmvfc_show_host_(capabilities|npiv_version) functions retrieve
values from vhost->login_buf.resp buffer. This is the MAD response
buffer from the VIOS and as such any multi-byte non-string values are in
big endian format.

Byte swap these values to host cpu endian format for better human
readability.

Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
---
 drivers/scsi/ibmvscsi/ibmvfc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
index 070cf516b98f..01fe65de9086 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.c
+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
@@ -3025,7 +3025,7 @@ static ssize_t ibmvfc_show_host_npiv_version(struct device *dev,
 {
 	struct Scsi_Host *shost = class_to_shost(dev);
 	struct ibmvfc_host *vhost = shost_priv(shost);
-	return snprintf(buf, PAGE_SIZE, "%d\n", vhost->login_buf->resp.version);
+	return snprintf(buf, PAGE_SIZE, "%d\n", be32_to_cpu(vhost->login_buf->resp.version));
 }
 
 static ssize_t ibmvfc_show_host_capabilities(struct device *dev,
@@ -3033,7 +3033,7 @@ static ssize_t ibmvfc_show_host_capabilities(struct device *dev,
 {
 	struct Scsi_Host *shost = class_to_shost(dev);
 	struct ibmvfc_host *vhost = shost_priv(shost);
-	return snprintf(buf, PAGE_SIZE, "%llx\n", vhost->login_buf->resp.capabilities);
+	return snprintf(buf, PAGE_SIZE, "%llx\n", be64_to_cpu(vhost->login_buf->resp.capabilities));
 }
 
 /**
-- 
2.27.0


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

end of thread, other threads:[~2020-11-18  0:42 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-12  1:04 [PATCH 1/6] ibmvfc: byte swap login_buf.resp values in attribute show functions Tyrel Datwyler
2020-11-12  1:04 ` Tyrel Datwyler
2020-11-12  1:04 ` [PATCH 2/6] ibmvfc: deduplicate common ibmvfc_cmd init code Tyrel Datwyler
2020-11-12  1:04   ` Tyrel Datwyler
2020-11-12  1:04 ` [PATCH 3/6] ibmvfc: add new fields for version 2 of several MADs Tyrel Datwyler
2020-11-12  1:04   ` Tyrel Datwyler
2020-11-17 22:06   ` Brian King
2020-11-17 22:06     ` Brian King
2020-11-18  0:28     ` Tyrel Datwyler
2020-11-18  0:28       ` Tyrel Datwyler
2020-11-12  1:04 ` [PATCH 4/6] ibmvfc: add FC payload retrieval routines for versioned vfcFrames Tyrel Datwyler
2020-11-12  1:04   ` Tyrel Datwyler
2020-11-17 22:14   ` Brian King
2020-11-17 22:14     ` Brian King
2020-11-17 22:21     ` Brian King
2020-11-17 22:21       ` Brian King
2020-11-18  0:39       ` Tyrel Datwyler
2020-11-18  0:39         ` Tyrel Datwyler
2020-11-18  0:34     ` Tyrel Datwyler
2020-11-18  0:34       ` Tyrel Datwyler
2020-11-12  1:04 ` [PATCH 5/6] ibmvfc: add support for targetWWPN field in v2 MADs and vfcFrame Tyrel Datwyler
2020-11-12  1:04   ` Tyrel Datwyler
2020-11-12  1:04 ` [PATCH 6/6] ibmvfc: advertise client support for targetWWPN using v2 commands Tyrel Datwyler
2020-11-12  1:04   ` Tyrel Datwyler
2020-11-17 22:23   ` Brian King
2020-11-17 22:23     ` Brian King
2020-11-12  9:37 ` [PATCH 1/6] ibmvfc: byte swap login_buf.resp values in attribute show functions Christoph Hellwig
2020-11-12  9:37   ` Christoph Hellwig
2020-11-13 19:39   ` Tyrel Datwyler
2020-11-13 19:39     ` Tyrel Datwyler
2020-11-17  3:22     ` Martin K. Petersen
2020-11-17  3:22       ` Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.