Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/libgfxinit/+/35869 )
Change subject: dp_info: read eDP 1.4+ DPCD link rates ......................................................................
Patch Set 1:
(1 comment)
It looks rather well for being written by somebody not familiar with Ada :)
I might have time to look more into it on the weekend (unless you beat me to it). I left an idea for the loop. Apart from that, I guess all that's left is to turn it into SPARK code.
https://review.coreboot.org/c/libgfxinit/+/35869/1/common/hw-gfx-dp_info.adb File common/hw-gfx-dp_info.adb:
https://review.coreboot.org/c/libgfxinit/+/35869/1/common/hw-gfx-dp_info.adb... PS1, Line 142: end if;
I couldn't find a good way to step by 2 in loops.. […]
Something like this might do:
Max_Rate := Word32'First; for I in 0 .. 7 loop declare Rate : constant Word32 := Read_LE16 (Data, I * 2); begin exit when Rate = 0; -- prematurely exit the loop if Rate > Max_Rate then Max_Rate = Rate; end if; end; end loop;