board: solve 32bit printk type error
authorAo Xu <ao.xu@amlogic.com>
Wed, 1 Aug 2018 08:48:16 +0000 (16:48 +0800)
committerYixun Lan <yixun.lan@amlogic.com>
Thu, 2 Aug 2018 04:22:52 +0000 (21:22 -0700)
PD#169652: board: solve 32bit printk type error

for some data type, printk should follow below rule:
size_t: %zu or %zx
phys_addr_t: %pa

Change-Id: I456bd2f010080e6365b521a787367cc51bb4e9f4
Signed-off-by: Ao Xu <ao.xu@amlogic.com>
15 files changed:
drivers/amlogic/i2c/aml_slave.c
drivers/amlogic/input/keyboard/adc_keypad.c
drivers/amlogic/media/common/codec_mm/codec_mm.c
drivers/amlogic/media/common/ion_dev/dev_ion.c
drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c
drivers/amlogic/media/gdc/app/gdc_module.c
drivers/amlogic/media/osd/osd_drm.c
drivers/amlogic/media/osd/osd_fb.c
drivers/amlogic/media/osd/osd_hw.c
drivers/amlogic/media/vin/tvin/bt656/bt656_601_in.c
drivers/amlogic/media/vin/tvin/bt656/bt656_601_in.h
drivers/amlogic/media/vin/tvin/hdmirx_ext/hw_sii9135/SiICmplDefs.h
drivers/amlogic/mtd/new_nand.c
drivers/amlogic/spicc/spicc.c
drivers/of/of_reserved_mem.c

index cad76fd91272f15b0cb74571f2bcdd17b98e3646..e6cd323e16dd23895a36a3f01b970bbfe5a6bee8 100644 (file)
@@ -191,7 +191,7 @@ static int i2c_slave_probe(struct platform_device *pdev)
                return PTR_ERR(res_start);
 
        slave->slave_regs = (struct aml_i2c_reg_slave __iomem *)(res_start);
-       pr_info("res:%llx res_start:%llx\n",  res->start, *res_start);
+       pr_info("res:%pa res_start:%pa\n",  &res->start, res_start);
 
        i2c_slave_dts_parse(pdev, slave);
 
