media: sprd_dcam: remove build warnings 85/164685/3
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 20 Dec 2017 09:54:13 +0000 (18:54 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 20 Dec 2017 10:48:55 +0000 (19:48 +0900)
Remove build warnings.

Change-Id: Iecca7b0767d47abb01e444b9a34d861917e5e149
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
drivers/media/sprd_dcam/common/dcam_img.c
drivers/media/sprd_dcam/common/parse_hwinfo.c
drivers/media/sprd_dcam/common/parse_hwinfo.h
drivers/media/sprd_dcam/tshark/dcam_drv.c
drivers/media/sprd_isp/isp_drv.c
drivers/media/sprd_scale/common/img_scale.c
drivers/media/sprd_sensor/csi2/csi_api.c
drivers/media/sprd_sensor/sensor_drv_k.c

index 64a0606..500dcce 100755 (executable)
@@ -60,7 +60,7 @@
 #define DCAM_RELEASE                            0
 #define DCAM_QUEUE_LENGTH                       16
 #define DCAM_TIMING_LEN                         16
-#if CONFIG_SC_FPGA
+#ifdef CONFIG_SC_FPGA
 #define DCAM_TIMEOUT                            (2000*100)
 #else
 #define DCAM_TIMEOUT                            1500
@@ -1239,8 +1239,9 @@ LOCAL int sprd_img_tx_done(struct dcam_frame *frame, void* param)
        struct dcam_dev          *dev = (struct dcam_dev*)param;
        struct dcam_path_spec    *path;
        struct dcam_node         node;
-       uint32_t                 fmr_index;
+#if 0
        struct dcam_img_buf_addr buf_addr;
+#endif
 
        if (NULL == frame || NULL == param || 0 == atomic_read(&dev->stream_on))
                return -EINVAL;
@@ -1316,9 +1317,11 @@ LOCAL int sprd_img_tx_error(struct dcam_frame *frame, void* param)
 {
        int                      ret = DCAM_RTN_SUCCESS;
        struct dcam_dev          *dev = (struct dcam_dev*)param;
-       struct dcam_path_spec    *path;
        struct dcam_node         node;
+#if 0
+       struct dcam_path_spec    *path;
        struct dcam_img_buf_addr buf_addr;
+#endif
 
        if (NULL == param || 0 == atomic_read(&dev->stream_on))
                return -EINVAL;
@@ -1361,9 +1364,11 @@ LOCAL int sprd_img_no_mem(struct dcam_frame *frame, void* param)
 {
        int                      ret = DCAM_RTN_SUCCESS;
        struct dcam_dev          *dev = (struct dcam_dev*)param;
-       struct dcam_path_spec    *path;
        struct dcam_node         node;
+#if 0
+       struct dcam_path_spec    *path;
        struct dcam_img_buf_addr buf_addr;
+#endif
 
        if (NULL == param || 0 == atomic_read(&dev->stream_on))
                return -EINVAL;
@@ -1470,7 +1475,7 @@ LOCAL int sprd_img_path0_cfg(path_cfg_func path_cfg,
                                struct dcam_path_spec* path_spec)
 {
        int                      ret = DCAM_RTN_SUCCESS;
-       uint32_t                 param, i;
+       uint32_t                 param;
 
        if (NULL == path_cfg || NULL == path_spec)
                return -EINVAL;
@@ -1523,7 +1528,7 @@ LOCAL int sprd_img_path_cfg(path_cfg_func path_cfg,
                                struct dcam_path_spec* path_spec)
 {
        int                      ret = DCAM_RTN_SUCCESS;
-       uint32_t                 param, i;
+       uint32_t                 param;
 
        if (NULL == path_cfg || NULL == path_spec)
                return -EINVAL;
@@ -1621,7 +1626,6 @@ exit:
 
 LOCAL int sprd_img_local_clear_path_buffer(struct dcam_dev *dev, int path_id)
 {
-       int                                     ret = 0;
        struct dcam_path_spec    *path = NULL;
 
        if (unlikely(NULL == dev)) {
@@ -1699,7 +1703,6 @@ LOCAL int sprd_img_queue_init(struct dcam_queue *queue)
 LOCAL int sprd_img_queue_write(struct dcam_queue *queue, struct dcam_node *node)
 {
        struct dcam_node         *ori_node;
-       unsigned long                 lock_flag;
 
        if (NULL == queue || NULL == node)
                return -EINVAL;
@@ -1774,7 +1777,6 @@ LOCAL int sprd_img_queue_disable(struct dcam_queue *queue, uint32_t channel_id)
 
 LOCAL int sprd_img_queue_enable(struct dcam_queue *queue, uint32_t channel_id)
 {
-       struct dcam_node            *cur_node;
        unsigned int                    i = 0;
 
        if (NULL == queue)
@@ -3379,13 +3381,13 @@ ssize_t sprd_img_read(struct file *file, char __user *u_data, size_t cnt, loff_t
        int                      fmr_index, i;
        int                      ret = 0;
 
-       DCAM_TRACE("SPRD_IMG: sprd_img_read %ld, dev %p \n", cnt, dev);
+       DCAM_TRACE("SPRD_IMG: sprd_img_read %zu, dev %p \n", cnt, dev);
 
        if (!dev)
                return -EFAULT;
 
        if (cnt < sizeof(struct sprd_img_read_op)) {
-               printk("sprd_img_read: error, cnt %ld read_op %ld \n", cnt, sizeof(struct sprd_img_read_op));
+               printk("sprd_img_read: error, cnt %zu read_op %zu \n", cnt, sizeof(struct sprd_img_read_op));
                return -EIO;
        }
 
@@ -3445,7 +3447,7 @@ ssize_t sprd_img_read(struct file *file, char __user *u_data, size_t cnt, loff_t
                if (IMG_TX_DONE == read_op.evt  || IMG_CANCELED_BUF == read_op.evt) {
                        read_op.parm.frame.channel_id = node.f_type;
                        path = &dev->dcam_cxt.dcam_path[read_op.parm.frame.channel_id];
-                       DCAM_TRACE("SPRD_IMG: node, 0x%x %d %d \n", node, node.index, path->frm_id_base);
+                       DCAM_TRACE("SPRD_IMG: node, 0x%x %d %d \n", node.irq_flag, node.index, path->frm_id_base);
                        read_op.parm.frame.index = path->frm_id_base;//node.index;
                        read_op.parm.frame.height = node.height;
                        read_op.parm.frame.length = node.reserved;
@@ -3517,13 +3519,13 @@ ssize_t sprd_img_write(struct file *file, const char __user * u_data, size_t cnt
        uint32_t                 index;
        int                      ret = 0;
 
-       DCAM_TRACE("SPRD_IMG: sprd_img_write %ld, dev %p \n", cnt, dev);
+       DCAM_TRACE("SPRD_IMG: sprd_img_write %zu, dev %p \n", cnt, dev);
 
        if (!dev)
                return -EFAULT;
 
        if (cnt < sizeof(struct sprd_img_write_op)) {
-               printk("sprd_img_write: error, cnt %ld read_op %ld \n", cnt, sizeof(struct sprd_img_write_op));
+               printk("sprd_img_write: error, cnt %zu read_op %zu \n", cnt, sizeof(struct sprd_img_write_op));
                return -EIO;
        }
 
index e4897cb..7c79308 100644 (file)
@@ -66,13 +66,13 @@ void parse_baseaddress(struct device_node *dn)
                return;
        }
        if (dcam_regbase == 0 && strcmp(dn->name, "sprd_dcam") == 0) {
-               dcam_regbase = ioremap_nocache(r.start, resource_size(&r));
+               dcam_regbase = (uintptr_t)ioremap_nocache(r.start, resource_size(&r));
                PARSE_TRACE("Dcam register base addr: 0x%lx\n", dcam_regbase);
        } else if (isp_regbase == 0 && strcmp(dn->name, "sprd_isp") == 0) {
-               isp_regbase = ioremap_nocache(r.start, resource_size(&r));
+               isp_regbase = (uintptr_t)ioremap_nocache(r.start, resource_size(&r));
                PARSE_TRACE("Isp register base addr: 0x%lx\n", isp_regbase);
        } else if (csi_regbase == 0 && strcmp(dn->name, "sprd_sensor") == 0) {
-               csi_regbase = ioremap_nocache(r.start, resource_size(&r));
+               csi_regbase = (uintptr_t)ioremap_nocache(r.start, resource_size(&r));
                PARSE_TRACE("Csi register base addr: 0x%lx\n", csi_regbase);
        }
 #endif
@@ -295,7 +295,7 @@ const char *c_sensor_mot_name[] = {
                                                REGU_DEV1_CAMMOT,
                                                REGU_DEV2_CAMMOT};
 
-int get_regulator_name(struct device_node *dn, int *type, uint32_t sensor_id, char **name)
+int get_regulator_name(struct device_node *dn, int *type, uint32_t sensor_id, const char **name)
 {
        const char *ldostr;
        int ret = 0;
@@ -345,13 +345,13 @@ int get_regulator_name(struct device_node *dn, int *type, uint32_t sensor_id, ch
                break;
        }
 
-       if(strcmp(name, "vddcammot")==0) {
+       if(strcmp(*name, "vddcammot")==0) {
                *type = REGU_CAMMOT;
-       } else if(strcmp(name, "vddcama")==0){
+       } else if(strcmp(*name, "vddcama")==0){
                *type = REGU_CAMAVDD;
-       } else if(strcmp(name, "vddcamd")==0){
+       } else if(strcmp(*name, "vddcamd")==0){
                *type = REGU_CAMDVDD;
-       } else if(strcmp(name, "vddcamio")==0){
+       } else if(strcmp(*name, "vddcamio")==0){
                *type = REGU_CAMIOVDD;
        }
         of_node_put(dn);
index d6a8341..b5b5883 100644 (file)
@@ -70,4 +70,4 @@ uint32_t parse_irq(struct device_node *dn);
 struct clk * parse_clk(struct device_node *dn, char *clkname);
 int get_gpio_id(struct device_node *dn, int *pwn, int *reset, uint32_t sensor_id);
 int get_gpio_id_ex(struct device_node *dn, int type, int *id, uint32_t sensor_id);
-int get_regulator_name(struct device_node *dn, int *type, uint32_t sensor_id, char **name);
+int get_regulator_name(struct device_node *dn, int *type, uint32_t sensor_id, const char **name);
index 6ddeece..6402b01 100755 (executable)
@@ -281,7 +281,9 @@ LOCAL void        _dcam_auto_copy_ext(enum dcam_path_index path_index, uint32_t
 LOCAL void        _dcam_force_copy(enum dcam_path_index path_index);
 LOCAL void        _dcam_auto_copy(enum dcam_path_index path_index);
 LOCAL void        _dcam_reg_trace(void);
+#if 0
 LOCAL void        _dcam_sensor_sof(void);
+#endif
 LOCAL void        _dcam_sensor_eof(void);
 LOCAL void        _dcam_cap_sof(void);
 LOCAL void        _dcam_cap_eof(void);
@@ -1662,8 +1664,6 @@ int32_t dcam_cap_cfg(enum dcam_cfg_id id, void *param)
 
        case DCAM_CAP_ZOOM_MODE:
        {
-               uint32_t zoom_mode = *(uint32_t*)param;
-
                DCAM_CHECK_PARAM_ZERO_POINTER(param);
 
                //Zoom operation issue fix in Z3. enable smooth_zoom
@@ -1827,7 +1827,7 @@ int32_t dcam_path0_cfg(enum dcam_cfg_id id, void *param)
 
        case DCAM_PATH_FRAME_BASE_ID:
        {
-               uint32_t          base_id = *(uint32_t*)param, i;
+               uint32_t          base_id = *(uint32_t*)param;
 
                DCAM_CHECK_PARAM_ZERO_POINTER(param);
 
@@ -2118,7 +2118,7 @@ int32_t dcam_path1_cfg(enum dcam_cfg_id id, void *param)
 
        case DCAM_PATH_FRAME_BASE_ID:
        {
-               uint32_t          base_id = *(uint32_t*)param, i;
+               uint32_t          base_id = *(uint32_t*)param;
 
                DCAM_CHECK_PARAM_ZERO_POINTER(param);
 
@@ -2205,7 +2205,7 @@ int32_t dcam_path1_cfg(enum dcam_cfg_id id, void *param)
                }else{
                        path->rot_mode = rot_mode;
                        path->valid_param.rot_mode = 1;
-                       DCAM_TRACE("zcf dcam_path1_cfg rot:\n",path->rot_mode);
+                       DCAM_TRACE("zcf dcam_path1_cfg rot: = %d\n",path->rot_mode);
                }
                break;
        }
@@ -2377,7 +2377,7 @@ int32_t dcam_path2_cfg(enum dcam_cfg_id id, void *param)
 
        case DCAM_PATH_FRAME_BASE_ID:
        {
-               uint32_t          base_id = *(uint32_t*)param, i;
+               uint32_t          base_id = *(uint32_t*)param;
 
                DCAM_CHECK_PARAM_ZERO_POINTER(param);
 
@@ -2466,7 +2466,7 @@ int32_t dcam_path2_cfg(enum dcam_cfg_id id, void *param)
                }else{
                        path->rot_mode = rot_mode;
                        path->valid_param.rot_mode = 1;
-                       DCAM_TRACE("zcf dcam_path2_cfg rot:\n",path->rot_mode);
+                       DCAM_TRACE("zcf dcam_path2_cfg rot: = %d\n",path->rot_mode);
                }
                break;
        }
@@ -3083,7 +3083,7 @@ LOCAL int32_t _dcam_buf_queue_write(struct dcam_buf_queue *queue, struct dcam_fr
 
        if (queue->write == queue->read) {
                queue->write = ori_frame;
-               printk("DCAM: warning, queue is full, cannot write 0x%lx \n", frame->yaddr);
+               printk("DCAM: warning, queue is full, cannot write 0x%x \n", frame->yaddr);
        }
        spin_unlock_irqrestore(&queue->lock, flag);
        DCAM_TRACE("DCAM: _dcam_buf_queue_write type %d \n", frame->type);
@@ -3182,8 +3182,6 @@ LOCAL int32_t _dcam_frame_dequeue(struct dcam_frm_queue *queue, struct dcam_fram
 
 LOCAL void _dcam_frm_clear(enum dcam_path_index path_index)
 {
-       uint32_t                i = 0;
-
        DCAM_CHECK_ZERO_VOID(s_p_dcam_mod);
 
        if (DCAM_PATH_IDX_0 & path_index) {
@@ -3204,7 +3202,7 @@ LOCAL void _dcam_frm_clear(enum dcam_path_index path_index)
        return;
 }
 
-LOCAL void _dcam_frm_pop(enum dcam_path_index path_index)
+LOCAL void __maybe_unused _dcam_frm_pop(enum dcam_path_index path_index)
 {
        uint32_t                i = 0;
        struct dcam_frame       *frame = NULL;
@@ -3295,11 +3293,9 @@ LOCAL int32_t _dcam_path_set_next_frm(enum dcam_path_index path_index, uint32_t
        enum dcam_drv_rtn       rtn = DCAM_RTN_SUCCESS;
        struct dcam_frame       frame;
        struct dcam_frame       *reserved_frame = NULL;
-       struct dcam_frame       *orig_frame = NULL;
        struct dcam_path_desc   *path = NULL;
        uint32_t                yuv_reg[3] = {0};
        uint32_t                path_max_frm_cnt;
-       uint32_t                flag = 0;
        struct dcam_frm_queue   *p_heap = NULL;
        struct dcam_buf_queue   *p_buf_queue = NULL;
 
@@ -4217,7 +4213,6 @@ LOCAL void    _dcam_path0_sof(void)
        dcam_isr_func           user_func = s_user_func[DCAM_PATH0_SOF];
        void                    *data = s_user_data[DCAM_PATH0_SOF];
        struct dcam_path_desc   *path;
-       struct dcam_sc_coeff    *sc_coeff;
 
        DCAM_TRACE("DCAM: 0 sof 1 \n");
 
@@ -4634,14 +4629,14 @@ void mm_clk_register_trace(void)
 
    printk("mm_clk_reg, part 1 \n");
    for (i = 0 ; i <= 0x10; i += 4 ) {
-               printk("MMAHB: %x val:%x \b\n",
+               printk("MMAHB: %lx val:%x \b\n",
                        (SPRD_MMAHB_BASE + i),
                        REG_RD(SPRD_MMAHB_BASE + i));
    }
 
    printk("mm_clk_reg, part 2 \n");
    for (i = 0x20 ; i <= 0x38; i += 4 ) {
-               printk("MMCKG: %x val:%x \b\n",
+               printk("MMCKG: %lx val:%x \b\n",
                        (SPRD_MMCKG_BASE + i),
                        REG_RD(SPRD_MMCKG_BASE + i));
    }
index 6f6c5b1..416c531 100644 (file)
@@ -236,7 +236,6 @@ static int32_t isp_binging4awb_buf_alloc(struct isp_k_private *isp_private, uint
 static int32_t isp_b4awb_switch_buf(struct isp_k_private *isp_private)
 {
        int32_t ret = 0;
-       int32_t i = 0;
 
        /*first bypass b4awb*/
        REG_MWR(ISP_BINNING_PARAM, BIT_0, 0x1);
@@ -931,7 +930,6 @@ static long isp_ioctl( struct file *file, unsigned int cmd, unsigned long param)
        {
                int ret;
                int num;
-               int i;
                int ISP_REG_NUM = 20467;
 
                struct isp_reg_bits *ptr = (struct isp_reg_bits *)vmalloc(ISP_REG_NUM * sizeof(struct isp_reg_bits));
@@ -1113,6 +1111,7 @@ static void __exit isp_exit(void)
 
 static int isp_wr_addr(struct isp_reg_bits *ptr)
 {
+               struct isp_reg_bits *ptr_reg = ptr;
                int i;
                int sum = 0;
 
@@ -1121,8 +1120,6 @@ static int isp_wr_addr(struct isp_reg_bits *ptr)
                        return -1;
                }
 
-               struct isp_reg_bits *ptr_reg = ptr;
-
                ptr_reg -> reg_addr = 0x0000; /* Interrupt part*/
                sum++;
 
index 149d6d2..9926eeb 100644 (file)
@@ -107,7 +107,7 @@ ssize_t scale_k_read(struct file *file, char __user *u_data, size_t cnt, loff_t
        (void)file; (void)cnt; (void)cnt_ret;
 
        if (cnt < sizeof(uint32_t)) {
-               printk("scale_k_read error: wrong size of u_data: %ld \n", cnt);
+               printk("scale_k_read error: wrong size of u_data: %zu \n", cnt);
                return -1;
        }
 
index 256bd6a..6a46a77 100644 (file)
@@ -719,7 +719,7 @@ int csi_read_registers(u32* reg_buf, u32 *buf_len)
                return -1;
        }
 
-       while (buf_len != 0 && reg_addr < (u64)(CSI2_BASE + SPRD_CSI2_REG_SIZE)) {
+       while (buf_len != 0 && (uintptr_t)reg_addr < (uintptr_t)(CSI2_BASE + SPRD_CSI2_REG_SIZE)) {
                *reg_buf++ = *(volatile u32*)reg_addr++;
                *buf_len -= 4;
        }
index b3007a5..a632c76 100755 (executable)
@@ -386,7 +386,7 @@ LOCAL int _sensor_k_set_voltage(struct sensor_file_tag *fd_handle, uint32_t val,
        int                              ret = SENSOR_K_SUCCESS;
        uint32_t                         volt_value = 0;
        uint32_t                         *poweron_count = NULL;
-       char                             *regu_name;
+       const char                       *regu_name;
        struct sensor_module_tab_tag     *p_mod;
        struct regulator                 **p_regulator = NULL;