video: tegra: clean up warnings and #if expression
Jon Mayo [Wed, 4 Sep 2013 19:16:51 +0000 (12:16 -0700)]
Clean up several warnings and fix a #if to use || instead of &&.

Change-Id: I23a63e2cb0125a3856d86c4da52d1b13d590118f
Signed-off-by: Jon Mayo <jmayo@nvidia.com>
Reviewed-on: http://git-master/r/270240
Reviewed-by: Adeel Raza <araza@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User

drivers/video/tegra/dc/bandwidth.c
drivers/video/tegra/dc/dc.c
drivers/video/tegra/dc/dsi.h
drivers/video/tegra/fb.c

index a8f6966..1f18727 100644 (file)
@@ -36,8 +36,10 @@ static int use_dynamic_emc = 1;
 
 module_param_named(use_dynamic_emc, use_dynamic_emc, int, S_IRUGO | S_IWUSR);
 
+#ifdef CONFIG_ARCH_TEGRA_12x_SOC
 static unsigned int tegra_dcs_total_bw[TEGRA_MAX_DC] = {0};
 DEFINE_MUTEX(tegra_dcs_total_bw_lock);
+#endif
 
 /* windows A, B, C for first and second display */
 static const enum tegra_la_id la_id_tab[2][DC_N_WINDOWS] = {
@@ -46,7 +48,7 @@ static const enum tegra_la_id la_id_tab[2][DC_N_WINDOWS] = {
                TEGRA_LA_DISPLAY_0A,
                TEGRA_LA_DISPLAY_0B,
                TEGRA_LA_DISPLAY_0C,
-#if defined(CONFIG_ARCH_TEGRA_14x_SOC) && defined(CONFIG_ARCH_TEGRA_12x_SOC)
+#if defined(CONFIG_ARCH_TEGRA_14x_SOC) || defined(CONFIG_ARCH_TEGRA_12x_SOC)
                TEGRA_LA_DISPLAYD,
 #endif
 #if defined(CONFIG_ARCH_TEGRA_14x_SOC)
@@ -68,7 +70,8 @@ static const enum tegra_la_id la_id_tab[2][DC_N_WINDOWS] = {
        },
 };
 
-bool is_internal_win(enum tegra_la_id id)
+#ifdef CONFIG_ARCH_TEGRA_12x_SOC
+static bool is_internal_win(enum tegra_la_id id)
 {
        return ((id == TEGRA_LA_DISPLAY_0A) || (id == TEGRA_LA_DISPLAY_0B) ||
                (id == TEGRA_LA_DISPLAY_0C) || (id == TEGRA_LA_DISPLAYD) ||
@@ -115,7 +118,6 @@ static unsigned int num_active_external_wins(struct tegra_dc *dc)
        return num_active_external_wins;
 }
 
-#ifdef CONFIG_ARCH_TEGRA_12x_SOC
 /*
  * Note about fixed point arithmetic:
  * ----------------------------------
index e5091d8..89b43d1 100644 (file)
@@ -1418,7 +1418,8 @@ static int tegra_dc_set_out(struct tegra_dc *dc, struct tegra_dc_out *out)
        if (dc->out_ops && dc->out_ops->init) {
                err = dc->out_ops->init(dc);
                if (err < 0) {
-                       dc->out = dc->out_ops = NULL;
+                       dc->out = NULL;
+                       dc->out_ops = NULL;
                        return err;
                }
        }
index 52b54be..bec4099 100644 (file)
@@ -420,7 +420,7 @@ extern struct tegra_dsi_out_ops tegra_dsi2lvds_ops;
                defined(CONFIG_TEGRA_DSI2EDP_SN65DSI86)
 extern struct tegra_dsi_out_ops tegra_dsi2edp_ops;
 #else
-#define tegra_dsi2edp_ops (*NULL)
+#define tegra_dsi2edp_ops (*(struct tegra_dsi_out_ops *)NULL)
 #endif
 
 static inline void *tegra_dsi_get_outdata(struct tegra_dc_dsi_data *dsi)
index 3bc01d9..b4ff20e 100644 (file)
@@ -388,7 +388,7 @@ static int tegra_fb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long
        struct tegra_fb_modedb modedb;
        struct fb_modelist *modelist;
        struct fb_vblank vblank = {};
-       int i;
+       unsigned i;
 
        switch (cmd) {
        case FBIO_TEGRA_GET_MODEDB: