From c7ed18bbd20e1c1cbb9c753a7908c61dc5a23115 Mon Sep 17 00:00:00 2001 From: Jonathan Aillet Date: Fri, 8 Jun 2018 11:16:48 +0200 Subject: Remove an unnecessary variable Remove an unnecessary variable because it was used to get the result of a function call and to test this result (in a 'if' statment). So, to remove it, function was put directly into the 'if' statment. Change-Id: Ie79caa35b0873c6ec7cfdb19a25a3506c0082e53 Signed-off-by: Jonathan Aillet --- 4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to '4a-hal') diff --git a/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c b/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c index 8de028d..cb91b4e 100644 --- a/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c +++ b/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c @@ -185,7 +185,7 @@ int HalCtlsCreateApi(AFB_ApiT apiHandle, char *path, struct HalMgrData *HalMgrGl int HalCtlsCreateAllApi(AFB_ApiT apiHandle, struct HalMgrData *HalMgrGlobalData) { - int index, err, status = 0; + int index, status = 0; char *dirList, *fileName, *fullPath; char filePath[CONTROL_MAXPATH_LEN]; @@ -215,8 +215,7 @@ int HalCtlsCreateAllApi(AFB_ApiT apiHandle, struct HalMgrData *HalMgrGlobalData) for(index = 0; index < json_object_array_length(configJ); index++) { entryJ = json_object_array_get_idx(configJ, index); - err = wrap_json_unpack(entryJ, "{s:s, s:s !}", "fullpath", &fullPath, "filename", &fileName); - if(err) { + if(wrap_json_unpack(entryJ, "{s:s, s:s !}", "fullpath", &fullPath, "filename", &fileName)) { AFB_ApiError(apiHandle, "%s: HOOPs invalid JSON entry = %s", __func__, json_object_get_string(entryJ)); return -1; } -- cgit 1.2.3-korg