提交 5b9c58f9 编写于 作者: N Nikola Pajkovsky 提交者: Alex Deucher

drm/amd/amdgpu: get rid of else branch

else branch is pointless if it's right at the end of function and use
unlikely() on err path.
Reviewed-by: NChristian König <christian.koenig@amd.com>
Signed-off-by: NNikola Pajkovsky <npajkovsky@suse.cz>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 503bb31b
...@@ -1734,9 +1734,11 @@ static inline void amdgpu_ring_write_multiple(struct amdgpu_ring *ring, void *sr ...@@ -1734,9 +1734,11 @@ static inline void amdgpu_ring_write_multiple(struct amdgpu_ring *ring, void *sr
unsigned occupied, chunk1, chunk2; unsigned occupied, chunk1, chunk2;
void *dst; void *dst;
if (ring->count_dw < count_dw) { if (unlikely(ring->count_dw < count_dw)) {
DRM_ERROR("amdgpu: writing more dwords to the ring than expected!\n"); DRM_ERROR("amdgpu: writing more dwords to the ring than expected!\n");
} else { return;
}
occupied = ring->wptr & ring->buf_mask; occupied = ring->wptr & ring->buf_mask;
dst = (void *)&ring->ring[occupied]; dst = (void *)&ring->ring[occupied];
chunk1 = ring->buf_mask + 1 - occupied; chunk1 = ring->buf_mask + 1 - occupied;
...@@ -1757,7 +1759,6 @@ static inline void amdgpu_ring_write_multiple(struct amdgpu_ring *ring, void *sr ...@@ -1757,7 +1759,6 @@ static inline void amdgpu_ring_write_multiple(struct amdgpu_ring *ring, void *sr
ring->wptr += count_dw; ring->wptr += count_dw;
ring->wptr &= ring->ptr_mask; ring->wptr &= ring->ptr_mask;
ring->count_dw -= count_dw; ring->count_dw -= count_dw;
}
} }
static inline struct amdgpu_sdma_instance * static inline struct amdgpu_sdma_instance *
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册