Commit a28b7ecd authored by Lucas Russo's avatar Lucas Russo

various: fix unsafe sign-compare variables

parent 798c5a9a
...@@ -311,8 +311,8 @@ static int _thsafe_zmq_server_read_block (void *owner, void *args, void *ret) ...@@ -311,8 +311,8 @@ static int _thsafe_zmq_server_read_block (void *owner, void *args, void *ret)
uint64_t offset = *(uint64_t *) THSAFE_MSG_ZMQ_FIRST_ARG(args); uint64_t offset = *(uint64_t *) THSAFE_MSG_ZMQ_FIRST_ARG(args);
size_t read_bsize = *(size_t *) THSAFE_MSG_ZMQ_NEXT_ARG(args); size_t read_bsize = *(size_t *) THSAFE_MSG_ZMQ_NEXT_ARG(args);
DBE_DEBUG (DBG_MSG | DBG_LVL_TRACE, "[smio_thsafe_server:zmq] Offset = %lu, " DBE_DEBUG (DBG_MSG | DBG_LVL_TRACE, "[smio_thsafe_server:zmq] Offset = %"PRIu64", "
"size = %ld\n", offset, read_bsize); "size = %zd\n", offset, read_bsize);
/* Call llio to perform the actual operation */ /* Call llio to perform the actual operation */
int32_t llio_ret = llio_read_block (llio, offset, read_bsize, int32_t llio_ret = llio_read_block (llio, offset, read_bsize,
(uint32_t *) ret); (uint32_t *) ret);
......
...@@ -167,7 +167,7 @@ static ssize_t _smch_24aa64_write_generic (smch_24aa64_t *self, uint16_t addr, ...@@ -167,7 +167,7 @@ static ssize_t _smch_24aa64_write_generic (smch_24aa64_t *self, uint16_t addr,
(uint32_t *) &__data, flags); (uint32_t *) &__data, flags);
/* Check if we have written everything */ /* Check if we have written everything */
ASSERT_TEST(smpr_err == trans_size/SMPR_BYTE_2_BIT /* in bytes */, ASSERT_TEST(smpr_err >= 0 && (size_t)smpr_err == trans_size/SMPR_BYTE_2_BIT /* in bytes */,
"Could not write to SMPR", err_smpr_write, -1); "Could not write to SMPR", err_smpr_write, -1);
/* Return just the number of data bytes written */ /* Return just the number of data bytes written */
...@@ -206,7 +206,7 @@ static ssize_t _smch_24aa64_read_generic (smch_24aa64_t *self, uint16_t addr, ...@@ -206,7 +206,7 @@ static ssize_t _smch_24aa64_read_generic (smch_24aa64_t *self, uint16_t addr,
ssize_t smpr_err = smpr_write_32 (self->i2c, 0, &__data, flags); ssize_t smpr_err = smpr_write_32 (self->i2c, 0, &__data, flags);
/* Check if we have written everything */ /* Check if we have written everything */
ASSERT_TEST(smpr_err == trans_size/SMPR_BYTE_2_BIT /* in bytes */, ASSERT_TEST(smpr_err >= 0 && (size_t) smpr_err == trans_size/SMPR_BYTE_2_BIT /* in bytes */,
"Could not write to SMPR", err_smpr_write, -1); "Could not write to SMPR", err_smpr_write, -1);
/* Now, read the data */ /* Now, read the data */
...@@ -216,7 +216,7 @@ static ssize_t _smch_24aa64_read_generic (smch_24aa64_t *self, uint16_t addr, ...@@ -216,7 +216,7 @@ static ssize_t _smch_24aa64_read_generic (smch_24aa64_t *self, uint16_t addr,
smpr_err = smpr_read_block (self->i2c, 0, size, (uint32_t *) data, flags); smpr_err = smpr_read_block (self->i2c, 0, size, (uint32_t *) data, flags);
/* Check if we have written everything */ /* Check if we have written everything */
ASSERT_TEST(smpr_err == trans_size/SMPR_BYTE_2_BIT /* in bytes */, ASSERT_TEST(smpr_err >= 0 && (size_t)smpr_err == trans_size/SMPR_BYTE_2_BIT /* in bytes */,
"Could not READ from SMPR", err_smpr_read, -1); "Could not READ from SMPR", err_smpr_read, -1);
err = smpr_err; err = smpr_err;
......
...@@ -272,7 +272,7 @@ static ssize_t _smch_si57x_write_generic (smch_si57x_t *self, uint8_t addr, ...@@ -272,7 +272,7 @@ static ssize_t _smch_si57x_write_generic (smch_si57x_t *self, uint8_t addr,
ssize_t smpr_err = smpr_write_block (self->i2c, 0, ARRAY_SIZE(__data), ssize_t smpr_err = smpr_write_block (self->i2c, 0, ARRAY_SIZE(__data),
(uint32_t *) &__data, flags); (uint32_t *) &__data, flags);
ASSERT_TEST(smpr_err == trans_size/SMPR_BYTE_2_BIT /* in bytes*/, ASSERT_TEST(smpr_err >= 0 && (size_t)smpr_err == trans_size/SMPR_BYTE_2_BIT /* in bytes*/,
"Could not write data to I2C", err_exit, -1); "Could not write data to I2C", err_exit, -1);
/* Return just the number of data bytes written */ /* Return just the number of data bytes written */
...@@ -322,7 +322,7 @@ static ssize_t _smch_si57x_read_generic (smch_si57x_t *self, uint8_t addr, uint8 ...@@ -322,7 +322,7 @@ static ssize_t _smch_si57x_read_generic (smch_si57x_t *self, uint8_t addr, uint8
ssize_t smpr_err = smpr_write_32 (self->i2c, 0, (uint32_t *) &addr, flags); ssize_t smpr_err = smpr_write_32 (self->i2c, 0, (uint32_t *) &addr, flags);
/* Check if we have written everything */ /* Check if we have written everything */
ASSERT_TEST(smpr_err == trans_size/SMPR_BYTE_2_BIT /* in bytes */, ASSERT_TEST(smpr_err >= 0 && (size_t)smpr_err == trans_size/SMPR_BYTE_2_BIT /* in bytes */,
"Could not write data to I2C", err_exit, -1); "Could not write data to I2C", err_exit, -1);
/* Now, read the data */ /* Now, read the data */
...@@ -333,7 +333,7 @@ static ssize_t _smch_si57x_read_generic (smch_si57x_t *self, uint8_t addr, uint8 ...@@ -333,7 +333,7 @@ static ssize_t _smch_si57x_read_generic (smch_si57x_t *self, uint8_t addr, uint8
smpr_err = smpr_read_block (self->i2c, 0, size, (uint32_t *) data, smpr_err = smpr_read_block (self->i2c, 0, size, (uint32_t *) data,
flags); flags);
/* Check if we have written everything */ /* Check if we have written everything */
ASSERT_TEST(smpr_err == trans_size/SMPR_BYTE_2_BIT /* in bytes */, ASSERT_TEST(smpr_err >= 0 && (size_t)smpr_err == trans_size/SMPR_BYTE_2_BIT /* in bytes */,
"Could not read data from I2C", err_exit, -1); "Could not read data from I2C", err_exit, -1);
err = smpr_err; err = smpr_err;
...@@ -376,7 +376,7 @@ static smch_err_e _smch_si57x_get_divs (smch_si57x_t *self, uint64_t *rfreq, ...@@ -376,7 +376,7 @@ static smch_err_e _smch_si57x_get_divs (smch_si57x_t *self, uint64_t *rfreq,
*rfreq = tmp; *rfreq = tmp;
DBE_DEBUG (DBG_SM_CH | DBG_LVL_INFO, "[sm_ch:si57x_get_divs]\n" DBE_DEBUG (DBG_SM_CH | DBG_LVL_INFO, "[sm_ch:si57x_get_divs]\n"
"\tRFREQ = %lu, HS_DIV = %u, N1 = %u\n", *rfreq, *hs_div, *n1); "\tRFREQ = %"PRIu64", HS_DIV = %u, N1 = %u\n", *rfreq, *hs_div, *n1);
err_exit: err_exit:
return err; return err;
......
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