From a122e7c9ce1d04c4e63ae4d8b894bb4bbda831ae Mon Sep 17 00:00:00 2001 From: Ao Xu Date: Wed, 1 Aug 2018 16:48:16 +0800 Subject: [PATCH] board: solve 32bit printk type error 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 --- drivers/amlogic/i2c/aml_slave.c | 2 +- drivers/amlogic/input/keyboard/adc_keypad.c | 2 +- drivers/amlogic/media/common/codec_mm/codec_mm.c | 6 +++--- drivers/amlogic/media/common/ion_dev/dev_ion.c | 2 +- .../enhancement/amdolby_vision/amdolby_vision.c | 2 +- drivers/amlogic/media/gdc/app/gdc_module.c | 2 +- drivers/amlogic/media/osd/osd_drm.c | 2 +- drivers/amlogic/media/osd/osd_fb.c | 20 +++++++++++--------- drivers/amlogic/media/osd/osd_hw.c | 2 +- drivers/amlogic/media/vin/tvin/bt656/bt656_601_in.c | 2 +- drivers/amlogic/media/vin/tvin/bt656/bt656_601_in.h | 2 +- .../vin/tvin/hdmirx_ext/hw_sii9135/SiICmplDefs.h | 6 +++--- drivers/amlogic/mtd/new_nand.c | 8 ++++---- drivers/amlogic/spicc/spicc.c | 2 +- drivers/of/of_reserved_mem.c | 5 +++-- 15 files changed, 34 insertions(+), 31 deletions(-) diff --git a/drivers/amlogic/i2c/aml_slave.c b/drivers/amlogic/i2c/aml_slave.c index cad76fd..e6cd323 100644 --- a/drivers/amlogic/i2c/aml_slave.c +++ b/drivers/amlogic/i2c/aml_slave.c @@ -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); diff --git a/drivers/amlogic/input/keyboard/adc_keypad.c b/drivers/amlogic/input/keyboard/adc_keypad.c index 6c61fb7..0b9f7af 100644 --- a/drivers/amlogic/input/keyboard/adc_keypad.c +++ b/drivers/amlogic/input/keyboard/adc_keypad.c @@ -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; } diff --git a/drivers/amlogic/media/common/codec_mm/codec_mm.c b/drivers/amlogic/media/common/codec_mm/codec_mm.c index 5646d853..7bc3321 100644 --- a/drivers/amlogic/media/common/codec_mm/codec_mm.c +++ b/drivers/amlogic/media/common/codec_mm/codec_mm.c @@ -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) { diff --git a/drivers/amlogic/media/common/ion_dev/dev_ion.c b/drivers/amlogic/media/common/ion_dev/dev_ion.c index f317673..50fb98f 100644 --- a/drivers/amlogic/media/common/ion_dev/dev_ion.c +++ b/drivers/amlogic/media/common/ion_dev/dev_ion.c @@ -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; diff --git a/drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c b/drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c index c484708..1ccdeda 100644 --- a/drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c +++ b/drivers/amlogic/media/enhancement/amdolby_vision/amdolby_vision.c @@ -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], diff --git a/drivers/amlogic/media/gdc/app/gdc_module.c b/drivers/amlogic/media/gdc/app/gdc_module.c index b0de1c6..25cc827 100644 --- a/drivers/amlogic/media/gdc/app/gdc_module.c +++ b/drivers/amlogic/media/gdc/app/gdc_module.c @@ -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 diff --git a/drivers/amlogic/media/osd/osd_drm.c b/drivers/amlogic/media/osd/osd_drm.c index 6d6c6e9..ecf02eb 100644 --- a/drivers/amlogic/media/osd/osd_drm.c +++ b/drivers/amlogic/media/osd/osd_drm.c @@ -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) diff --git a/drivers/amlogic/media/osd/osd_fb.c b/drivers/amlogic/media/osd/osd_fb.c index 7422400..7fed76a 100644 --- a/drivers/amlogic/media/osd/osd_fb.c +++ b/drivers/amlogic/media/osd/osd_fb.c @@ -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, diff --git a/drivers/amlogic/media/osd/osd_hw.c b/drivers/amlogic/media/osd/osd_hw.c index ab6f8b4..0d499fc 100644 --- a/drivers/amlogic/media/osd/osd_hw.c +++ b/drivers/amlogic/media/osd/osd_hw.c @@ -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; diff --git a/drivers/amlogic/media/vin/tvin/bt656/bt656_601_in.c b/drivers/amlogic/media/vin/tvin/bt656/bt656_601_in.c index 3a9d69a..dc45d75 100644 --- a/drivers/amlogic/media/vin/tvin/bt656/bt656_601_in.c +++ b/drivers/amlogic/media/vin/tvin/bt656/bt656_601_in.c @@ -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); diff --git a/drivers/amlogic/media/vin/tvin/bt656/bt656_601_in.h b/drivers/amlogic/media/vin/tvin/bt656/bt656_601_in.h index edbf2a1..f1ac368 100644 --- a/drivers/amlogic/media/vin/tvin/bt656/bt656_601_in.h +++ b/drivers/amlogic/media/vin/tvin/bt656/bt656_601_in.h @@ -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; diff --git a/drivers/amlogic/media/vin/tvin/hdmirx_ext/hw_sii9135/SiICmplDefs.h b/drivers/amlogic/media/vin/tvin/hdmirx_ext/hw_sii9135/SiICmplDefs.h index 64aa890..2ce1c0f 100644 --- a/drivers/amlogic/media/vin/tvin/hdmirx_ext/hw_sii9135/SiICmplDefs.h +++ b/drivers/amlogic/media/vin/tvin/hdmirx_ext/hw_sii9135/SiICmplDefs.h @@ -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 */ diff --git a/drivers/amlogic/mtd/new_nand.c b/drivers/amlogic/mtd/new_nand.c index 6c185f0..d11d59d 100644 --- a/drivers/amlogic/mtd/new_nand.c +++ b/drivers/amlogic/mtd/new_nand.c @@ -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); diff --git a/drivers/amlogic/spicc/spicc.c b/drivers/amlogic/spicc/spicc.c index aaf0083..1fcd997 100644 --- a/drivers/amlogic/spicc/spicc.c +++ b/drivers/amlogic/spicc/spicc.c @@ -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); diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c index d943cc2..40f9ede 100644 --- a/drivers/of/of_reserved_mem.c +++ b/drivers/of/of_reserved_mem.c @@ -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, -- 2.7.4