[coreboot-gerrit] Change in coreboot[master]: nb/intel/sandybridge: Use macros to determine min and max of...

Arthur Heymans (Code Review) gerrit at coreboot.org
Sat May 20 10:32:46 CEST 2017


Arthur Heymans has submitted this change and it was merged. ( https://review.coreboot.org/19691 )

Change subject: nb/intel/sandybridge: Use macros to determine min and max of timA
......................................................................


nb/intel/sandybridge: Use macros to determine min and max of timA

This improves readability.

Change-Id: Ib4387a4f4092053dab273191a73edb0ef31a79f6
Signed-off-by: Arthur Heymans <arthur at aheymans.xyz>
Reviewed-on: https://review.coreboot.org/19691
Tested-by: build bot (Jenkins) <no-reply at coreboot.org>
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude at gmail.com>
Reviewed-by: Paul Menzel <paulepanter at users.sourceforge.net>
Reviewed-by: Patrick Rudolph <siro at das-labor.org>
---
M src/northbridge/intel/sandybridge/raminit_common.c
1 file changed, 12 insertions(+), 24 deletions(-)

Approvals:
  Patrick Rudolph: Looks good to me, approved
  Philippe Mathieu-Daudé: Looks good to me, but someone else must approve
  Paul Menzel: Looks good to me, but someone else must approve
  build bot (Jenkins): Verified



diff --git a/src/northbridge/intel/sandybridge/raminit_common.c b/src/northbridge/intel/sandybridge/raminit_common.c
index e9d38c9..be0589d 100644
--- a/src/northbridge/intel/sandybridge/raminit_common.c
+++ b/src/northbridge/intel/sandybridge/raminit_common.c
@@ -1020,30 +1020,18 @@
 			shift = 0;
 
 		FOR_ALL_LANES {
-			if (post_timA_min_high >
-			    ((ctrl->timings[channel][slotrank].lanes[lane].
-			      timA + shift) >> 6))
-				post_timA_min_high =
-				    ((ctrl->timings[channel][slotrank].
-				      lanes[lane].timA + shift) >> 6);
-			if (pre_timA_min_high >
-			    (ctrl->timings[channel][slotrank].lanes[lane].
-			     timA >> 6))
-				pre_timA_min_high =
-				    (ctrl->timings[channel][slotrank].
-				     lanes[lane].timA >> 6);
-			if (post_timA_max_high <
-			    ((ctrl->timings[channel][slotrank].lanes[lane].
-			      timA + shift) >> 6))
-				post_timA_max_high =
-				    ((ctrl->timings[channel][slotrank].
-				      lanes[lane].timA + shift) >> 6);
-			if (pre_timA_max_high <
-			    (ctrl->timings[channel][slotrank].lanes[lane].
-			     timA >> 6))
-				pre_timA_max_high =
-				    (ctrl->timings[channel][slotrank].
-				     lanes[lane].timA >> 6);
+			post_timA_min_high = MIN(post_timA_min_high,
+				(ctrl->timings[channel][slotrank].lanes[lane].
+					timA + shift) >> 6);
+			pre_timA_min_high = MIN(pre_timA_min_high,
+				ctrl->timings[channel][slotrank].lanes[lane].
+						timA >> 6);
+			post_timA_max_high = MAX(post_timA_max_high,
+				(ctrl->timings[channel][slotrank].lanes[lane].
+					timA + shift) >> 6);
+			pre_timA_max_high = MAX(pre_timA_max_high,
+				ctrl->timings[channel][slotrank].lanes[lane].
+						timA >> 6);
 		}
 
 		if (pre_timA_max_high - pre_timA_min_high <

-- 
To view, visit https://review.coreboot.org/19691
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib4387a4f4092053dab273191a73edb0ef31a79f6
Gerrit-PatchSet: 2
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Arthur Heymans <arthur at aheymans.xyz>
Gerrit-Reviewer: Arthur Heymans <arthur at aheymans.xyz>
Gerrit-Reviewer: Patrick Rudolph <siro at das-labor.org>
Gerrit-Reviewer: Paul Menzel <paulepanter at users.sourceforge.net>
Gerrit-Reviewer: Philippe Mathieu-Daudé <philippe.mathieu.daude at gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply at coreboot.org>



More information about the coreboot-gerrit mailing list