Skip to content

Commit 4966bac

Browse files
committed
[media] s5p_mfc_opr_v6: get rid of warnings when compiled with 64 bits
There are several errors related to size_t size and the usage of unsigned int for pointers: drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c: In function ‘s5p_mfc_alloc_codec_buffers_v6’: drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c:103:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t’ [-Wformat=] mfc_debug(2, "recon luma size: %d chroma size: %d\n", ^ drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c:103:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ [-Wformat=] drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c: In function ‘s5p_mfc_set_dec_frame_buffer_v6’: drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c:472:3: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 5 has type ‘size_t’ [-Wformat=] mfc_debug(2, "Luma %d: %x\n", i, ^ drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c:476:3: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 5 has type ‘size_t’ [-Wformat=] mfc_debug(2, "\tChroma %d: %x\n", i, ^ drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c:490:4: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘size_t’ [-Wformat=] mfc_debug(2, "\tBuf1: %x, size: %d\n", ^ drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c:498:2: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘size_t’ [-Wformat=] mfc_debug(2, "Buf1: %u, buf_size1: %d (frames %d)\n", ^ drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c: In function ‘s5p_mfc_set_enc_ref_buffer_v6’: drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c:596:2: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘size_t’ [-Wformat=] mfc_debug(2, "Buf1: %u, buf_size1: %d (ref frames %d)\n", ^ drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c: In function ‘s5p_mfc_write_info_v6’: drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c:1883:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] writel(data, (volatile void __iomem *)ofs); ^ drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c: In function ‘s5p_mfc_read_info_v6’: drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c:1893:14: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] ret = readl((volatile void __iomem *)ofs); ^ drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c: In function ‘s5p_mfc_get_pic_type_top_v6’: drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c:2022:3: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] (__force unsigned int) ctx->dev->mfc_regs->d_ret_picture_tag_top); ^ drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c: In function ‘s5p_mfc_get_pic_type_bot_v6’: drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c:2028:3: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] (__force unsigned int) ctx->dev->mfc_regs->d_ret_picture_tag_bot); ^ drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c: In function ‘s5p_mfc_get_crop_info_h_v6’: drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c:2034:3: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] (__force unsigned int) ctx->dev->mfc_regs->d_display_crop_info1); ^ drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c: In function ‘s5p_mfc_get_crop_info_v_v6’: drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c:2040:3: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] (__force unsigned int) ctx->dev->mfc_regs->d_display_crop_info2); Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
1 parent e13f7d5 commit 4966bac

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

‎drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ static int s5p_mfc_alloc_codec_buffers_v6(struct s5p_mfc_ctx *ctx)
100100
mb_width, mb_height),
101101
S5P_FIMV_ME_BUFFER_ALIGN_V6);
102102

