mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2026-01-28 01:47:18 +01:00
Fix static code analysis
This commit is contained in:
parent
8a3086c24e
commit
41e3558242
8 changed files with 11 additions and 11 deletions
|
|
@ -15,8 +15,8 @@ include:
|
|||
- if: $CI_COMMIT_BRANCH == "devel"
|
||||
|
||||
stages:
|
||||
- unit_test
|
||||
- static_code_analysis
|
||||
- unit_test
|
||||
- functional_test
|
||||
- deploy
|
||||
|
||||
|
|
|
|||
|
|
@ -31,11 +31,11 @@ struct async_request_context {
|
|||
struct ubus_event_handler linker_handler;
|
||||
struct list_head linker_list;
|
||||
struct blob_buf tmp_bb;
|
||||
char requested_path[MAX_PATH_LENGTH];
|
||||
char ubus_method[32];
|
||||
bool service_list_processed;
|
||||
bool path_matched;
|
||||
int pending_requests;
|
||||
char requested_path[MAX_PATH_LENGTH];
|
||||
char ubus_method[32];
|
||||
};
|
||||
|
||||
struct ubus_request_tracker {
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@
|
|||
#define BBFDMD_SERVICE_H
|
||||
|
||||
typedef struct {
|
||||
enum bbfdmd_type_enum protocol;
|
||||
char parent_path[MAX_PATH_LENGTH - 256];
|
||||
char object_name[256];
|
||||
enum bbfdmd_type_enum protocol;
|
||||
} service_object_t;
|
||||
|
||||
typedef struct service_entry {
|
||||
|
|
|
|||
|
|
@ -197,8 +197,6 @@ struct dmctx {
|
|||
char *addobj_instance;
|
||||
char *linker;
|
||||
char *linker_param;
|
||||
char *inst_buf[16];
|
||||
char fault_msg[256];
|
||||
|
||||
struct blob_buf bb;
|
||||
|
||||
|
|
@ -208,6 +206,9 @@ struct dmctx {
|
|||
struct uci_context *varstate_uci_ctx;
|
||||
struct ubus_context *ubus_ctx;
|
||||
struct list_head *memhead;
|
||||
|
||||
char *inst_buf[16];
|
||||
char fault_msg[256];
|
||||
};
|
||||
|
||||
typedef struct dmnode {
|
||||
|
|
|
|||
|
|
@ -1269,7 +1269,7 @@ int dm_entry_get_name(struct dmctx *ctx)
|
|||
ctx->checkleaf = plugin_leaf_nextlevel_match;
|
||||
ctx->method_obj = mobj_get_name;
|
||||
ctx->method_param = mparam_get_name;
|
||||
ctx->in_param = "Device";
|
||||
ctx->in_param = dmstrdup("Device");
|
||||
node.matched = 1;
|
||||
findparam_check = 1;
|
||||
} else if (*(ctx->in_param + len - 1) == '.') {
|
||||
|
|
|
|||
|
|
@ -368,7 +368,7 @@ int dmubus_call_blob_set(const char *obj, const char *method, json_object *value
|
|||
static int dmubus_call_blob_msg_internal(const char *obj, const char *method, struct blob_buf *data, int timeout, json_object **resp)
|
||||
{
|
||||
uint32_t id = 0;
|
||||
int rc = -1;
|
||||
int rc;
|
||||
|
||||
json_res = NULL;
|
||||
|
||||
|
|
@ -511,8 +511,8 @@ int dmubus_call(const char *obj, const char *method, struct ubus_arg u_args[], i
|
|||
|
||||
int dmubus_call_blocking(const char *obj, const char *method, struct ubus_arg u_args[], int u_args_size, json_object **req_res)
|
||||
{
|
||||
int rc = 0;
|
||||
struct blob_buf bmsg;
|
||||
int rc;
|
||||
|
||||
memset(&bmsg, 0, sizeof(struct blob_buf));
|
||||
prepare_blob_message(&bmsg, u_args, u_args_size);
|
||||
|
|
|
|||
|
|
@ -401,7 +401,6 @@ int bbfdm_set_handler(struct ubus_context *ctx, struct ubus_object *obj,
|
|||
if (list_empty(&pv_list)) {
|
||||
BBF_ERR("Fault in fill pvlist set path |%s| : |list is empty|", data.bbf_ctx.in_param);
|
||||
fill_err_code_array(&data, USP_FAULT_INTERNAL_ERROR);
|
||||
fault = USP_FAULT_INTERNAL_ERROR;
|
||||
goto end;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,11 +64,11 @@ blob__table:
|
|||
|
||||
struct blob_attr *attr;
|
||||
struct blobmsg_hdr *hdr;
|
||||
char path[MAX_DM_PATH], value[MAX_DM_VALUE];
|
||||
|
||||
size_t tlen = (size_t)blobmsg_data_len(blob_table);
|
||||
|
||||
__blob_for_each_attr(attr, blobmsg_data(blob_table), tlen) {
|
||||
char path[MAX_DM_PATH] = {0}, value[MAX_DM_VALUE] = {0};
|
||||
hdr = blob_data(attr);
|
||||
|
||||
switch (blob_id(attr)) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue