CHROMIUM: drm/exynos: Fix compile warning in dp_core
authorDaniel Kurtz <djkurtz@chromium.org>
Thu, 29 Nov 2012 08:59:20 +0000 (16:59 +0800)
committerGerrit <chrome-bot@google.com>
Fri, 30 Nov 2012 02:54:34 +0000 (18:54 -0800)
In function 'exynos_dp_hotplug':
warning: 'voltage_swing' may be used uninitialized in this function
[-Wmaybe-uninitialized]

While it may be impossible for dp->link_train.lane_count to be 0, the
compiler can't know that.  If it is 0 for some reason, then voltage_swing
does not get set in the lane loop and therefore
exynos_dp_check_max_cr_loop() gets called with a bogus voltage_swing.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
BUG=chromium-os:36770
TEST=builds without the warning

Change-Id: Ia19a0439487995bd600570e0f32bf4a4c31e4407
Reviewed-on: https://gerrit.chromium.org/gerrit/38901
Commit-Ready: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Daniel Kurtz <djkurtz@chromium.org>
drivers/gpu/drm/exynos/exynos_dp_core.c

index 142c0cf..b1eb02d 100644 (file)
@@ -507,6 +507,9 @@ static int exynos_dp_process_clock_recovery(struct exynos_dp_device *dp)
                return ret;
 
        lane_count = dp->link_train.lane_count;
+       if (lane_count == 0)
+               return 0;
+
        adjust_request = link_status + 4;
 
        if (exynos_dp_clock_recovery_ok(link_status, lane_count) == 0) {