gma display_probing: Let Port_List_Range grow with Active_Port_Type
Beside not having to manually adapt the hardcoded number anymore, this
also ensures that we can't miss to extend the All_Ports array when the
Active_Port_Type grows.
Change-Id: Ic4e86082dff4cc7c7d92ed183825f46640614441
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/libgfxinit/+/500
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: Ada SPARK <gnatbot@sourcearcade.org>
diff --git a/common/hw-gfx-gma-display_probing.ads b/common/hw-gfx-gma-display_probing.ads
index ea13329..62d3a68 100644
--- a/common/hw-gfx-gma-display_probing.ads
+++ b/common/hw-gfx-gma-display_probing.ads
@@ -17,7 +17,8 @@
package HW.GFX.GMA.Display_Probing
is
- type Port_List_Range is range 0 .. 20;
+ type Port_List_Range is range
+ 1 .. Active_Port_Type'Pos (Active_Port_Type'Last);
type Port_List is array (Port_List_Range) of Port_Type;
All_Ports : constant Port_List :=
(DP1, DP2, DP3, DP_TC1, DP_TC2, DP_TC3, DP_TC4,