drm/i915: Replace some hand rolled max()s
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 12 May 2020 17:41:45 +0000 (20:41 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 3 Jun 2020 13:23:21 +0000 (16:23 +0300)
Use max() instead of hand rolling it.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200512174145.3186-8-ville.syrjala@linux.intel.com
Reviewed-by: Manasi Navare <manasi.d.navare@intel.com>
drivers/gpu/drm/i915/display/intel_dp_link_training.c

index 573f937794490972bee4ae042e81f9655b519a07..b9e4ee2dbddc9b75d80e2388ebaccf25c156c85f 100644 (file)
@@ -59,13 +59,8 @@ void intel_dp_get_adjust_train(struct intel_dp *intel_dp,
        u8 preemph_max;
 
        for (lane = 0; lane < intel_dp->lane_count; lane++) {
-               u8 this_v = drm_dp_get_adjust_request_voltage(link_status, lane);
-               u8 this_p = drm_dp_get_adjust_request_pre_emphasis(link_status, lane);
-
-               if (this_v > v)
-                       v = this_v;
-               if (this_p > p)
-                       p = this_p;
+               v = max(v, drm_dp_get_adjust_request_voltage(link_status, lane));
+               p = max(p, drm_dp_get_adjust_request_pre_emphasis(link_status, lane));
        }
 
        preemph_max = intel_dp->preemph_max(intel_dp);