diff mbox series

[01/23] libsbefifo: Fix compilation error for undefined variable

Message ID 20200414024750.20170-2-amitay@ozlabs.org
State Superseded
Headers show
Series Enable drivers per backend | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (6ae2ba655ca5e24b403a33bf15dff7261d3e7052)
snowpatch_ozlabs/build-multiarch success Test build-multiarch on branch master

Commit Message

Amitay Isaacs April 14, 2020, 2:47 a.m. UTC
We didn't hit this because of the LOG() macro which is only enabled with
-DLIBSBEFIFO_DEBUG=1.

Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>
Reviewed-by: Alistair Popple <alistair@popple.id.au>
---
 libsbefifo/operation.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libsbefifo/operation.c b/libsbefifo/operation.c
index 07d9f64..8717f15 100644
--- a/libsbefifo/operation.c
+++ b/libsbefifo/operation.c
@@ -60,17 +60,18 @@  static int sbefifo_transport(struct sbefifo_context *sctx, uint8_t *msg, uint32_
 	int rc;
 	size_t buflen;
 
+
 	buflen = msg_len;
 	rc = sbefifo_write(sctx, msg, buflen);
 	if (rc) {
-		LOG("write: cmd=%08x, rc=%d\n", cmd, rc);
+		LOG("write: cmd=%08x, rc=%d\n", be32toh(*(uint32_t *)(msg+4)), rc);
 		return rc;
 	}
 
 	buflen = *out_len;
 	rc = sbefifo_read(sctx, out, &buflen);
 	if (rc) {
-		LOG("read: cmd=%08x, buflen=%zu, rc=%d\n", cmd, buflen, rc);
+		LOG("read: cmd=%08x, buflen=%zu, rc=%d\n", be32toh(*(uint32_t *)(msg+4)), buflen, rc);
 		return rc;
 	}