Skip to content

Commit cda52f8

Browse files
de-nordicMaureenHelm
authored andcommitted
mgmt/MCUmgr/img: Fix img_mgmt_get_unused_slot_area_id checks
Remove image == -1 check that can not happen anymore. Signed-off-by: Dominik Ermel <[email protected]>
1 parent 4d038fb commit cda52f8

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

subsys/mgmt/mcumgr/grp/img_mgmt/src/zephyr_img_mgmt.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,14 +226,11 @@ static int img_mgmt_get_unused_slot_area_id(int slot)
226226
#endif
227227
}
228228
#elif CONFIG_MCUMGR_GRP_IMG_UPDATABLE_IMAGE_NUMBER >= 2
229-
static int img_mgmt_get_unused_slot_area_id(int image)
229+
static int img_mgmt_get_unused_slot_area_id(unsigned int image)
230230
{
231231
int area_id = -1;
232232
int slot = 0;
233233

234-
if (image == -1) {
235-
image = 0;
236-
}
237234
slot = img_mgmt_get_opposite_slot(img_mgmt_active_slot(image));
238235

239236
if (!img_mgmt_slot_in_use(slot)) {

0 commit comments

Comments
 (0)