Commit 1563dbef authored by Lucas Russo's avatar Lucas Russo

src/{sm_io,dev_io}/*: fix wrong error enum usage

parent 110d42da
...@@ -180,9 +180,9 @@ devio_t * devio_new (char *name, uint32_t id, char *endpoint_dev, ...@@ -180,9 +180,9 @@ devio_t * devio_new (char *name, uint32_t id, char *endpoint_dev,
self->disp_table_thsafe_ops = disp_table_new (&devio_disp_table_ops); self->disp_table_thsafe_ops = disp_table_new (&devio_disp_table_ops);
ASSERT_ALLOC(self->disp_table_thsafe_ops, err_disp_table_thsafe_ops_alloc); ASSERT_ALLOC(self->disp_table_thsafe_ops, err_disp_table_thsafe_ops_alloc);
hutils_err_e hutils_err = disp_table_insert_all (self->disp_table_thsafe_ops, disp_table_err_e disp_err = disp_table_insert_all (self->disp_table_thsafe_ops,
self->thsafe_server_ops); self->thsafe_server_ops);
ASSERT_TEST(hutils_err==HUTILS_SUCCESS, "Could not initialize dispatch table", ASSERT_TEST(disp_err==HUTILS_SUCCESS, "Could not initialize dispatch table",
err_disp_table_init); err_disp_table_init);
/* Adjust linger time for our sockets */ /* Adjust linger time for our sockets */
...@@ -675,14 +675,14 @@ static disp_table_err_e _devio_check_msg_args (disp_table_t *disp_table, ...@@ -675,14 +675,14 @@ static disp_table_err_e _devio_check_msg_args (disp_table_t *disp_table,
assert (disp_op); assert (disp_op);
assert (args); assert (args);
devio_err_e err = DEVIO_SUCCESS; disp_table_err_e err = DISP_TABLE_SUCCESS;
/* Check if the message tis the correct one */ /* Check if the message is the correct one */
ASSERT_TEST (msg_guess_type (args) == MSG_THSAFE_ZMQ, "Invalid message tag", ASSERT_TEST (msg_guess_type (args) == MSG_THSAFE_ZMQ, "Invalid message tag",
err_inv_msg, DEVIO_ERR_BAD_MSG); err_inv_msg, DISP_TABLE_ERR_BAD_MSG);
msg_err_e merr = msg_check_gen_zmq_args (disp_op, THSAFE_MSG_ZMQ(args)); msg_err_e merr = msg_check_gen_zmq_args (disp_op, THSAFE_MSG_ZMQ(args));
ASSERT_TEST (merr == MSG_SUCCESS, "Unrecognized message. Message arguments " ASSERT_TEST (merr == MSG_SUCCESS, "Unrecognized message. Message arguments "
"checking failed", err_msg_args_check, DEVIO_ERR_BAD_MSG); "checking failed", err_msg_args_check, DISP_TABLE_ERR_BAD_MSG);
err_msg_args_check: err_msg_args_check:
err_inv_msg: err_inv_msg:
...@@ -707,7 +707,7 @@ static devio_err_e _devio_do_smio_op (devio_t *self, void *msg) ...@@ -707,7 +707,7 @@ static devio_err_e _devio_do_smio_op (devio_t *self, void *msg)
disp_table_t *disp_table = self->disp_table_thsafe_ops; disp_table_t *disp_table = self->disp_table_thsafe_ops;
msg_err_e merr = msg_handle_sock_request (self, msg, disp_table); msg_err_e merr = msg_handle_sock_request (self, msg, disp_table);
ASSERT_TEST (merr == MSG_SUCCESS, "Error handling request", err_hand_req, ASSERT_TEST (merr == MSG_SUCCESS, "Error handling request", err_hand_req,
SMIO_ERR_MSG_NOT_SUPP /* returning a more meaningful error? */); DEVIO_ERR_SMIO_DO_OP /* returning a more meaningful error? */);
err_hand_req: err_hand_req:
return err; return err;
......
...@@ -103,7 +103,7 @@ smch_err_e smch_pca9547_read_8 (smch_pca9547_t *self, uint8_t *data) ...@@ -103,7 +103,7 @@ smch_err_e smch_pca9547_read_8 (smch_pca9547_t *self, uint8_t *data)
static smch_err_e _smch_pca9547_write_8 (smch_pca9547_t *self, const uint8_t *data) static smch_err_e _smch_pca9547_write_8 (smch_pca9547_t *self, const uint8_t *data)
{ {
smpr_err_e err = SMPR_SUCCESS; smch_err_e err = SMCH_SUCCESS;
uint32_t trans_size = PCA9547_DATA_TRANS_SIZE; uint32_t trans_size = PCA9547_DATA_TRANS_SIZE;
uint32_t flags = SMPR_PROTO_I2C_TRANS_SIZE_FLAGS_W(trans_size) /* in bits */ | uint32_t flags = SMPR_PROTO_I2C_TRANS_SIZE_FLAGS_W(trans_size) /* in bits */ |
SMPR_PROTO_I2C_ADDR_FLAGS_W(self->addr); SMPR_PROTO_I2C_ADDR_FLAGS_W(self->addr);
...@@ -118,7 +118,7 @@ static smch_err_e _smch_pca9547_write_8 (smch_pca9547_t *self, const uint8_t *da ...@@ -118,7 +118,7 @@ static smch_err_e _smch_pca9547_write_8 (smch_pca9547_t *self, const uint8_t *da
ssize_t smpr_err = smpr_write_32 (self->i2c, 0, (uint32_t *) data, flags); ssize_t smpr_err = smpr_write_32 (self->i2c, 0, (uint32_t *) data, flags);
ASSERT_TEST(smpr_err == PCA9547_DATA_TRANS_SIZE/SMPR_BYTE_2_BIT /* in bytes*/, ASSERT_TEST(smpr_err == PCA9547_DATA_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, SMCH_ERR_RW_SMPR);
err_exit: err_exit:
return err; return err;
...@@ -126,7 +126,7 @@ err_exit: ...@@ -126,7 +126,7 @@ err_exit:
static smch_err_e _smch_pca9547_read_8 (smch_pca9547_t *self, uint8_t *data) static smch_err_e _smch_pca9547_read_8 (smch_pca9547_t *self, uint8_t *data)
{ {
smpr_err_e err = SMPR_SUCCESS; smch_err_e err = SMCH_SUCCESS;
uint32_t trans_size = PCA9547_DATA_TRANS_SIZE; uint32_t trans_size = PCA9547_DATA_TRANS_SIZE;
uint32_t flags = SMPR_PROTO_I2C_TRANS_SIZE_FLAGS_W(trans_size) /* in bits */ | uint32_t flags = SMPR_PROTO_I2C_TRANS_SIZE_FLAGS_W(trans_size) /* in bits */ |
SMPR_PROTO_I2C_ADDR_FLAGS_W(self->addr); SMPR_PROTO_I2C_ADDR_FLAGS_W(self->addr);
...@@ -139,7 +139,7 @@ static smch_err_e _smch_pca9547_read_8 (smch_pca9547_t *self, uint8_t *data) ...@@ -139,7 +139,7 @@ static smch_err_e _smch_pca9547_read_8 (smch_pca9547_t *self, uint8_t *data)
ssize_t smpr_err = smpr_read_32 (self->i2c, 0, (uint32_t *) data, flags); ssize_t smpr_err = smpr_read_32 (self->i2c, 0, (uint32_t *) data, flags);
ASSERT_TEST(smpr_err == PCA9547_DATA_TRANS_SIZE/SMPR_BYTE_2_BIT /* in bytes*/, ASSERT_TEST(smpr_err == PCA9547_DATA_TRANS_SIZE/SMPR_BYTE_2_BIT /* in bytes*/,
"Could not read data to I2C", err_exit, -1); "Could not read data to I2C", err_exit, SMCH_ERR_RW_SMPR);
DBE_DEBUG (DBG_SM_CH | DBG_LVL_TRACE, "[sm_ch:pca9547_read_8] data = 0x%02X\n", DBE_DEBUG (DBG_SM_CH | DBG_LVL_TRACE, "[sm_ch:pca9547_read_8] data = 0x%02X\n",
*data); *data);
......
...@@ -255,14 +255,14 @@ static disp_table_err_e _smio_check_msg_args (disp_table_t *disp_table, ...@@ -255,14 +255,14 @@ static disp_table_err_e _smio_check_msg_args (disp_table_t *disp_table,
assert (disp_op); assert (disp_op);
assert (args); assert (args);
smio_err_e err = SMIO_SUCCESS; disp_table_err_e err = DISP_TABLE_SUCCESS;
/* Check if the message tis the correct one */ /* Check if the message tis the correct one */
ASSERT_TEST (msg_guess_type (args) == MSG_EXP_ZMQ, "Invalid message tag", ASSERT_TEST (msg_guess_type (args) == MSG_EXP_ZMQ, "Invalid message tag",
err_inv_msg, SMIO_ERR_MSG_NOT_SUPP); err_inv_msg, DISP_TABLE_ERR_BAD_MSG);
msg_err_e merr = msg_check_gen_zmq_args (disp_op, EXP_MSG_ZMQ(args)); msg_err_e merr = msg_check_gen_zmq_args (disp_op, EXP_MSG_ZMQ(args));
ASSERT_TEST (merr == MSG_SUCCESS, "Unrecognized message. Message arguments " ASSERT_TEST (merr == MSG_SUCCESS, "Unrecognized message. Message arguments "
"checking failed", err_msg_args_check, SMIO_ERR_MSG_NOT_SUPP); "checking failed", err_msg_args_check, DISP_TABLE_ERR_BAD_MSG);
err_msg_args_check: err_msg_args_check:
err_inv_msg: err_inv_msg:
...@@ -315,8 +315,8 @@ smio_err_e smio_export_ops (smio_t *self, const disp_op_t** smio_exp_ops) ...@@ -315,8 +315,8 @@ smio_err_e smio_export_ops (smio_t *self, const disp_op_t** smio_exp_ops)
smio_err_e err = SMIO_SUCCESS; smio_err_e err = SMIO_SUCCESS;
hutils_err_e herr = disp_table_insert_all (self->exp_ops_dtable, smio_exp_ops); disp_table_err_e derr = disp_table_insert_all (self->exp_ops_dtable, smio_exp_ops);
ASSERT_TEST(herr == HUTILS_SUCCESS, "smio_export_ops: Could not export" ASSERT_TEST(derr == HUTILS_SUCCESS, "smio_export_ops: Could not export"
" SMIO ops", err_export_op, SMIO_ERR_EXPORT_OP); " SMIO ops", err_export_op, SMIO_ERR_EXPORT_OP);
err = SMIO_FUNC_OPS_NOFAIL_WRAPPER(err, export_ops, smio_exp_ops); err = SMIO_FUNC_OPS_NOFAIL_WRAPPER(err, export_ops, smio_exp_ops);
...@@ -334,9 +334,9 @@ smio_err_e smio_unexport_ops (smio_t *self) ...@@ -334,9 +334,9 @@ smio_err_e smio_unexport_ops (smio_t *self)
assert (self); assert (self);
smio_err_e err = SMIO_SUCCESS; smio_err_e err = SMIO_SUCCESS;
hutils_err_e herr = disp_table_remove_all (self->exp_ops_dtable); disp_table_err_e derr = disp_table_remove_all (self->exp_ops_dtable);
ASSERT_TEST(herr == HUTILS_SUCCESS, "smio_export_ops: Could not unexport SMIO ops", ASSERT_TEST(derr == HUTILS_SUCCESS, "smio_export_ops: Could not unexport SMIO ops",
err_unexport_op, SMIO_ERR_EXPORT_OP); err_unexport_op, SMIO_ERR_EXPORT_OP);
err = SMIO_FUNC_OPS_NOFAIL_WRAPPER(err, unexport_ops); err = SMIO_FUNC_OPS_NOFAIL_WRAPPER(err, unexport_ops);
...@@ -358,10 +358,10 @@ smio_err_e smio_init_exp_ops (smio_t *self, disp_op_t** smio_exp_ops, ...@@ -358,10 +358,10 @@ smio_err_e smio_init_exp_ops (smio_t *self, disp_op_t** smio_exp_ops,
{ {
assert(self); assert(self);
hutils_err_e herr = HUTILS_SUCCESS; disp_table_err_e derr = DISP_TABLE_SUCCESS;
smio_err_e err = SMIO_SUCCESS; smio_err_e err = SMIO_SUCCESS;
herr = disp_table_fill_desc (self->exp_ops_dtable, smio_exp_ops, func_fps); derr = disp_table_fill_desc (self->exp_ops_dtable, smio_exp_ops, func_fps);
ASSERT_TEST(herr == HUTILS_SUCCESS, "smio_export_ops: Could not export" ASSERT_TEST(derr == HUTILS_SUCCESS, "smio_export_ops: Could not export"
" fill SMIO ops description", err_fill_desc_ops, SMIO_ERR_EXPORT_OP); " fill SMIO ops description", err_fill_desc_ops, SMIO_ERR_EXPORT_OP);
err_fill_desc_ops: err_fill_desc_ops:
......
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