summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2017-12-14 17:00:29 +0100
committerSylwester Nawrocki <s.nawrocki@samsung.com>2017-12-15 10:55:33 +0100
commit187baf018f090b3ddcbf6f1995600422ce795256 (patch)
tree54ebb5ab082833809aeefacf2cf3111ba88aad8b
parent46421932407de25d0392fee5d59c7c0e62899b30 (diff)
downloadgst-plugins-camera-n4-187baf018f090b3ddcbf6f1995600422ce795256.tar.gz
gst-plugins-camera-n4-187baf018f090b3ddcbf6f1995600422ce795256.tar.bz2
gst-plugins-camera-n4-187baf018f090b3ddcbf6f1995600422ce795256.zip
Remove unneeded local 'err' variables
Change-Id: Ibe91cc97d492ba5b6372a194fce39a6293111309 Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
-rw-r--r--camerasrc/src/camerasrc.c57
1 files changed, 20 insertions, 37 deletions
diff --git a/camerasrc/src/camerasrc.c b/camerasrc/src/camerasrc.c
index 308d1d3..40d7b04 100644
--- a/camerasrc/src/camerasrc.c
+++ b/camerasrc/src/camerasrc.c
@@ -270,7 +270,6 @@ static int _camerasrc_get_device_type_string(camerasrc_handle_t *p, int fd, int
static int _camerasrc_set_cmd(camsrc_handle_t handle, _camsrc_cmd_t cmd, void *value)
{
camerasrc_handle_t *p = NULL;
- int err = CAMERASRC_ERR_UNKNOWN;
camsrc_info("enter");
@@ -285,15 +284,12 @@ static int _camerasrc_set_cmd(camsrc_handle_t handle, _camsrc_cmd_t cmd, void *v
return CAMERASRC_ERR_DEVICE_NOT_SUPPORT;
}
- err = dev_misc_func->_set_cmd(p, cmd, value);
-
- return err;
+ return dev_misc_func->_set_cmd(p, cmd, value);
}
static int _camerasrc_get_cmd(camsrc_handle_t handle, _camsrc_cmd_t cmd, void *value)
{
camerasrc_handle_t *p = NULL;
- int err = CAMERASRC_ERR_UNKNOWN;
if(handle == NULL) {
camsrc_error("handle is null");
@@ -305,9 +301,7 @@ static int _camerasrc_get_cmd(camsrc_handle_t handle, _camsrc_cmd_t cmd, void *v
if(dev_misc_func->_get_cmd == NULL)
return CAMERASRC_ERR_DEVICE_NOT_SUPPORT;
- err = dev_misc_func->_get_cmd(p, cmd, value);
-
- return err;
+ return dev_misc_func->_get_cmd(p, cmd, value);
}
@@ -1809,8 +1803,8 @@ int camerasrc_create(camsrc_handle_t *phandle)
p->cur_af_range = CAMERASRC_AF_RANGE_NORMAL;
*phandle = (camsrc_handle_t)p;
- err = CAMERASRC_SUCCESS;
- return err;
+
+ return CAMERASRC_SUCCESS;
}
@@ -1865,8 +1859,8 @@ int camerasrc_destroy(camsrc_handle_t handle)
free((void*)p);
handle = NULL;
- err = CAMERASRC_SUCCESS;
- return err;
+
+ return CAMERASRC_SUCCESS;
}
@@ -1923,7 +1917,6 @@ int camerasrc_realize(camsrc_handle_t handle, camerasrc_dev_id_t camera_id, came
int camerasrc_unrealize(camsrc_handle_t handle)
{
camerasrc_handle_t* p = NULL;
- int err = CAMERASRC_ERR_UNKNOWN;
camsrc_info("enter");
@@ -1947,15 +1940,14 @@ int camerasrc_unrealize(camsrc_handle_t handle)
CAMERASRC_SET_STATE(p, CAMERASRC_STATE_UNREALIZED);
CAMERASRC_SET_PHASE(p, CAMERASRC_PHASE_NON_RUNNING);
camsrc_info("Transit to non-running phase");
- err = CAMERASRC_SUCCESS;
- return err;
+
+ return CAMERASRC_SUCCESS;
}
int camerasrc_start(camsrc_handle_t handle)
{
camerasrc_handle_t* p = NULL;
- int err = CAMERASRC_ERR_UNKNOWN;
camsrc_info("enter");
@@ -1978,8 +1970,8 @@ int camerasrc_start(camsrc_handle_t handle)
CAMERASRC_SET_PHASE(p, CAMERASRC_PHASE_RUNNING);
camsrc_info("Transit to running phase");
- err = CAMERASRC_SUCCESS;
- return err;
+
+ return CAMERASRC_SUCCESS;
}
@@ -3427,7 +3419,6 @@ int camerasrc_wait_frame_available(camsrc_handle_t handle, int timeout)
int camerasrc_queue_buffer(camsrc_handle_t handle, int buf_index)
{
camerasrc_handle_t *p = NULL;
- int err = CAMERASRC_ERR_UNKNOWN;
if (handle == NULL) {
camsrc_error("handle is null");
@@ -3443,16 +3434,13 @@ int camerasrc_queue_buffer(camsrc_handle_t handle, int buf_index)
camsrc_warning("Invalid state transition");
}
- err = _camerasrc_queue_buffer(p, buf_index);
-
- return err;
+ return _camerasrc_queue_buffer(p, buf_index);
}
int camerasrc_dequeue_buffer(camsrc_handle_t handle, int *buf_index, camerasrc_buffer_t *buffer, camerasrc_buffer_t *thm_buffer)
{
camerasrc_handle_t *p = NULL;
- int err = CAMERASRC_ERR_UNKNOWN;
if (handle == NULL) {
camsrc_error("handle is null");
@@ -3468,9 +3456,7 @@ int camerasrc_dequeue_buffer(camsrc_handle_t handle, int *buf_index, camerasrc_b
camsrc_warning("Invalid state transition");
}
- err = _camerasrc_dequeue_buffer(p, buf_index, buffer, thm_buffer);
-
- return err;
+ return _camerasrc_dequeue_buffer(p, buf_index, buffer, thm_buffer);
}
@@ -4214,7 +4200,6 @@ int camerasrc_tbm_alloc_buffer(camsrc_handle_t handle, int size, tbm_bo *bo, int
/* For Query functionalities */
int camerasrc_read_basic_dev_info(camerasrc_dev_id_t dev_id, camerasrc_caps_info_t* caps_info)
{
- int err = CAMERASRC_ERR_UNKNOWN;
int nread = 0;
char* store_path = NULL;
FILE *fp = NULL;
@@ -4242,15 +4227,14 @@ int camerasrc_read_basic_dev_info(camerasrc_dev_id_t dev_id, camerasrc_caps_info
else
return CAMERASRC_ERR_ALLOCATION;
- err = CAMERASRC_SUCCESS;
camsrc_info("leave");
- return err;
+
+ return CAMERASRC_SUCCESS;
}
int camerasrc_read_misc_dev_info(camerasrc_dev_id_t dev_id, camerasrc_ctrl_list_info_t* ctrl_info)
{
- int err = CAMERASRC_ERR_UNKNOWN;
camsrc_info("enter");
int nread = 0;
@@ -4278,21 +4262,20 @@ int camerasrc_read_misc_dev_info(camerasrc_dev_id_t dev_id, camerasrc_ctrl_list_
else
return CAMERASRC_ERR_ALLOCATION;
- err = CAMERASRC_SUCCESS;
camsrc_info("leave");
- return err;
+
+ return CAMERASRC_SUCCESS;
}
int camerasrc_read_extra_dev_info(camerasrc_dev_id_t dev_id, camerasrc_extra_info_t* extra_info)
{
- int err = CAMERASRC_ERR_UNKNOWN;
- camsrc_info("enter");
-
int nread = 0;
FILE *fp = NULL;
char* store_path = NULL;
+ camsrc_info("enter");
+
if(dev_id == CAMERASRC_DEV_ID_PRIMARY)
store_path = CAMERASRC_PRIMARY_EXTRA_INFO_PATH;
else if (dev_id == CAMERASRC_DEV_ID_SECONDARY)
@@ -4314,9 +4297,9 @@ int camerasrc_read_extra_dev_info(camerasrc_dev_id_t dev_id, camerasrc_extra_inf
else
return CAMERASRC_ERR_ALLOCATION;
- err = CAMERASRC_SUCCESS;
camsrc_info("leave");
- return err;
+
+ return CAMERASRC_SUCCESS;
}