summaryrefslogtreecommitdiff
path: root/src/northbridge/intel/sandybridge
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2017-05-15 09:36:44 +0200
committerArthur Heymans <arthur@aheymans.xyz>2017-05-20 10:32:41 +0200
commitabc504f427b9e2e7b0426b9eb44bcd7fa2726efb (patch)
treec267dfc890f003891e3aadb84e132ea567e577a0 /src/northbridge/intel/sandybridge
parente729366d7a5246eeae6a9b0bb30271fc92ac5136 (diff)
downloadcoreboot-abc504f427b9e2e7b0426b9eb44bcd7fa2726efb.tar.xz
nb/intel/sandybridge: Use macros to determine min and max of timA
This improves readability. Change-Id: Ib4387a4f4092053dab273191a73edb0ef31a79f6 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/19691 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Diffstat (limited to 'src/northbridge/intel/sandybridge')
-rw-r--r--src/northbridge/intel/sandybridge/raminit_common.c36
1 files changed, 12 insertions, 24 deletions
diff --git a/src/northbridge/intel/sandybridge/raminit_common.c b/src/northbridge/intel/sandybridge/raminit_common.c
index e9d38c95b3..be0589dd8b 100644
--- a/src/northbridge/intel/sandybridge/raminit_common.c
+++ b/src/northbridge/intel/sandybridge/raminit_common.c
@@ -1020,30 +1020,18 @@ void program_timings(ramctr_timing * ctrl, int channel)
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 <