media: video: tegra: resolve compilation warnings
Sanjay Singh Rawat [Mon, 4 Jun 2012 11:51:36 +0000 (16:51 +0530)]
- Adding flag to treat warning as error.
- Warnings handled are unused functions, wrong C coding style, function argument
mismatch.

Bug 949219

Change-Id: I52cf5298ba552747dd4292af5b20db5ac8993cb0
Signed-off-by: Sanjay Singh Rawat <srawat@nvidia.com>
Reviewed-on: http://git-master/r/106208
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User

drivers/media/video/tegra/Makefile
drivers/media/video/tegra/ad5816.c
drivers/media/video/tegra/nvavp/nvavp_dev.c
drivers/media/video/tegra/ov5640.c
drivers/media/video/tegra/tegra_camera.c

index 3c1a0ce..7d7285e 100644 (file)
@@ -1,4 +1,6 @@
 GCOV_PROFILE := y
+
+subdir-ccflags-y := -Werror
 #
 # Makefile for the video capture/playback device drivers.
 #
index ed113b3..2005f15 100644 (file)
@@ -628,16 +628,6 @@ static int ad5816_dev_id(struct ad5816_info *info)
        return err;
 }
 
-static void ad5816_sts_rd(struct ad5816_info *info)
-{
-       /**
-       * Device specific code for status
-       *
-       * TODO: Ad5816 has support to get status for over/under
-       * voltage conditions but currently this feature is not
-       * required.
-       */
-}
 /**
  * Below are device specific functions.
  */
@@ -663,12 +653,13 @@ static int ad5816_position_rd(struct ad5816_info *info, unsigned *position)
 
 static int ad5816_position_wr(struct ad5816_info *info, unsigned position)
 {
-       position = position + info->config.pos_low;
+       u16 data;
 
+       position = position + info->config.pos_low;
        if(position > info->config.pos_high)
                position = info->config.pos_high;
 
-       u16 data = position & 0x03ff;
+       data = position & 0x03ff;
 
        return ad5816_i2c_wr16(info, VCM_CODE_MSB, data);
 }
@@ -757,10 +748,8 @@ static int ad5816_param_rd(struct ad5816_info *info, unsigned long arg)
 }
 
 static int ad5816_param_wr_s(struct ad5816_info *info,
-                                                               struct nvc_param *params,
-                                                               u32 u32val)
+               struct nvc_param *params, u32 u32val)
 {
-       struct nvc_focus_cap cap;
        u8 u8val;
        int err = 0;
        u8val = (u8)u32val;
@@ -1102,10 +1091,11 @@ static int ad5816_probe(
                struct i2c_client *client,
                const struct i2c_device_id *id)
 {
-       pr_info("ad5816: probing focuser.\n");
        struct ad5816_info *info;
        char dname[16];
        int err;
+
+       pr_info("ad5816: probing focuser.\n");
        dev_dbg(&client->dev, "%s\n", __func__);
        info = devm_kzalloc(&client->dev, sizeof(*info), GFP_KERNEL);
        if (info == NULL) {
index e2bad81..bdb649f 100644 (file)
@@ -203,8 +203,8 @@ static void nvavp_set_channel_control_area(struct nvavp_info *nvavp, int channel
        writel(0x0, &control->get);
 
        pr_debug("nvavp_set_channel_control_area for channel_id (%d):\
-               control->put (0x%x) control->get (0x%x)\n",
-               channel_id, &control->put, &control->get);
+               control->put (0x%08x) control->get (0x%08x)\n",
+               channel_id, (u32) &control->put, (u32) &control->get);
 
        /* enable avp VDE clock control and disable iram clock gating */
        writel(0x0, &control->idle_clk_enable);
@@ -535,7 +535,7 @@ static int nvavp_pushbuffer_update(struct nvavp_info *nvavp, u32 phys_addr,
        control = channel_info->os_control;
        pr_debug("nvavp_pushbuffer_update for channel_id (%d):\
                control->put (0x%x) control->get (0x%x)\n",
-               channel_id, &control->put, &control->get);
+               channel_id, (u32) &control->put, (u32) &control->get);
 
        mutex_lock(&channel_info->pushbuffer_lock);
 
index b20c036..26580b0 100644 (file)
@@ -108,6 +108,7 @@ static int ov5640_read_reg(struct i2c_client *client, u16 addr, u8 *val)
        return 0;
 }
 
+#ifdef KERNEL_WARNING
 static int ov5640_write_reg(struct i2c_client *client, u8 addr, u8 value)
 {
        int count;
@@ -134,6 +135,7 @@ static int ov5640_write_reg(struct i2c_client *client, u8 addr, u8 value)
               addr, (u32)value);
        return -EIO;
 }
+#endif
 
 static int ov5640_write_bulk_reg(struct i2c_client *client, u8 *data, int len)
 {
index de0c662..5c1cbfe 100644 (file)
@@ -183,10 +183,13 @@ static int tegra_camera_clk_set_rate(struct tegra_camera_dev *dev)
                        tegra_clk_cfg_ex(clk, TEGRA_CLK_VI_INP_SEL, 2);
 
 #ifdef CONFIG_ARCH_TEGRA_2x_SOC
-               u32 val;
-               void __iomem *apb_misc = IO_ADDRESS(TEGRA_APB_MISC_BASE);
-               val = readl(apb_misc + 0x42c);
-               writel(val | 0x1, apb_misc + 0x42c);
+               {
+                       u32 val;
+                       void __iomem *apb_misc =
+                               IO_ADDRESS(TEGRA_APB_MISC_BASE);
+                       val = readl(apb_misc + 0x42c);
+                       writel(val | 0x1, apb_misc + 0x42c);
+               }
 #endif
        }