Fix "unnecessary with of ancestor [-gnatwr]"
These warnings are a bit overeager as some of them only apply once
unnecessary `use type ...` clauses are adapted. So we do both in
one patch. This partially fixes building with GCC 12.
(cherry picked from commit 066e52eeaa329d782ccee96265a6a351fc395bf1)
Original-Change-Id: Id7e88fe9a3ef7cb10cbc427a052e21f12578a3fd
Original-Signed-off-by: Elyes Haouas <[email protected]>
Original-Signed-off-by: Nico Huber <[email protected]>
Original-Reviewed-on: https://review.coreboot.org/c/libgfxinit/+/67833
Original-Reviewed-by: Angel Pons <[email protected]>
GitOrigin-RevId: 066e52eeaa329d782ccee96265a6a351fc395bf1
Change-Id: I8d5d4f2bd801c77110d98386e1f379471c60c38f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/coreboot/libgfxinit/+/3934373
Commit-Queue: Reka Norman <[email protected]>
Tested-by: CopyBot Service Account <[email protected]>
Reviewed-by: Reka Norman <[email protected]>
diff --git a/common/hw-gfx-dp_aux_ch.adb b/common/hw-gfx-dp_aux_ch.adb
index 5b4fde4..20c2c3c 100644
--- a/common/hw-gfx-dp_aux_ch.adb
+++ b/common/hw-gfx-dp_aux_ch.adb
@@ -16,6 +16,7 @@
with HW.GFX.DP_Defs;
use type HW.Word8;
+use type HW.Word32;
use type HW.GFX.DP_Defs.Aux_Message_Command;
package body HW.GFX.DP_Aux_Ch is
diff --git a/common/hw-gfx-edid.adb b/common/hw-gfx-edid.adb
index f1fae58..d8dba1d 100644
--- a/common/hw-gfx-edid.adb
+++ b/common/hw-gfx-edid.adb
@@ -12,8 +12,6 @@
-- GNU General Public License for more details.
--
-with HW;
-
with HW.Debug;
with GNAT.Source_Info;
diff --git a/common/hw-gfx-framebuffer_filler.ads b/common/hw-gfx-framebuffer_filler.ads
index 7ad3b79..ff3d343 100644
--- a/common/hw-gfx-framebuffer_filler.ads
+++ b/common/hw-gfx-framebuffer_filler.ads
@@ -14,10 +14,6 @@
with System;
-with HW;
-
-use type HW.Int32;
-
package HW.GFX.Framebuffer_Filler
with
Abstract_State => ((State with External), Base_Address),
diff --git a/common/hw-gfx-gma-config_helpers.ads b/common/hw-gfx-gma-config_helpers.ads
index b9f1d70..ffac9d4 100644
--- a/common/hw-gfx-gma-config_helpers.ads
+++ b/common/hw-gfx-gma-config_helpers.ads
@@ -12,7 +12,6 @@
-- GNU General Public License for more details.
--
-with HW;
with HW.GFX.GMA.Config;
private package HW.GFX.GMA.Config_Helpers
diff --git a/common/hw-gfx-gma-registers.ads b/common/hw-gfx-gma-registers.ads
index 3318ab1..c8ada33 100644
--- a/common/hw-gfx-gma-registers.ads
+++ b/common/hw-gfx-gma-registers.ads
@@ -13,7 +13,6 @@
--
with System;
-with HW.GFX.GMA;
with HW.GFX.GMA.Config;
private package HW.GFX.GMA.Registers
diff --git a/common/hw-gfx-gma.ads b/common/hw-gfx-gma.ads
index afd1512..1282e89 100644
--- a/common/hw-gfx-gma.ads
+++ b/common/hw-gfx-gma.ads
@@ -19,6 +19,8 @@
with HW.Port_IO;
with HW.GFX.Framebuffer_Filler;
+use type HW.Word32;
+
package HW.GFX.GMA
with
Abstract_State =>
diff --git a/common/hw-gfx.ads b/common/hw-gfx.ads
index 2cfc017..f09f9dc 100644
--- a/common/hw-gfx.ads
+++ b/common/hw-gfx.ads
@@ -13,11 +13,6 @@
-- GNU General Public License for more details.
--
-with HW;
-
-use type HW.Pos64;
-use type HW.Word32;
-
package HW.GFX is
-- such that the count of pixels in any framebuffer may fit