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

This improves readability.

BUG=none
BRANCH=none
TEST=none

Change-Id: Ib654ffde2e45c442895b1d703b2e206ec063838d
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Original-Commit-Id: abc504f427
Original-Change-Id: Ib4387a4f4092053dab273191a73edb0ef31a79f6
Original-Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Original-Reviewed-on: https://review.coreboot.org/19691
Original-Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Original-Reviewed-by: Philippe Mathieu-Daud <philippe.mathieu.daude@gmail.com>
Original-Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Original-Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-on: https://chromium-review.googlesource.com/510764
Commit-Ready: Patrick Georgi <pgeorgi@chromium.org>
Tested-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
This commit is contained in:
Arthur Heymans 2017-05-15 09:36:44 +02:00 committed by chrome-bot
parent d17d52a795
commit 0e22129949

View file

@ -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 <