Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32874 )
Change subject: fit: Check all compat strings for highest match ......................................................................
Patch Set 5:
(1 comment)
https://review.coreboot.org/#/c/32874/5/src/lib/fit.c File src/lib/fit.c:
https://review.coreboot.org/#/c/32874/5/src/lib/fit.c@461 PS5, Line 461: if (pos >= 0) {
should we compare pos with config->compat_pos? how do we make sure the pos after look is the highest […]
'pos' isn't actually used for ranking, it's literally just the index of the selected substring in the FDT property (used only to print the "(match)" behind the selected string in line 554). compat_rank is the only thing used for ranking.
This code is essentially finding the highest-ranked match by matching strings in order of rank (implicitly, because compat_strings is ordered lowest to highest rank), so that by the time the loop is done it will reflect the highest one.