diff options
author | Marek Szyprowski <m.szyprowski@samsung.com> | 2015-05-28 14:11:47 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-06-05 12:37:24 +0300 |
commit | 1d03deff82671ae2c6a7ce9e75b69e5e334c0d04 (patch) | |
tree | 334fbf249446ff981fca6b1cd3f3bad417c70bc4 /drivers/media/platform | |
parent | e9763995e71020c55ec877da4f3444abc47e9ce2 (diff) | |
download | linux-1d03deff82671ae2c6a7ce9e75b69e5e334c0d04.tar.xz |
[media] media: s5p-mfc: fix sparse warnings
Commits a0f10c131cc49d7d84394beb7903e1f246331224 and
6c9fe765360efa97c63b89af685b620baf5e0012 ("media: s5p-mfc: fix broken
pointer cast on 64bit arch") fixed issue with lossy cast on 64-bit
architectures. However it also removed __iomem attribute from that cast.
This leads to sparse warnings. This patch fixes those warnings by adding
__iomem cast in case of v6+ code version and replacing readl/writel by
simple u32 load/store operations in case of v5 code (which is called on
system memory allocated by dma_alloc_coherent() instead of io registers).
Reported-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r-- | drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c | 4 | ||||
-rw-r--r-- | drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c index c7adc3d26792..9a923b1a9bac 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c @@ -263,7 +263,7 @@ static void s5p_mfc_release_dev_context_buffer_v5(struct s5p_mfc_dev *dev) static void s5p_mfc_write_info_v5(struct s5p_mfc_ctx *ctx, unsigned int data, unsigned int ofs) { - writel(data, (void *)(ctx->shm.virt + ofs)); + *(u32 *)(ctx->shm.virt + ofs) = data; wmb(); } @@ -271,7 +271,7 @@ static unsigned int s5p_mfc_read_info_v5(struct s5p_mfc_ctx *ctx, unsigned long ofs) { rmb(); - return readl((void *)(ctx->shm.virt + ofs)); + return *(u32 *)(ctx->shm.virt + ofs); } static void s5p_mfc_dec_calc_dpb_size_v5(struct s5p_mfc_ctx *ctx) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c index cefad184fe96..12497f5ed8e9 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c @@ -1852,7 +1852,7 @@ static void s5p_mfc_write_info_v6(struct s5p_mfc_ctx *ctx, unsigned int data, unsigned int ofs) { s5p_mfc_clock_on(); - writel(data, (void *)((unsigned long)ofs)); + writel(data, (void __iomem *)((unsigned long)ofs)); s5p_mfc_clock_off(); } @@ -1862,7 +1862,7 @@ s5p_mfc_read_info_v6(struct s5p_mfc_ctx *ctx, unsigned long ofs) int ret; s5p_mfc_clock_on(); - ret = readl((void *)ofs); + ret = readl((void __iomem *)ofs); s5p_mfc_clock_off(); return ret; |