Commit 798c5a9a authored by Lucas Russo's avatar Lucas Russo

various: fix unportable format specifiers for arch-specific types

The types size_t, ssize_t, uint64_t must have
portable specific types, such as: zu, zd and PRIx64.
parent 648197e0
......@@ -88,8 +88,8 @@ typedef int (*rw_param_format_fp) (uint32_t *param);
\
if (__ret != sizeof(uint32_t)) { \
DBE_DEBUG (DBG_SM_IO | DBG_LVL_ERR, "[sm_io:rw_param:"#module"] " \
"SET_PARAM_" #reg "_" #field ": Number of bytes read (%ld)\n\t" \
"does not match the request (%lu)\n", __ret, sizeof(uint32_t)); \
"SET_PARAM_" #reg "_" #field ": Number of bytes read (%zd)\n\t" \
"does not match the request (%zu)\n", __ret, sizeof(uint32_t)); \
err = RW_READ_EAGAIN; \
} \
\
......@@ -133,8 +133,8 @@ typedef int (*rw_param_format_fp) (uint32_t *param);
\
if (__ret != sizeof(uint32_t)) { \
DBE_DEBUG (DBG_SM_IO | DBG_LVL_ERR, "[sm_io:rw_param:"#module"] " \
"SET_PARAM_" #reg "_" #field ": Number of bytes read (%ld) \n\t" \
"does not match the request (%lu)\n", __ret, sizeof(uint32_t)); \
"SET_PARAM_" #reg "_" #field ": Number of bytes read (%zd) \n\t" \
"does not match the request (%zu)\n", __ret, sizeof(uint32_t)); \
err = RW_WRITE_EAGAIN; \
} \
\
......@@ -159,8 +159,8 @@ typedef int (*rw_param_format_fp) (uint32_t *param);
\
if (__ret != sizeof(uint32_t)) { \
DBE_DEBUG (DBG_SM_IO | DBG_LVL_ERR, "[sm_io:rw_param:"#module"] " \
"SET_PARAM_" #reg "_" #field ": Number of bytes written (%ld)\n\t" \
"does not match the request (%lu)\n", __ret, sizeof(uint32_t)); \
"SET_PARAM_" #reg "_" #field ": Number of bytes written (%zd)\n\t" \
"does not match the request (%zu)\n", __ret, sizeof(uint32_t)); \
err = RW_WRITE_EAGAIN; \
} \
else { \
......
......@@ -424,11 +424,11 @@ static ssize_t _eth_sendall (int fd, uint8_t *buf, size_t len)
size_t bytesleft = len; /* how many we have left to send */
ssize_t n;
DBE_DEBUG (DBG_LL_IO | DBG_LVL_TRACE, "[ll_io_eth] Sending %lu bytes\n", len);
DBE_DEBUG (DBG_LL_IO | DBG_LVL_TRACE, "[ll_io_eth] Sending %zu bytes\n", len);
while (total < len) {
n = send (fd, (char *) buf+total, bytesleft, 0);
DBE_DEBUG (DBG_LL_IO | DBG_LVL_TRACE, "[ll_io_eth] Sent %ld bytes\n", n);
DBE_DEBUG (DBG_LL_IO | DBG_LVL_TRACE, "[ll_io_eth] Sent %zd bytes\n", n);
/* On error, don't try to recover, just inform it to the caller*/
if (n == -1) {
......@@ -448,11 +448,11 @@ static ssize_t _eth_recvall (int fd, uint8_t *buf, size_t len)
size_t bytesleft = len; /* how many we have left to recv */
ssize_t n;
DBE_DEBUG (DBG_LL_IO | DBG_LVL_TRACE, "[ll_io_eth] Receiving %lu bytes\n", len);
DBE_DEBUG (DBG_LL_IO | DBG_LVL_TRACE, "[ll_io_eth] Receiving %zu bytes\n", len);
while (total < len) {
n = recv (fd, (char *) buf+total, bytesleft, 0);
DBE_DEBUG (DBG_LL_IO | DBG_LVL_TRACE, "[ll_io_eth] Received %ld bytes\n", n);
DBE_DEBUG (DBG_LL_IO | DBG_LVL_TRACE, "[ll_io_eth] Received %zd bytes\n", n);
/* On error, don't try to recover, just inform it to the caller*/
if (n == -1) {
......
......@@ -339,7 +339,7 @@ static ssize_t _pcie_rw_32 (llio_t *self, uint64_t offs, uint32_t *data, int rw)
"----------------------------------------------------------\n"
"[ll_io_pcie:_pcie_rw_32] Going to read/write in BAR0\n");
DBE_DEBUG (DBG_LL_IO | DBG_LVL_TRACE,
"[ll_io_pcie:_pcie_rw_32] bar_no = %d, full_offs = %lX\n"
"[ll_io_pcie:_pcie_rw_32] bar_no = %d, full_offs = %"PRIX64"\n"
"-------------------------------------------------------------------------------------\n",
bar_no, full_offs);
BAR0_RW(dev_pcie->bar0, full_offs, data, rw);
......@@ -354,7 +354,7 @@ static ssize_t _pcie_rw_32 (llio_t *self, uint64_t offs, uint32_t *data, int rw)
pg_offs = PCIE_ADDR_SDRAM_PG_OFFS (full_offs);
SET_SDRAM_PG (dev_pcie->bar0, pg_num);
DBE_DEBUG (DBG_LL_IO | DBG_LVL_TRACE,
"[ll_io_pcie:_pcie_rw_32] bar_no = %d, pg_num = %d,\n\tfull_offs = 0x%lx, pg_offs = 0x%lx\n",
"[ll_io_pcie:_pcie_rw_32] bar_no = %d, pg_num = %d,\n\tfull_offs = 0x%"PRIX64", pg_offs = 0x%"PRIX64"\n",
bar_no, pg_num, full_offs, pg_offs);
DBE_DEBUG (DBG_LL_IO | DBG_LVL_TRACE,
"[ll_io_pcie:_pcie_rw_32] full_addr = 0x%p\n"
......@@ -372,7 +372,7 @@ static ssize_t _pcie_rw_32 (llio_t *self, uint64_t offs, uint32_t *data, int rw)
pg_offs = PCIE_ADDR_WB_PG_OFFS (full_offs);
SET_WB_PG (dev_pcie->bar0, pg_num);
DBE_DEBUG (DBG_LL_IO | DBG_LVL_TRACE,
"[ll_io_pcie:_pcie_rw_32] bar_no = %d, pg_num = %d,\n\tfull_offs = 0x%lx, pg_offs = 0x%lx\n",
"[ll_io_pcie:_pcie_rw_32] bar_no = %d, pg_num = %d,\n\tfull_offs = 0x%"PRIX64", pg_offs = 0x%"PRIX64"\n",
bar_no, pg_num, full_offs, pg_offs);
DBE_DEBUG (DBG_LL_IO | DBG_LVL_TRACE,
"[ll_io_pcie:_pcie_rw_32] full_addr = %p\n"
......@@ -411,7 +411,7 @@ static ssize_t _pcie_rw_bar2_block_raw (llio_t *self, uint32_t pg_start, uint64_
DBE_DEBUG (DBG_LL_IO | DBG_LVL_TRACE,
"----------------------------------------------------------\n"
"[ll_io_pcie:_pcie_rw_bar2_block_raw] pg_start = %u, pg_end = %lu...\n",
"[ll_io_pcie:_pcie_rw_bar2_block_raw] pg_start = %u, pg_end = %"PRIu64"...\n",
pg_start, pg_start + (pg_offs+size)/bar_size + 1);
for (unsigned int pg = pg_start;
pg < (pg_start + (pg_offs+size)/bar_size + 1);
......@@ -495,7 +495,7 @@ static ssize_t _pcie_rw_bar4_block_raw (llio_t *self, uint32_t pg_start, uint64_
DBE_DEBUG (DBG_LL_IO | DBG_LVL_TRACE,
"----------------------------------------------------------\n"
"[ll_io_pcie:_pcie_rw_bar4_block_raw] pg_start = %u, pg_end = %lu...\n",
"[ll_io_pcie:_pcie_rw_bar4_block_raw] pg_start = %u, pg_end = %"PRIu64"...\n",
pg_start, pg_start + (pg_offs+size)/bar_size + 1);
for (unsigned int pg = pg_start;
pg < pg_start + (pg_offs+size)/bar_size + 1;
......@@ -590,7 +590,7 @@ static ssize_t _pcie_rw_block (llio_t *self, uint64_t offs, size_t size, uint32_
pg_start = PCIE_ADDR_SDRAM_PG (full_offs);
pg_offs = PCIE_ADDR_SDRAM_PG_OFFS (full_offs);
DBE_DEBUG (DBG_LL_IO | DBG_LVL_TRACE,
"[ll_io_pcie:_pcie_rw_block] bar_no = %d, pg_start = %d,\n\tfull_offs = 0x%lx, pg_offs = 0x%lx\n",
"[ll_io_pcie:_pcie_rw_block] bar_no = %d, pg_start = %d,\n\tfull_offs = 0x%"PRIX64", pg_offs = 0x%"PRIX64"\n",
bar_no, pg_start, full_offs, pg_offs);
DBE_DEBUG (DBG_LL_IO | DBG_LVL_TRACE,
"[ll_io_pcie:_pcie_rw_block] full_addr = 0x%p\n"
......@@ -607,7 +607,7 @@ static ssize_t _pcie_rw_block (llio_t *self, uint64_t offs, size_t size, uint32_
pg_start = PCIE_ADDR_WB_PG (full_offs);
pg_offs = PCIE_ADDR_WB_PG_OFFS (full_offs);
DBE_DEBUG (DBG_LL_IO | DBG_LVL_TRACE,
"[ll_io_pcie:_pcie_rw_block] bar_no = %d, pg_start = %d,\n\tfull_offs = 0x%lx, pg_offs = 0x%lx\n",
"[ll_io_pcie:_pcie_rw_block] bar_no = %d, pg_start = %d,\n\tfull_offs = 0x%"PRIX64", pg_offs = 0x%"PRIX64"\n",
bar_no, pg_start, full_offs, pg_offs);
DBE_DEBUG (DBG_LL_IO | DBG_LVL_TRACE,
"[ll_io_pcie:_pcie_rw_block] full_addr = %p\n"
......
......@@ -443,7 +443,7 @@ static int _acq_get_data_block (void *owner, void *args, void *ret)
ssize_t valid_bytes = smio_thsafe_raw_client_read_block (self, LARGE_MEM_ADDR | addr_i,
reply_size, (uint32_t *) data_block->data);
DBE_DEBUG (DBG_SM_IO | DBG_LVL_TRACE, "[sm_io:acq] get_data_block: "
"%ld bytes read\n", valid_bytes);
"%zd bytes read\n", valid_bytes);
/* Check if we could read successfully */
int retf = 0;
......
......@@ -445,7 +445,7 @@ static int _smpr_proto_bsmp_recv (uint8_t *data, uint32_t *count)
DBE_DEBUG (DBG_LL_IO | DBG_LVL_TRACE, "[sm_pr:bsmp] Receiving %u bytes\n", len);
ssize_t ret = smio_thsafe_client_read_block (bsmp_glue.parent, 0, len,
(uint32_t *) data);
DBE_DEBUG (DBG_LL_IO | DBG_LVL_TRACE, "[sm_pr:bsmp] Received %ld bytes\n", ret);
DBE_DEBUG (DBG_LL_IO | DBG_LVL_TRACE, "[sm_pr:bsmp] Received %zd bytes\n", ret);
if (ret < 0) {
*count = 0;
......@@ -466,7 +466,7 @@ static int _smpr_proto_bsmp_recv (uint8_t *data, uint32_t *count)
"bytes\n", len);
ret = smio_thsafe_client_read_block (bsmp_glue.parent, 0, len,
(uint32_t *)(data + *count));
DBE_DEBUG (DBG_LL_IO | DBG_LVL_TRACE, "[sm_pr:bsmp] Received another %ld "
DBE_DEBUG (DBG_LL_IO | DBG_LVL_TRACE, "[sm_pr:bsmp] Received another %zd "
"bytes\n", ret);
if (ret < 0) {
......
......@@ -487,7 +487,7 @@ static ssize_t _i2c_write_generic (smpr_t *self, uint8_t *data,
if (trans_size != size) {
DBE_DEBUG (DBG_SM_PR | DBG_LVL_WARN,
"[sm_pr:i2c] _i2c_write_generic: Data size differs from Transfer size.\n"
"\tChoosing the smallest value between trans_size (%u) and size (%lu)\n", trans_size, size);
"\tChoosing the smallest value between trans_size (%u) and size (%zu)\n", trans_size, size);
}
/* Choose the smallest one */
......@@ -572,7 +572,7 @@ static ssize_t _i2c_read_generic (smpr_t *self, uint8_t *data,
if (trans_size != size) {
DBE_DEBUG (DBG_SM_PR | DBG_LVL_WARN,
"[sm_pr:i2c] _i2c_read_generic: Data size differs from Transfer size.\n"
"\tChoosing the smallest value between trans_size (%u) and size (%lu)\n", trans_size, size);
"\tChoosing the smallest value between trans_size (%u) and size (%zu)\n", trans_size, size);
}
/* Choose the smallest one */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment