We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e04a1a4 commit eb01afbCopy full SHA for eb01afb
drivers/source/SFDP.cpp
@@ -398,8 +398,9 @@ int sfdp_iterate_next_largest_erase_type(uint8_t &bitfield,
398
const sfdp_smptbl_info &smptbl)
399
{
400
uint8_t type_mask = SFDP_ERASE_BITMASK_TYPE4;
401
- int i_ind = 0;
402
int largest_erase_type = 0;
+
403
+ int i_ind;
404
for (i_ind = 3; i_ind >= 0; i_ind--) {
405
if (bitfield & type_mask) {
406
largest_erase_type = i_ind;
@@ -414,7 +415,7 @@ int sfdp_iterate_next_largest_erase_type(uint8_t &bitfield,
414
415
type_mask = type_mask >> 1;
416
}
417
- if (i_ind == 4) {
418
+ if (i_ind == -1) {
419
tr_error("No erase type was found for current region addr");
420
421
return largest_erase_type;
0 commit comments