[coreboot-gerrit] Change in libgfxinit[master]: gma display probing: Use expression functions for less proof inlining

Nico Huber (Code Review) gerrit at coreboot.org
Mon Jun 4 22:48:14 CEST 2018


Nico Huber has uploaded this change for review. ( https://review.coreboot.org/26844


Change subject: gma display probing: Use expression functions for less proof inlining
......................................................................

gma display probing: Use expression functions for less proof inlining

Change-Id: Ibd10238a3cb5c109dee321ad76ef978465ea7d34
Signed-off-by: Nico Huber <nico.huber at secunet.com>
---
M common/hw-gfx-gma-display_probing.adb
1 file changed, 20 insertions(+), 39 deletions(-)



  git pull ssh://review.coreboot.org:29418/libgfxinit refs/changes/44/26844/1

diff --git a/common/hw-gfx-gma-display_probing.adb b/common/hw-gfx-gma-display_probing.adb
index ab6c05f..9f756f6 100644
--- a/common/hw-gfx-gma-display_probing.adb
+++ b/common/hw-gfx-gma-display_probing.adb
@@ -27,49 +27,30 @@
 package body HW.GFX.GMA.Display_Probing
 is
 
-   function Port_Configured
-     (Configs  : Pipe_Configs;
-      Port     : Port_Type)
-      return Boolean
-   with
-      Global => null
-   is
-   begin
-      return Configs (Primary).Port    = Port or
-             Configs (Secondary).Port  = Port or
-             Configs (Tertiary).Port   = Port;
-   end Port_Configured;
+   function Port_Configured (Configs : Pipe_Configs; Port : Port_Type)
+      return Boolean is
+     (Configs (Primary).Port    = Port or
+      Configs (Secondary).Port  = Port or
+      Configs (Tertiary).Port   = Port);
 
    -- DP and HDMI share physical pins.
-   function Sibling_Port (Port : Port_Type) return Port_Type
-   is
-   begin
-      return
-        (case Port is
-            when HDMI1 => DP1,
-            when HDMI2 => DP2,
-            when HDMI3 => DP3,
-            when DP1 => HDMI1,
-            when DP2 => HDMI2,
-            when DP3 => HDMI3,
-            when others => Disabled);
-   end Sibling_Port;
+   function Sibling_Port (Port : Port_Type) return Port_Type is
+     (case Port is
+         when HDMI1 => DP1,
+         when HDMI2 => DP2,
+         when HDMI3 => DP3,
+         when DP1 => HDMI1,
+         when DP2 => HDMI2,
+         when DP3 => HDMI3,
+         when others => Disabled);
 
-   function Has_Sibling_Port (Port : Port_Type) return Boolean
-   is
-   begin
-      return Sibling_Port (Port) /= Disabled;
-   end Has_Sibling_Port;
+   function Has_Sibling_Port (Port : Port_Type) return Boolean is
+     (Sibling_Port (Port) /= Disabled);
 
-   function Is_DVI_I (Port : Active_Port_Type) return Boolean
-   with
-      Global => null
-   is
-   begin
-      return Config.Have_DVI_I and
-             (Port = Analog or
-              Config_Helpers.To_PCH_Port (Port) = Config.Analog_I2C_Port);
-   end Is_DVI_I;
+   function Is_DVI_I (Port : Active_Port_Type) return Boolean is
+     (Config.Have_DVI_I and
+      (Port = Analog or
+      Config_Helpers.To_PCH_Port (Port) = Config.Analog_I2C_Port));
 
    procedure Read_EDID
      (Raw_EDID :    out EDID.Raw_EDID_Data;

-- 
To view, visit https://review.coreboot.org/26844
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: libgfxinit
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibd10238a3cb5c109dee321ad76ef978465ea7d34
Gerrit-Change-Number: 26844
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h at gmx.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180604/6658efb9/attachment.html>


More information about the coreboot-gerrit mailing list