index 6c61fb769f937792501e3c0d14fc36e3fbc9eec3..0b9f7af3b818c84f6af9923b064083f8d376cea6 100644 (file)
@@ -364,7 +364,7 @@ static ssize_t table_store(struct class *cls, struct class_attribute *attr,
 
        /*count inclued '\0'*/
        if (count > TMP_BUF_MAX) {
-               dev_err(dev, "write data is too long[max:%d]: %ld\n",
+               dev_err(dev, "write data is too long[max:%d]: %zu\n",
                        TMP_BUF_MAX, count);
                return -EINVAL;
        }
index 5646d85392aacff8714998750fb8ba9cf33ee39a..7bc3321455f4b6158bf3e284e961d559f36fa1f6 100644 (file)
@@ -1220,9 +1220,9 @@ static int dump_mem_infos(void *buf, int size)
                        atomic_read(&mem->use_cnt)
                        );
                s += snprintf(pbuf + s, size - tsize,
-                       "flags=%d,used:%lld ms\n",
-                       mem->flags,
-                       (get_jiffies_64() - mem->alloced_jiffies) * 100/HZ);
+                       "flags=%d,used:%u ms\n",
+                       mem->flags, jiffies_to_msecs(get_jiffies_64() -
+                       mem->alloced_jiffies));
 
                tsize += s;
                if (buf) {
index f3176736aad897b1cae3c75fa07a8e58e79bc2c1..50fb98f0da0acaa9e63376942deb3f4163f2fc2c 100644 (file)
@@ -282,7 +282,7 @@ static int ion_dev_mem_init(struct reserved_mem *rmem, struct device *dev)
        my_ion_heap[num_heaps].base = (ion_phys_addr_t) rmem->base;
        my_ion_heap[num_heaps].size = rmem->size;
 
-       pr_info("ion_dev_mem_init size=0x%llx\n", rmem->size);
+       pr_info("ion_dev_mem_init size=%pa\n", &rmem->size);
        num_heaps++;
 
        return 0;
index c484708fe8b3a56dbe3fa53de1fcf8c9e82729e1..1ccdedaae89fabbb7ed2c6b9acc73252fa0fb49b 100644 (file)
@@ -920,7 +920,7 @@ void dolby_vision_update_pq_config(char *pq_config_buf)
 {
        memcpy((struct pq_config_s *)pq_config_fake,
                pq_config_buf, sizeof(struct pq_config_s));
-       pr_info("update_pq_config[%ld] %x %x %x %x\n",
+       pr_info("update_pq_config[%zu] %x %x %x %x\n",
                sizeof(struct pq_config_s),
                pq_config_buf[1],
                pq_config_buf[2],
index b0de1c6b853fadcc25e620ab433ca451d873bf49..25cc827108bbe2478f91effdbe3513a9a231316e 100644 (file)
@@ -120,7 +120,7 @@ static long meson_gdc_ioctl(struct file *file, unsigned int cmd,
                if (ret < 0)
                        LOG(LOG_DEBUG, "copy from user failed\n");
 
-               LOG(LOG_DEBUG, "sizeof(gs)=%ld, magic=%d\n",
+               LOG(LOG_DEBUG, "sizeof(gs)=%zu, magic=%d\n",
                                sizeof(*gs), gs->magic);
 
                //configure gdc config, buffer address and resolution
index 6d6c6e9ecd4574187ac6036a3fde2b105995ca04..ecf02eb5a7e3660fab5ab459e3551d9492158e8a 100644 (file)
@@ -453,7 +453,7 @@ static ssize_t osd_dump_read_file(struct file *file,
        char __iomem *buf;
        struct seq_file *s = file->private_data;
        int osd_id = *(int *)s;
-       ssize_t len;
+       unsigned long len;
 
        osd_restore_screen_info(osd_id, &buf, &len);
        if (buf && len)
index 7422400ec5489718614ab1e46769a85a21d4e1d3..7fed76af55fd0272e60a1ce06548bd8d74d2ef34 100644 (file)
@@ -1183,8 +1183,8 @@ static int malloc_osd_memory(struct fb_info *info)
        size = fb_rmem.size;
 #endif
 
-       osd_log_info("%s, %d, base:%llx, size:%ld\n",
-               __func__, __LINE__, base, size);
+       osd_log_info("%s, %d, base:%pa, size:%ld\n",
+               __func__, __LINE__, &base, size);
        fbdev = (struct osd_fb_dev_s *)info->par;
        pdev = fbdev->dev;
        fb_index = fbdev->fb_index;
@@ -1214,7 +1214,7 @@ static int malloc_osd_memory(struct fb_info *info)
                                + fb_memsize[1] + fb_memsize[2]
                                + fb_memsize[3];
                }
-               pr_info("%s, %d, fb_index=%d,fb_rmem_size=%ld\n",
+               pr_info("%s, %d, fb_index=%d,fb_rmem_size=%zu\n",
                        __func__, __LINE__, fb_index,
                        fb_rmem_size[fb_index]);
                if ((fb_rmem_paddr[fb_index] > 0) &&
@@ -1242,7 +1242,7 @@ static int malloc_osd_memory(struct fb_info *info)
                                        >> PAGE_SHIFT,
                                        0);
                                if (!osd_page[fb_index+1]) {
-                                       pr_err("allocate buffer failed:%ld\n",
+                                       pr_err("allocate buffer failed:%zu\n",
                                                fb_rmem_size[fb_index]);
                                        return -ENOMEM;
                                }
@@ -1266,7 +1266,7 @@ static int malloc_osd_memory(struct fb_info *info)
                                osd_log_err("fb[%d] ioremap error", fb_index);
                        pr_info("%s, reserved mem\n", __func__);
 #endif
-                       osd_log_dbg("fb_index=%d dma_alloc=%ld\n",
+                       osd_log_dbg("fb_index=%d dma_alloc=%zu\n",
                                fb_index, fb_rmem_size[fb_index]);
                }
        } else {
@@ -1304,7 +1304,7 @@ static int malloc_osd_memory(struct fb_info *info)
                                        fb_ion_client,
                                        fb_ion_handle[fb_index][j]);
                                dev_alert(&pdev->dev,
-                                       "ion memory(%d): created fb at 0x%p, size %ld MiB\n",
+                                       "ion memory(%d): created fb at 0x%p, size %lu MiB\n",
                                        fb_index,
                                        (void *)fb_rmem_afbc_paddr
                                        [fb_index][j],
@@ -1487,7 +1487,7 @@ static int osd_open(struct fb_info *info, int arg)
                fix = &info->fix;
 
                fb_rmem_size[fb_index] = fb_memsize[fb_index + 1];
-               pr_info("%s, %d, fb_index=%d,fb_rmem_size=%ld\n",
+               pr_info("%s, %d, fb_index=%d,fb_rmem_size=%zu\n",
                        __func__, __LINE__, fb_index, fb_rmem_size[fb_index]);
 
                fix->smem_start = 0;
@@ -3481,6 +3481,7 @@ static int osd_probe(struct platform_device *pdev)
        const char *str;
        #ifdef CONFIG_CMA
        struct cma *cma;
+       phys_addr_t base_addr;
        #endif
        int i;
        int ret = 0;
@@ -3569,9 +3570,10 @@ static int osd_probe(struct platform_device *pdev)
                b_reserved_mem = true;
 #ifdef CONFIG_CMA
                cma = dev_get_cma_area(&pdev->dev);
+               base_addr = cma_get_base(cma);
                if (cma) {
-                       pr_info("reserved memory base:%llx, size:%lx\n",
-                               cma_get_base(cma), cma_get_size(cma));
+                       pr_info("reserved memory base:%pa, size:%lx\n",
+                               &base_addr, cma_get_size(cma));
                        if (fb_memsize[0] > 0) {
                                osd_page[0] = dma_alloc_from_contiguous(
                                        &pdev->dev,
index ab6f8b44ade1690aee6315d641c3c0ce1406333b..0d499fc156b8a00a40431bb050df3f8519e1c524 100644 (file)
@@ -6730,7 +6730,7 @@ static void osd_basic_update_disp_geometry(u32 index)
 
        if (osd_hw.osd_meson_dev.afbc_type == MALI_AFBC) {
                if (osd_hw.osd_afbcd[index].enable) {
-                       long int headr_addr, out_addr;
+                       u64 headr_addr, out_addr;
 
                        /* set frame addr in linear: out_addr_id */
                        headr_addr = osd_hw.osd_afbcd[index].phy_addr;
index 3a9d69aceae2e29b3e1343748a1e3aaac2ecda71..dc45d7568e61bb303768d6148ff2eebb6932715c 100644 (file)
@@ -232,7 +232,7 @@ static void init_656in_dec_hdmi_parameter(struct am656in_dev_s *devp)
 
 static void reset_bt656in_module(struct am656in_dev_s *devp)
 {
-       int temp_data;
+       int temp_data = 0;
        unsigned int offset = devp->index;
 
        temp_data = bt656_rd(offset, BT_CTRL);
index edbf2a1fcc0bd8d13847d117069c9f0fdd372461..f1ac368d483da2e42ff370d99f74b8a0b1d2947a 100644 (file)
@@ -263,7 +263,7 @@ static int bt656_reg_write(u32 index, unsigned int reg, unsigned int val)
 
 static inline uint32_t bt656_rd(u32 index, uint32_t reg)
 {
-       int val;
+       int val = 0;
 
        bt656_reg_read(index, (reg<<2), &val);
        return val;
index 64aa8909adc19c8eb37362a747ae2f49ea4ae6da..2ce1c0f2c5974e873eda294682c4bc5b31adff42 100644 (file)
@@ -46,7 +46,7 @@
 #define F_OSC_28_3
 #ifdef F_OSC_28_3
 /* XCLOCK is used for measureament of Vertical Refreshment Rate */
-#define SII_XCLOCK_OSC_SCALED_AND_MUL100 (2810073437)
+#define SII_XCLOCK_OSC_SCALED_AND_MUL100 (2810073437u)
 /*   ( F_OSC * 100  * 1016 ) / 1024
  * where  F_OSC = 28322000
  */
@@ -55,7 +55,7 @@
 /* ((F_OSC * 1016 )/1000) */
 
 
-#define SII_XCLOCK_OSC_SCALED2047_AND_MUL100 (2832200000)
+#define SII_XCLOCK_OSC_SCALED2047_AND_MUL100 (2832200000u)
 /* F_OSC * 100 where F_OSC = 28322000 */
 #define SII_XCLOCK_OSC_SCALED2047_FOR_CALK_FPIX (464027)
 /* ( (F_OSC * 16384 )/1000000) to yield units of MHz for pixel clock */
@@ -63,7 +63,7 @@
 #else
 
 /* XCLOCK is used for measureament of Vertical Refreshment Rate */
-#define SII_XCLOCK_OSC_SCALED_AND_MUL100 (2679233671)
+#define SII_XCLOCK_OSC_SCALED_AND_MUL100 (2679233671u)
 /*   ( F_OSC * 100  * 1016 ) / 1024
  * where  F_OSC = 27003300
  */
index 6c185f0c05cb8d75b545577aaf04762f717b06ca..d11d59d2e50f01dd77da3f24135a4e8338a3fc9a 100644 (file)
@@ -660,7 +660,7 @@ void aml_nand_get_read_default_value_hynix(struct mtd_info *mtd)
                        (addr + page_list[i]*mtd->writesize), &aml_oob_ops);
                        aml_chip->new_nand_info.type = nand_type;
                        if ((error != 0) && (error != -EUCLEAN)) {
-                               pr_info("%s %d read failed at blk:%ld pg:%ld\n",
+                               pr_info("%s %d read failed at blk:%zu pg:%zu\n",
                                        __func__, __LINE__,
                                        addr >> phys_erase_shift,
                        (addr + page_list[i]*mtd->writesize) / mtd->writesize);
@@ -766,7 +766,7 @@ void aml_nand_save_read_default_value_hynix(struct mtd_info *mtd)
        while (total_blk < RETRY_NAND_BLK_NUM) {
                error = mtd->_block_isbad(mtd, addr);
                if (error) {
-                       pr_info("%s %d detect bad blk at blk:%ld\n",
+                       pr_info("%s %d detect bad blk at blk:%zu\n",
                                __func__, __LINE__, addr >> phys_erase_shift);
                        addr += mtd->erasesize;
                        total_blk++;
@@ -780,7 +780,7 @@ void aml_nand_save_read_default_value_hynix(struct mtd_info *mtd)
 
                error = mtd->_erase(mtd, &erase_info_read);
                if (error) {
-                       pr_info("%s %d erase failed at blk:%ld\n",
+                       pr_info("%s %d erase failed at blk:%zu\n",
                                __func__, __LINE__, addr >> phys_erase_shift);
                        mtd->_block_markbad(mtd, addr);
                        addr += mtd->erasesize;
@@ -826,7 +826,7 @@ void aml_nand_save_read_default_value_hynix(struct mtd_info *mtd)
                                        (addr/mtd->writesize)+i);
 
                        if (error) {
-                               pr_info("%s %d write failed blk:%ld page:%ld\n",
+                               pr_info("%s %d write failed blk:%zu page:%zu\n",
                                        __func__, __LINE__,
                                        addr >> phys_erase_shift,
                (addr + page_list[i] * mtd->writesize) / mtd->writesize);
index aaf00830aaf730f261e1228d7d6d499aebe2a32a..1fcd997eeb5b8dc7bb452cff6e43895728499882 100644 (file)
@@ -569,7 +569,7 @@ static void spicc_dma_unmap(struct spicc *spicc, struct spi_transfer *t)
 static int spicc_dma_xfer(struct spicc *spicc, struct spi_transfer *t)
 {
        void __iomem *mem_base = spicc->regs;
-       int ret;
+       int ret = 0;
 
        spicc_reset_fifo(spicc);
        setb(mem_base, CON_XCH, 0);
index d943cc25608c1baf760d1259bdde91fe6a9b2f47..40f9edebb1195a2507a8580578c9d284d13748bf 100644 (file)
@@ -157,8 +157,9 @@ static int __init __reserved_mem_alloc_size(unsigned long node,
 
                #ifdef CONFIG_AMLOGIC_MODIFY
                #ifdef CONFIG_PHYS_ADDR_T_64BIT
-                       pr_info("%s, start:%llx, end:%llx, len:%llx\n",
-                               __func__, start, end, end - start);
+                       pr_info("%s, start:%pa, end:%pa, len:%ld MiB\n",
+                               __func__, &start, &end,
+                               (unsigned long)((end - start)/SZ_1M));
                #endif
                #endif /* CONFIG_AMLOGIC_MODIFY */
                        ret = early_init_dt_alloc_reserved_memory_arch(size,