Skip to content

Commit 7ece3fc

Browse files
committed
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. Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Fixes: 978474d ("drm/nouveau: fence: fix undefined fence state after emit") Signed-off-by: Danilo Krummrich <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent bb6c450 commit 7ece3fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/nouveau/nouveau_fence.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ nouveau_fence_context_new(struct nouveau_channel *chan, struct nouveau_fence_cha
207207
int
208208
nouveau_fence_emit(struct nouveau_fence *fence)
209209
{
210-
struct nouveau_channel *chan = fence->channel;
210+
struct nouveau_channel *chan = unrcu_pointer(fence->channel);
211211
struct nouveau_fence_chan *fctx = chan->fence;
212212
struct nouveau_fence_priv *priv = (void*)chan->drm->fence;
213213
int ret;

0 commit comments

Comments
 (0)