Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5b9c58f9 authored by Nikola Pajkovsky's avatar Nikola Pajkovsky Committed by Alex Deucher
Browse files

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: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarNikola Pajkovsky <npajkovsky@suse.cz>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 503bb31b
Loading
Loading
Loading
Loading
+23 −22
Original line number Diff line number Diff line
@@ -1734,9 +1734,11 @@ static inline void amdgpu_ring_write_multiple(struct amdgpu_ring *ring, void *sr
	unsigned occupied, chunk1, chunk2;
	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");
	} else {
		return;
	}

	occupied = ring->wptr & ring->buf_mask;
	dst = (void *)&ring->ring[occupied];
	chunk1 = ring->buf_mask + 1 - occupied;
@@ -1758,7 +1760,6 @@ static inline void amdgpu_ring_write_multiple(struct amdgpu_ring *ring, void *sr
	ring->wptr &= ring->ptr_mask;
	ring->count_dw -= count_dw;
}
}

static inline struct amdgpu_sdma_instance *
amdgpu_get_sdma_instance(struct amdgpu_ring *ring)