From 2d16d62ddc7d6362433468f3f104ca4b38550b55 Mon Sep 17 00:00:00 2001 From: Tarek BOCHKATI Date: Thu, 13 May 2021 17:44:14 +0100 Subject: [PATCH] flash/stm32l4x: add missing break statement this is not a bug fix, this for loop will issue only one match adding the break will save unnecessary more loops. Change-Id: Ic1484ea8cdea1b284eb570f9e3e7818e07daf5cd Signed-off-by: Tarek BOCHKATI Reviewed-on: http://openocd.zylin.com/6248 Reviewed-by: Oleksij Rempel Tested-by: jenkins --- src/flash/nor/stm32l4x.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/flash/nor/stm32l4x.c b/src/flash/nor/stm32l4x.c index 594bce039..7e1fe7cec 100644 --- a/src/flash/nor/stm32l4x.c +++ b/src/flash/nor/stm32l4x.c @@ -1351,8 +1351,10 @@ static int stm32l4_probe(struct flash_bank *bank) device_id = stm32l4_info->idcode & 0xFFF; for (unsigned int n = 0; n < ARRAY_SIZE(stm32l4_parts); n++) { - if (device_id == stm32l4_parts[n].id) + if (device_id == stm32l4_parts[n].id) { stm32l4_info->part_info = &stm32l4_parts[n]; + break; + } } if (!stm32l4_info->part_info) { -- 2.30.2