Skip to content

Commit

Permalink
mgmt: hawkbit: remove hb_context.status_buffer_size
Browse files Browse the repository at this point in the history
remove hb_context.status_buffer_size and replace it with
sizeof(hb_context.status_buffer), because hb_context.status_buffer_size
is never set.

Signed-off-by: Fin Maaß <[email protected]>
(cherry picked from commit 1bea938)
  • Loading branch information
maass-hamburg authored and github-actions[bot] committed Mar 24, 2024
1 parent e486e6c commit e9ae605
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions subsys/mgmt/hawkbit/hawkbit.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ static struct hawkbit_context {
uint8_t *response_data;
int32_t json_action_id;
size_t url_buffer_size;
size_t status_buffer_size;
struct hawkbit_download dl;
struct http_request http_req;
struct flash_img_context flash_ctx;
Expand Down Expand Up @@ -845,7 +844,7 @@ static bool send_request(enum http_method method, enum hawkbit_http_request type

ret = json_obj_encode_buf(json_cfg_descr, ARRAY_SIZE(json_cfg_descr), &cfg,
hb_context.status_buffer,
hb_context.status_buffer_size - 1);
sizeof(hb_context.status_buffer));
if (ret) {
LOG_ERR("Can't encode the JSON script (HAWKBIT_CONFIG_DEVICE): %d", ret);
return false;
Expand Down Expand Up @@ -875,7 +874,7 @@ static bool send_request(enum http_method method, enum hawkbit_http_request type

ret = json_obj_encode_buf(json_close_descr, ARRAY_SIZE(json_close_descr), &close,
hb_context.status_buffer,
hb_context.status_buffer_size - 1);
sizeof(hb_context.status_buffer));
if (ret) {
LOG_ERR("Can't encode the JSON script (HAWKBIT_CLOSE): %d", ret);
return false;
Expand Down Expand Up @@ -922,7 +921,7 @@ static bool send_request(enum http_method method, enum hawkbit_http_request type

ret = json_obj_encode_buf(json_dep_fbk_descr, ARRAY_SIZE(json_dep_fbk_descr),
&feedback, hb_context.status_buffer,
hb_context.status_buffer_size - 1);
sizeof(hb_context.status_buffer));
if (ret) {
LOG_ERR("Can't encode the JSON script (HAWKBIT_REPORT): %d", ret);
return ret;
Expand Down

0 comments on commit e9ae605

Please sign in to comment.