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 <ao.xu@amlogic.com>
This commit is contained in:
Ao Xu
2018-08-01 16:48:16 +08:00
committed by Yixun Lan
parent b5aba319aa
commit a122e7c9ce
15 changed files with 34 additions and 31 deletions

View 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);

View 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;
}

View 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) {

View 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;

View 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],

View 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

View 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)

View 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,

View 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;

View 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);

View 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;

View 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
*/

View 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);

View 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);

View 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,