Fixup some printf arguments to use the correct lengths >From a0d93e71ece21b44cb0c2efcfb1f94225299bfbc Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg <[EMAIL PROTECTED]> Date: Tue, 24 Jun 2008 13:11:50 +1000 Subject: [PATCH 1/2] size_t is 64 bit on some architectures.
fix debug print statements to use correct printf types for the FCOE
target
Signed-off-by: Ronnie Sahlberg <[EMAIL PROTECTED]>
Signed-off-by: root <[EMAIL PROTECTED]>
---
usr/fcoe/fcs_state.c | 4 ++--
usr/fcoe/openfc_scst.c | 6 +++---
usr/fcoe/sa_state.c | 14 +++++++-------
3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/usr/fcoe/fcs_state.c b/usr/fcoe/fcs_state.c
index a4a065a..288280e 100644
--- a/usr/fcoe/fcs_state.c
+++ b/usr/fcoe/fcs_state.c
@@ -107,11 +107,11 @@ struct fcs_state *fcs_create(struct fcs_create_args *ap)
outer_port = ap->fca_port;
mfs = fc_port_get_max_frame_size(outer_port);
if (mfs < FC_MIN_MAX_PAYLOAD) {
- eprintf("port max frame size only %d (0x%x) bytes - "
+ eprintf("port max frame size only %zu (0x%zx) bytes - "
"setting to %d", mfs, mfs, FC_MIN_MAX_PAYLOAD);
mfs = 1024;
} else if (mfs > FC_MAX_PAYLOAD + sizeof(struct fc_frame_header)) {
- eprintf("port max frame size too large: %d (0x%x) bytes\n",
+ eprintf("port max frame size too large: %zu (0x%zx) bytes\n",
mfs, mfs);
mfs = FC_MAX_PAYLOAD + sizeof(struct fc_frame_header);
}
diff --git a/usr/fcoe/openfc_scst.c b/usr/fcoe/openfc_scst.c
index 2cf0cdd..f24fc28 100644
--- a/usr/fcoe/openfc_scst.c
+++ b/usr/fcoe/openfc_scst.c
@@ -214,7 +214,7 @@ openfc_scsi_send_data(struct fc_scsi_pkt *fsp,
struct fc_seq *sp)
len = scsi_get_in_length(&fsp->scmd) - scsi_get_in_resid(&fsp->scmd);
- dprintf("%p %d %d\n", fsp, data_len, scsi_get_in_resid(&fsp->scmd));
+ dprintf("%p %zu %d\n", fsp, data_len, scsi_get_in_resid(&fsp->scmd));
len = min(data_len, len);
if (offset != fsp->xfer_len) {
@@ -242,7 +242,7 @@ openfc_scsi_send_data(struct fc_scsi_pkt *fsp,
struct fc_seq *sp)
fc_frame_set_offset(fp, buf_offset);
}
- dprintf("%d %d %d\n", tlen, remaining, buf_offset);
+ dprintf("%zu %zu %zu\n", tlen, remaining, buf_offset);
page_addr = (char *)scsi_get_in_buffer(&fsp->scmd) +
buf_offset;
memcpy(data, (char *) page_addr, tlen);
@@ -260,7 +260,7 @@ openfc_scsi_send_data(struct fc_scsi_pkt *fsp,
struct fc_seq *sp)
continue;
}
- dprintf("%d %d %d\n", tlen, remaining, error);
+ dprintf("%zu %zu %d\n", tlen, remaining, error);
fp = NULL;
if (error) {
/*
diff --git a/usr/fcoe/sa_state.c b/usr/fcoe/sa_state.c
index 95dbe03..ad7ef98 100644
--- a/usr/fcoe/sa_state.c
+++ b/usr/fcoe/sa_state.c
@@ -116,7 +116,7 @@ struct sa_state_table *sa_state_table_alloc(const
char *name,
case SST_STATE:
if (dp->sd_in == 0) {
eprintf("state table %s has invalid state %d "
- "at STATE entry %d",
+ "at STATE entry %ld",
name, dp->sd_in, dp - state_desc);
error++;
}
@@ -127,7 +127,7 @@ struct sa_state_table *sa_state_table_alloc(const
char *name,
case SST_FROM:
if (dp->sd_in == 0) {
eprintf("state table %s has invalid state %d "
- "at FROM entry %d",
+ "at FROM entry %ld",
name, dp->sd_in, dp - state_desc);
error++;
}
@@ -136,7 +136,7 @@ struct sa_state_table *sa_state_table_alloc(const
char *name,
case SST_EVENT:
if (dp->sd_in == 0) {
eprintf("state table %s has invalid event %d "
- "at EVENT entry %d",
+ "at EVENT entry %ld",
name, dp->sd_in, dp - state_desc);
error++;
}
@@ -146,7 +146,7 @@ struct sa_state_table *sa_state_table_alloc(const
char *name,
case SST_HANDLER:
if (dp->sd_ptr == NULL) {
eprintf("state table %s has invalid hander %d "
- "at HANDLER entry %d",
+ "at HANDLER entry %ld",
name, dp->sd_in, dp - state_desc);
error++;
}
@@ -156,19 +156,19 @@ struct sa_state_table
*sa_state_table_alloc(const char *name,
case SST_NEXT:
if (cur_state == 0) {
eprintf("state table %s has no current state "
- "for NEXT entry %d",
+ "for NEXT entry %ld",
name, dp - state_desc);
error++;
}
if (dp->sd_in >= event_limit) {
eprintf("state table %s has event %d "
- "out of range at NEXT entry %d",
+ "out of range at NEXT entry %ld",
name, dp->sd_in, dp - state_desc);
error++;
}
if (dp->sd_next == 0 || dp->sd_next >= state_limit) {
eprintf("state table %s has state %d "
- "out of range at NEXT entry %d",
+ "out of range at NEXT entry %ld",
name, dp->sd_next, dp - state_desc);
error++;
}
--
1.5.4.3
0001-size_t-is-64-bit-on-some-architectures.patch.gz
Description: GNU Zip compressed data
_______________________________________________ Stgt-devel mailing list [email protected] https://lists.berlios.de/mailman/listinfo/stgt-devel
