From e9ae605ac82bacca98a1a0cdb593afd55e7f3734 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Mon, 18 Mar 2024 08:04:27 +0100 Subject: [PATCH] mgmt: hawkbit: remove hb_context.status_buffer_size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ß (cherry picked from commit 1bea938c9f8c02190daa582144a3cff65e1a12f4) --- subsys/mgmt/hawkbit/hawkbit.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/subsys/mgmt/hawkbit/hawkbit.c b/subsys/mgmt/hawkbit/hawkbit.c index cf16a12bafa1b9..2c003055565b48 100644 --- a/subsys/mgmt/hawkbit/hawkbit.c +++ b/subsys/mgmt/hawkbit/hawkbit.c @@ -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; @@ -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; @@ -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; @@ -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;