video: rockchip: hdmi: fix compile warning
authorZheng Yang <zhengyang@rock-chips.com>
Fri, 2 Dec 2016 06:04:44 +0000 (14:04 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Wed, 15 Feb 2017 08:57:50 +0000 (16:57 +0800)
fix warning: switch condition has boolean value [-Wswitch-bool]

Change-Id: I11d7a9fe2a07f6681dacf4a1d800b16497339297
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
(cherry picked from commit 66f72e45db8d12d4c5049de6c6fb9aae67a30fe6)

drivers/video/rockchip/hdmi/rockchip-hdmiv2/rockchip_hdmiv2_hw.c

index 39ccf057c72c444da031815c9364515986f42970..81510d6a64e7b70fdf91804ec41608cab91a472a 100644 (file)
@@ -1352,26 +1352,26 @@ static int rockchip_hdmiv2_video_csc(struct hdmi_dev *hdmi_dev,
                mode = CSC_RGB_0_255_TO_RGB_16_235_8BIT;
                csc_scale = 0;
        }
-
-       switch (vpara->color_output_depth && mode != CSC_BYPASS) {
-       case 10:
-               color_depth = COLOR_DEPTH_30BIT;
-               mode += 1;
-               break;
-       case 12:
-               color_depth = COLOR_DEPTH_36BIT;
-               mode += 2;
-               break;
-       case 16:
-               color_depth = COLOR_DEPTH_48BIT;
-               mode += 3;
-               break;
-       case 8:
-       default:
-               color_depth = COLOR_DEPTH_24BIT;
-               break;
+       if (mode != CSC_BYPASS) {
+               switch (vpara->color_output_depth) {
+               case 10:
+                       color_depth = COLOR_DEPTH_30BIT;
+                       mode += 1;
+                       break;
+               case 12:
+                       color_depth = COLOR_DEPTH_36BIT;
+                       mode += 2;
+                       break;
+               case 16:
+                       color_depth = COLOR_DEPTH_48BIT;
+                       mode += 3;
+                       break;
+               case 8:
+               default:
+                       color_depth = COLOR_DEPTH_24BIT;
+                       break;
+               }
        }
-
        coeff = coeff_csc[mode];
        for (i = 0; i < 24; i++)
                hdmi_writel(hdmi_dev, CSC_COEF_A1_MSB + i, coeff[i]);