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>
This commit is contained in:
Arthur Heymans 2017-05-15 09:36:44 +02:00
parent e729366d7a
commit abc504f427
1 changed files with 12 additions and 24 deletions

View File

@ -1020,30 +1020,18 @@ void program_timings(ramctr_timing * ctrl, int channel)
shift = 0; shift = 0;
FOR_ALL_LANES { FOR_ALL_LANES {
if (post_timA_min_high > post_timA_min_high = MIN(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]. (ctrl->timings[channel][slotrank].lanes[lane].
timA >> 6)) timA + shift) >> 6);
pre_timA_min_high = pre_timA_min_high = MIN(pre_timA_min_high,
(ctrl->timings[channel][slotrank]. ctrl->timings[channel][slotrank].lanes[lane].
lanes[lane].timA >> 6); timA >> 6);
if (post_timA_max_high < post_timA_max_high = MAX(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]. (ctrl->timings[channel][slotrank].lanes[lane].
timA >> 6)) timA + shift) >> 6);
pre_timA_max_high = pre_timA_max_high = MAX(pre_timA_max_high,
(ctrl->timings[channel][slotrank]. ctrl->timings[channel][slotrank].lanes[lane].
lanes[lane].timA >> 6); timA >> 6);
} }
if (pre_timA_max_high - pre_timA_min_high < if (pre_timA_max_high - pre_timA_min_high <