* [PATCH -next] drm/nouveau/disp: fix cast removes address space of expression warnings
@ 2022-09-24 9:25 ruanjinjie
2022-10-12 22:48 ` Lyude Paul
2022-10-12 22:48 ` Lyude Paul
0 siblings, 2 replies; 3+ messages in thread
From: ruanjinjie @ 2022-09-24 9:25 UTC (permalink / raw)
To: bskeggs, kherbst, lyude, airlied, linux-kernel, daniel,
jani.nikula, airlied, tzimmermann, hverkuil-cisco, greenfoo,
seanpaul, dri-devel, nouveau
Cc: ruanjinjie
When build Linux kernel with 'make C=2', encounter the following warnings:
./drivers/gpu/drm/nouveau/dispnv50/disp.c:134:34: warning: cast removes address space '__iomem' of expression
./drivers/gpu/drm/nouveau/dispnv50/disp.c:197:34: warning: cast removes address space '__iomem' of expression
The data type of dmac->_push.mem.object.map.ptr is 'void __iomem *', but
converted to 'u32 *' directly and cause above warnings, now
recover their data types to fix these warnings.
Signed-off-by: ruanjinjie <ruanjinjie@huawei.com>
---
drivers/gpu/drm/nouveau/dispnv50/disp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
index 33c97d510999..aa94f8e284dd 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
@@ -131,7 +131,7 @@ nv50_dmac_kick(struct nvif_push *push)
{
struct nv50_dmac *dmac = container_of(push, typeof(*dmac), _push);
- dmac->cur = push->cur - (u32 *)dmac->_push.mem.object.map.ptr;
+ dmac->cur = push->cur - (u32 __iomem *)dmac->_push.mem.object.map.ptr;
if (dmac->put != dmac->cur) {
/* Push buffer fetches are not coherent with BAR1, we need to ensure
* writes have been flushed right through to VRAM before writing PUT.
@@ -194,7 +194,7 @@ nv50_dmac_wait(struct nvif_push *push, u32 size)
if (WARN_ON(size > dmac->max))
return -EINVAL;
- dmac->cur = push->cur - (u32 *)dmac->_push.mem.object.map.ptr;
+ dmac->cur = push->cur - (u32 __iomem *)dmac->_push.mem.object.map.ptr;
if (dmac->cur + size >= dmac->max) {
int ret = nv50_dmac_wind(dmac);
if (ret)
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next] drm/nouveau/disp: fix cast removes address space of expression warnings
2022-09-24 9:25 [PATCH -next] drm/nouveau/disp: fix cast removes address space of expression warnings ruanjinjie
@ 2022-10-12 22:48 ` Lyude Paul
2022-10-12 22:48 ` Lyude Paul
1 sibling, 0 replies; 3+ messages in thread
From: Lyude Paul @ 2022-10-12 22:48 UTC (permalink / raw)
To: ruanjinjie, bskeggs, kherbst, airlied, linux-kernel, daniel,
jani.nikula, airlied, tzimmermann, hverkuil-cisco, greenfoo,
seanpaul, dri-devel, nouveau
Looks good to me (sorry for the slow response! I think this one just got lost
in the noise). Will push to drm-misc-next in a moment
On Sat, 2022-09-24 at 17:25 +0800, ruanjinjie wrote:
> When build Linux kernel with 'make C=2', encounter the following warnings:
>
> ./drivers/gpu/drm/nouveau/dispnv50/disp.c:134:34: warning: cast removes address space '__iomem' of expression
> ./drivers/gpu/drm/nouveau/dispnv50/disp.c:197:34: warning: cast removes address space '__iomem' of expression
>
> The data type of dmac->_push.mem.object.map.ptr is 'void __iomem *', but
> converted to 'u32 *' directly and cause above warnings, now
> recover their data types to fix these warnings.
>
> Signed-off-by: ruanjinjie <ruanjinjie@huawei.com>
> ---
> drivers/gpu/drm/nouveau/dispnv50/disp.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> index 33c97d510999..aa94f8e284dd 100644
> --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
> +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> @@ -131,7 +131,7 @@ nv50_dmac_kick(struct nvif_push *push)
> {
> struct nv50_dmac *dmac = container_of(push, typeof(*dmac), _push);
>
> - dmac->cur = push->cur - (u32 *)dmac->_push.mem.object.map.ptr;
> + dmac->cur = push->cur - (u32 __iomem *)dmac->_push.mem.object.map.ptr;
> if (dmac->put != dmac->cur) {
> /* Push buffer fetches are not coherent with BAR1, we need to ensure
> * writes have been flushed right through to VRAM before writing PUT.
> @@ -194,7 +194,7 @@ nv50_dmac_wait(struct nvif_push *push, u32 size)
> if (WARN_ON(size > dmac->max))
> return -EINVAL;
>
> - dmac->cur = push->cur - (u32 *)dmac->_push.mem.object.map.ptr;
> + dmac->cur = push->cur - (u32 __iomem *)dmac->_push.mem.object.map.ptr;
> if (dmac->cur + size >= dmac->max) {
> int ret = nv50_dmac_wind(dmac);
> if (ret)
--
Cheers,
Lyude Paul (she/her)
Software Engineer at Red Hat
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] drm/nouveau/disp: fix cast removes address space of expression warnings
2022-09-24 9:25 [PATCH -next] drm/nouveau/disp: fix cast removes address space of expression warnings ruanjinjie
2022-10-12 22:48 ` Lyude Paul
@ 2022-10-12 22:48 ` Lyude Paul
1 sibling, 0 replies; 3+ messages in thread
From: Lyude Paul @ 2022-10-12 22:48 UTC (permalink / raw)
To: ruanjinjie, bskeggs, kherbst, airlied, linux-kernel, daniel,
jani.nikula, airlied, tzimmermann, hverkuil-cisco, greenfoo,
seanpaul, dri-devel, nouveau
...oops, totally forgot to actually give you the magic tag so patchwork knows
I reviewed it:
Reviewed-by: Lyude Paul <lyude@redhat.com>
On Sat, 2022-09-24 at 17:25 +0800, ruanjinjie wrote:
> When build Linux kernel with 'make C=2', encounter the following warnings:
>
> ./drivers/gpu/drm/nouveau/dispnv50/disp.c:134:34: warning: cast removes address space '__iomem' of expression
> ./drivers/gpu/drm/nouveau/dispnv50/disp.c:197:34: warning: cast removes address space '__iomem' of expression
>
> The data type of dmac->_push.mem.object.map.ptr is 'void __iomem *', but
> converted to 'u32 *' directly and cause above warnings, now
> recover their data types to fix these warnings.
>
> Signed-off-by: ruanjinjie <ruanjinjie@huawei.com>
> ---
> drivers/gpu/drm/nouveau/dispnv50/disp.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> index 33c97d510999..aa94f8e284dd 100644
> --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
> +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
> @@ -131,7 +131,7 @@ nv50_dmac_kick(struct nvif_push *push)
> {
> struct nv50_dmac *dmac = container_of(push, typeof(*dmac), _push);
>
> - dmac->cur = push->cur - (u32 *)dmac->_push.mem.object.map.ptr;
> + dmac->cur = push->cur - (u32 __iomem *)dmac->_push.mem.object.map.ptr;
> if (dmac->put != dmac->cur) {
> /* Push buffer fetches are not coherent with BAR1, we need to ensure
> * writes have been flushed right through to VRAM before writing PUT.
> @@ -194,7 +194,7 @@ nv50_dmac_wait(struct nvif_push *push, u32 size)
> if (WARN_ON(size > dmac->max))
> return -EINVAL;
>
> - dmac->cur = push->cur - (u32 *)dmac->_push.mem.object.map.ptr;
> + dmac->cur = push->cur - (u32 __iomem *)dmac->_push.mem.object.map.ptr;
> if (dmac->cur + size >= dmac->max) {
> int ret = nv50_dmac_wind(dmac);
> if (ret)
--
Cheers,
Lyude Paul (she/her)
Software Engineer at Red Hat
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-10-12 22:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-24 9:25 [PATCH -next] drm/nouveau/disp: fix cast removes address space of expression warnings ruanjinjie
2022-10-12 22:48 ` Lyude Paul
2022-10-12 22:48 ` Lyude Paul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).