a9f19d
From a239423a0f9250dad9998152fa4b4b46accdf641 Mon Sep 17 00:00:00 2001
a9f19d
From: Michal Suchanek <msuchanek@suse.de>
a9f19d
Date: Mon, 14 Nov 2016 17:28:31 +0100
a9f19d
Subject: [PATCH] Fix 32bit build.
a9f19d
a9f19d
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
a9f19d
---
a9f19d
 lib/iser.c                                            | 7 ++++---
a9f19d
 test-tool/test_compareandwrite_invalid_dataout_size.c | 4 ++--
a9f19d
 test-tool/test_writesame10_invalid_dataout_size.c     | 4 ++--
a9f19d
 test-tool/test_writesame16_invalid_dataout_size.c     | 4 ++--
a9f19d
 4 files changed, 10 insertions(+), 9 deletions(-)
a9f19d
a9f19d
diff --git a/lib/iser.c b/lib/iser.c
a9f19d
index ad3adb3..17832c3 100644
a9f19d
--- a/lib/iser.c
a9f19d
+++ b/lib/iser.c
a9f19d
@@ -23,6 +23,7 @@
a9f19d
 #include <string.h>
a9f19d
 #include <stdbool.h>
a9f19d
 #include <unistd.h>
a9f19d
+#include <inttypes.h>
a9f19d
 #include "iscsi.h"
a9f19d
 #include "iser-private.h"
a9f19d
 #include "iscsi-private.h"
a9f19d
@@ -524,7 +525,7 @@ iser_prepare_read_cmd(struct iser_conn *iser_conn,struct iser_pdu *iser_pdu)
a9f19d
 		}
a9f19d
 
a9f19d
 		tx_desc->data_dir = DATA_READ;
a9f19d
-		hdr->read_va = htobe64((uint64_t)tx_desc->data_buff);
a9f19d
+		hdr->read_va = htobe64((intptr_t)tx_desc->data_buff);
a9f19d
 		hdr->read_stag = htobe32((uint32_t)tx_desc->data_mr->rkey);
a9f19d
 		hdr->flags |= ISER_RSV;
a9f19d
 
a9f19d
@@ -565,7 +566,7 @@ iser_prepare_write_cmd(struct iser_conn *iser_conn, struct iser_pdu *iser_pdu)
a9f19d
 
a9f19d
 	hdr->flags     |= ISER_WSV;
a9f19d
 	hdr->write_stag = htobe32((uint32_t)(tx_desc->data_mr->rkey));
a9f19d
-	hdr->write_va   = htobe64((uint64_t)(tx_desc->data_buff));
a9f19d
+	hdr->write_va   = htobe64((intptr_t)(tx_desc->data_buff));
a9f19d
 
a9f19d
 	return 0;
a9f19d
 }
a9f19d
@@ -1146,7 +1147,7 @@ static int iser_handle_wc(struct ibv_wc *wc,struct iser_conn *iser_conn)
a9f19d
 					wc->wr_id, wc->status, wc->vendor_err);
a9f19d
 			return iscsi_service_reconnect_if_loggedin(iscsi);
a9f19d
 		} else {
a9f19d
-			iscsi_set_error(iscsi, "flush error: wr id %lx\n", wc->wr_id);
a9f19d
+			iscsi_set_error(iscsi, "flush error: wr id %" PRIx64 "\n", wc->wr_id);
a9f19d
 
a9f19d
 			return 0;
a9f19d
 		}
a9f19d
diff --git a/test-tool/test_compareandwrite_invalid_dataout_size.c b/test-tool/test_compareandwrite_invalid_dataout_size.c
a9f19d
index b27b4f8..76da1e0 100644
a9f19d
--- a/test-tool/test_compareandwrite_invalid_dataout_size.c
a9f19d
+++ b/test-tool/test_compareandwrite_invalid_dataout_size.c
a9f19d
@@ -64,7 +64,7 @@ test_compareandwrite_invalid_dataout_size(void)
a9f19d
 
a9f19d
 
a9f19d
         logging(LOG_VERBOSE, "Check too small DataOut");
