drm/nouveau: fence: fix type cast warning in nouveau_fence_emit()
Subsystems (3)
PATCH 1/1 drm/nouveau: fence: fix type cast warning in nouveau_fence_emit()
Fix the following warning.
drivers/gpu/drm/nouveau/nouveau_fence.c:210:45: sparse: sparse:
incorrect type in initializer (different address spaces)
@@ expected struct nouveau_channel *chan
@@ got struct nouveau_channel [noderef] __rcu *channel
We're just about to emit the fence, there is nothing to protect against yet, hence it is safe to just cast __rcu away.
--- drivers/gpu/drm/nouveau/nouveau_fence.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nouveau_fence.c +1 -1
@@ -207,7 +207,7 @@ nouveau_fence_context_new(struct nouveau_channel *chan, struct nouveau_fence_chaint nouveau_fence_emit (struct nouveau_fence *fence) { -struct nouveau_channel *chan = fence->channel; +struct nouveau_channel *chan =unrcu_pointer (fence->channel);struct nouveau_fence_chan *fctx = chan->fence;struct nouveau_fence_priv *priv = (void *)chan->drm->fence;int ret;
Signature · 1 line
2.41.0
Quoted 7 lines · Danilo Krummrich
Fix the following warning.
drivers/gpu/drm/nouveau/nouveau_fence.c:210:45: sparse: sparse:
incorrect type in initializer (different address spaces)
@@ expected structnouveau_channel*chan
@@ got structnouveau_channel[noderef]__rcu*channel
Quoted 28 lines
We're just about to emit the fence, there is nothing to protect against yet, hence it is safe to just cast
__rcuaway.Reported-by kernel test robot <[email protected]>Fixes 978474dc8278 ("drm/nouveau: fence: fix undefined fence state after emit")Signed-off-by Danilo Krummrich <[email protected]>--- drivers/gpu/drm/nouveau/nouveau_fence.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/nouveau/nouveau_fence.c +1
-2@@ -207,7 +207,7 @@ nouveau_fence_context_new(struct nouveau_channel *chan, struct nouveau_fence_chaint nouveau_fence_emit (struct nouveau_fence *fence) { -struct nouveau_channel *chan = fence->channel; +struct nouveau_channel *chan =unrcu_pointer (fence->channel);struct nouveau_fence_chan *fctx = chan->fence;struct nouveau_fence_priv *priv = (void *)chan->drm->fence;int ret; --2.41.0
Quoted 31 lines · Danilo Krummrich
Fix the following warning.
drivers/gpu/drm/nouveau/nouveau_fence.c:210:45: sparse: sparse:
incorrect type in initializer (different address spaces)
@@ expected structnouveau_channel*chan
@@ got structnouveau_channel[noderef]__rcu*channelWe're just about to emit the fence, there is nothing to protect against yet, hence it is safe to just cast
__rcuaway.Reported-by kernel test robot <[email protected]>Fixes 978474dc8278 ("drm/nouveau: fence: fix undefined fence state after emit")Signed-off-by Danilo Krummrich <[email protected]>--- drivers/gpu/drm/nouveau/nouveau_fence.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/nouveau/nouveau_fence.c +1
-1@@ -207,7 +207,7 @@ nouveau_fence_context_new(struct nouveau_channel *chan, struct nouveau_fence_chaint nouveau_fence_emit (struct nouveau_fence *fence) { -struct nouveau_channel *chan = fence->channel; +struct nouveau_channel *chan =unrcu_pointer (fence->channel);struct nouveau_fence_chan *fctx = chan->fence;struct nouveau_fence_priv *priv = (void *)chan->drm->fence;int ret;
Signature · 3 lines
Cheers, Lyude Paul (she/her) Software Engineer at Red Hat