Could be just use this line instead? return param_set_uint_minmax(val, kp, UIC_CMD_TIMEOUT_DEFAULT, UIC_CMD_TIMEOUT_MAX); It should be more simple.