[stgt] [PATCH ver2] tgt: Fix eprintf warnings

Boaz Harrosh bharrosh at panasas.com
Mon Mar 2 16:53:30 CET 2009

aligned_u64 was hard-coded "unsigned long long" in tgtif.c this
breaks compilation on 64bit ARCHES (eg. x86_64). define it to work
well on all platforms, just like the Kernel does it.
[This problem is caused by another problem:
  Including linux/type.h before sys/types.h will not compile, only
  the reverse order will. But when doing so lots of linux/type.h
  definitions are ifdefed out, including the definition of
  aligned_u64. This is why it as to be redefined by tgtif.c.]

And another place that needed an "%zu"

Signed-off-by: Boaz Harrosh <bharrosh at panasas.com>
 usr/fcoe/fcoe_dev.c |    2 +-
 usr/tgtif.c         |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/usr/fcoe/fcoe_dev.c b/usr/fcoe/fcoe_dev.c
index 2d0149c..e5ebf8a 100644
--- a/usr/fcoe/fcoe_dev.c
+++ b/usr/fcoe/fcoe_dev.c
@@ -248,7 +248,7 @@ int fcoe_rcv(struct fcdev *fdev)
 	hlen = fc->fcoe_hlen;
 	if (hlen != sizeof(struct fcoe_hdr)) {
 		eprintf("Wrong fcoe header size. Got %u, but should "
-			"be %u. Make sure you are using a initiator that "
+			"be %zu. Make sure you are using a initiator that "
 			"is using the current header format\n",
 			hlen, sizeof(struct fcoe_hdr));
diff --git a/usr/tgtif.c b/usr/tgtif.c
index fd5ad5b..1419ad2 100644
--- a/usr/tgtif.c
+++ b/usr/tgtif.c
@@ -34,7 +34,7 @@
 #include <sys/sysmacros.h>
 #include <linux/types.h>
 #ifndef aligned_u64
-#define aligned_u64 unsigned long long __attribute__((aligned(8)))
+#define aligned_u64 uint64_t __attribute__((aligned(8)))
 #include <scsi/scsi_tgt_if.h>

To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

More information about the stgt mailing list