103-
mfc_debug(2, "recon luma size: %d chroma size: %d\n",
103+
mfc_debug(2, "recon luma size: %zd chroma size: %zd\n",
104104
ctx->luma_dpb_size, ctx->chroma_dpb_size);
105105
} else {
106106
return -EINVAL;
@@ -469,11 +469,11 @@ static int s5p_mfc_set_dec_frame_buffer_v6(struct s5p_mfc_ctx *ctx)
469469

470470
for (i = 0; i < ctx->total_dpb_count; i++) {
471471
/* Bank2 */
472-
mfc_debug(2, "Luma %d: %x\n", i,
472+
mfc_debug(2, "Luma %d: %zx\n", i,
473473
ctx->dst_bufs[i].cookie.raw.luma);
474474
writel(ctx->dst_bufs[i].cookie.raw.luma,
475475
mfc_regs->d_first_plane_dpb + i * 4);
476-
mfc_debug(2, "\tChroma %d: %x\n", i,
476+
mfc_debug(2, "\tChroma %d: %zx\n", i,
477477
ctx->dst_bufs[i].cookie.raw.chroma);
478478
writel(ctx->dst_bufs[i].cookie.raw.chroma,
479479
mfc_regs->d_second_plane_dpb + i * 4);
@@ -487,15 +487,15 @@ static int s5p_mfc_set_dec_frame_buffer_v6(struct s5p_mfc_ctx *ctx)
487487
align_gap = buf_addr1 - align_gap;
488488
buf_size1 -= align_gap;
489489

490-
mfc_debug(2, "\tBuf1: %x, size: %d\n",
490+
mfc_debug(2, "\tBuf1: %zx, size: %d\n",
491491
buf_addr1, buf_size1);
492492
writel(buf_addr1, mfc_regs->d_mv_buffer + i * 4);
493493
buf_addr1 += frame_size_mv;
494494
buf_size1 -= frame_size_mv;
495495
}
496496
}
497497

498-
mfc_debug(2, "Buf1: %u, buf_size1: %d (frames %d)\n",
498+
mfc_debug(2, "Buf1: %zu, buf_size1: %d (frames %d)\n",
499499
buf_addr1, buf_size1, ctx->total_dpb_count);
500500
if (buf_size1 < 0) {
501501
mfc_debug(2, "Not enough memory has been allocated.\n");
@@ -593,7 +593,7 @@ static int s5p_mfc_set_enc_ref_buffer_v6(struct s5p_mfc_ctx *ctx)
593593
buf_addr1 += ctx->tmv_buffer_size >> 1;
594594
buf_size1 -= ctx->tmv_buffer_size;
595595

596-
mfc_debug(2, "Buf1: %u, buf_size1: %d (ref frames %d)\n",
596+
mfc_debug(2, "Buf1: %zu, buf_size1: %d (ref frames %d)\n",
597597
buf_addr1, buf_size1, ctx->pb_count);
598598
if (buf_size1 < 0) {
599599
mfc_debug(2, "Not enough memory has been allocated.\n");
@@ -1880,7 +1880,7 @@ static void s5p_mfc_write_info_v6(struct s5p_mfc_ctx *ctx, unsigned int data,
18801880
unsigned int ofs)
18811881
{
18821882
s5p_mfc_clock_on();
1883-
writel(data, (volatile void __iomem *)ofs);
1883+
writel(data, (volatile void __iomem *)((unsigned long)ofs));
18841884
s5p_mfc_clock_off();
18851885
}
18861886

@@ -1890,7 +1890,7 @@ s5p_mfc_read_info_v6(struct s5p_mfc_ctx *ctx, unsigned int ofs)
18901890
int ret;
18911891

18921892
s5p_mfc_clock_on();
1893-
ret = readl((volatile void __iomem *)ofs);
1893+
ret = readl((volatile void __iomem *)((unsigned long)ofs));
18941894
s5p_mfc_clock_off();
18951895

18961896
return ret;
@@ -2019,25 +2019,25 @@ static int s5p_mfc_get_mvc_view_id_v6(struct s5p_mfc_dev *dev)
20192019
static unsigned int s5p_mfc_get_pic_type_top_v6(struct s5p_mfc_ctx *ctx)
20202020
{
20212021
return s5p_mfc_read_info_v6(ctx,
2022-
(__force unsigned int) ctx->dev->mfc_regs->d_ret_picture_tag_top);
2022+
(__force unsigned long) ctx->dev->mfc_regs->d_ret_picture_tag_top);
20232023
}
20242024

20252025
static unsigned int s5p_mfc_get_pic_type_bot_v6(struct s5p_mfc_ctx *ctx)
20262026
{
20272027
return s5p_mfc_read_info_v6(ctx,
2028-
(__force unsigned int) ctx->dev->mfc_regs->d_ret_picture_tag_bot);
2028+
(__force unsigned long) ctx->dev->mfc_regs->d_ret_picture_tag_bot);
20292029
}
20302030

20312031
static unsigned int s5p_mfc_get_crop_info_h_v6(struct s5p_mfc_ctx *ctx)
20322032
{
20332033
return s5p_mfc_read_info_v6(ctx,
2034-
(__force unsigned int) ctx->dev->mfc_regs->d_display_crop_info1);
2034+
(__force unsigned long) ctx->dev->mfc_regs->d_display_crop_info1);
20352035
}
20362036

20372037
static unsigned int s5p_mfc_get_crop_info_v_v6(struct s5p_mfc_ctx *ctx)
20382038
{
20392039
return s5p_mfc_read_info_v6(ctx,
2040-
(__force unsigned int) ctx->dev->mfc_regs->d_display_crop_info2);
2040+
(__force unsigned long) ctx->dev->mfc_regs->d_display_crop_info2);
20412041
}
20422042

20432043
static struct s5p_mfc_regs mfc_regs;

0 commit comments

Comments
 (0)