a9f19d
-        logging(LOG_VERBOSE, "COMPAREANDWRITE with DataOut==%ld (4 blocks) "
a9f19d
+        logging(LOG_VERBOSE, "COMPAREANDWRITE with DataOut==%zd (4 blocks) "
a9f19d
                 "and TL == 1 ", 4 * block_size);
a9f19d
 
a9f19d
         new_tl = 1;
a9f19d
@@ -74,7 +74,7 @@ test_compareandwrite_invalid_dataout_size(void)
a9f19d
                         EXPECT_STATUS_GENERIC_BAD);
a9f19d
 
a9f19d
         logging(LOG_VERBOSE, "Check too large DataOut");
a9f19d
-        logging(LOG_VERBOSE, "COMPAREANDWRITE with DataOut==%ld (4 blocks) "
a9f19d
+        logging(LOG_VERBOSE, "COMPAREANDWRITE with DataOut==%zd (4 blocks) "
a9f19d
                 "and TL == 3 ", 4 * block_size);
a9f19d
 
a9f19d
         new_tl = 2;
a9f19d
diff --git a/test-tool/test_writesame10_invalid_dataout_size.c b/test-tool/test_writesame10_invalid_dataout_size.c
a9f19d
index f521908..119d786 100644
a9f19d
--- a/test-tool/test_writesame10_invalid_dataout_size.c
a9f19d
+++ b/test-tool/test_writesame10_invalid_dataout_size.c
a9f19d
@@ -41,13 +41,13 @@ test_writesame10_invalid_dataout_size(void)
a9f19d
         memset(scratch, 0xa6, block_size);
a9f19d
 
a9f19d
         logging(LOG_VERBOSE, "Check too small DataOut");
a9f19d
-        logging(LOG_VERBOSE, "Unmap with DataOut==%ld (block_size==%ld)",
a9f19d
+        logging(LOG_VERBOSE, "Unmap with DataOut==%zd (block_size==%zd)",
a9f19d
                 block_size / 2, block_size);
a9f19d
         WRITESAME10(sd, 0, block_size / 2, 1, 0, 1, 0, 0, scratch,
a9f19d
                     EXPECT_STATUS_GENERIC_BAD);
a9f19d
 
a9f19d
         logging(LOG_VERBOSE, "Check too large DataOut");
a9f19d
-        logging(LOG_VERBOSE, "Unmap with DataOut==%ld (block_size==%ld)",
a9f19d
+        logging(LOG_VERBOSE, "Unmap with DataOut==%zd (block_size==%zd)",
a9f19d
                 block_size * 2, block_size);
a9f19d
         WRITESAME10(sd, 0, block_size * 2, 1, 0, 1, 0, 0, scratch,
a9f19d
                     EXPECT_STATUS_GENERIC_BAD);
a9f19d
diff --git a/test-tool/test_writesame16_invalid_dataout_size.c b/test-tool/test_writesame16_invalid_dataout_size.c
a9f19d
index 128673f..a2e22bb 100644
a9f19d
--- a/test-tool/test_writesame16_invalid_dataout_size.c
a9f19d
+++ b/test-tool/test_writesame16_invalid_dataout_size.c
a9f19d
@@ -41,13 +41,13 @@ test_writesame16_invalid_dataout_size(void)
a9f19d
         memset(scratch, 0xa6, block_size);
a9f19d
 
a9f19d
         logging(LOG_VERBOSE, "Check too small DataOut");
a9f19d
-        logging(LOG_VERBOSE, "Unmap with DataOut==%ld (block_size==%ld)",
a9f19d
+        logging(LOG_VERBOSE, "Unmap with DataOut==%zd (block_size==%zd)",
a9f19d
                 block_size / 2, block_size);
a9f19d
         WRITESAME16(sd, 0, block_size / 2, 1, 0, 1, 0, 0, scratch,
a9f19d
                     EXPECT_STATUS_GENERIC_BAD);
a9f19d
 
a9f19d
         logging(LOG_VERBOSE, "Check too large DataOut");
a9f19d
-        logging(LOG_VERBOSE, "Unmap with DataOut==%ld (block_size==%ld)",
a9f19d
+        logging(LOG_VERBOSE, "Unmap with DataOut==%zd (block_size==%zd)",
a9f19d
                 block_size * 2, block_size);
a9f19d
         WRITESAME16(sd, 0, block_size * 2, 1, 0, 1, 0, 0, scratch,
a9f19d
                     EXPECT_STATUS_GENERIC_BAD);
a9f19d
-- 
a9f19d
2.13.6
a9f19d