Commit c8bdf316 authored by Sebastian Brzezinka's avatar Sebastian Brzezinka Committed by Andi Shyti
Browse files

drm/i915: Replace empty conditional with continue in eb_relocate_vma()



Simplifies the control flow by replacing an empty
`if (likely(offset == 0))` block with a `continue` statement. This
improves readability and avoids unnecessary nesting.

Signed-off-by: default avatarSebastian Brzezinka <sebastian.brzezinka@intel.com>
Reviewed-by: default avatarAndi Shyti <andi.shyti@linux.intel.com>
Signed-off-by: default avatarAndi Shyti <andi.shyti@linux.intel.com>
Link: https://lore.kernel.org/r/20250718102752.684975-4-sebastian.brzezinka@intel.com
parent bf91bac3
Loading
Loading
Loading
Loading
+27 −27
Original line number Diff line number Diff line
@@ -1568,11 +1568,13 @@ static int eb_relocate_vma(struct i915_execbuffer *eb, struct eb_vma *ev)
		do {
			u64 offset = eb_relocate_entry(eb, ev, r);

			if (likely(offset == 0)) {
			} else if ((s64)offset < 0) {
			if (likely(offset == 0))
				continue;

			if ((s64)offset < 0) {
				remain = (int)offset;
				goto out;
			} else {
			}
			/*
			 * Note that reporting an error now
			 * leaves everything in an inconsistent
@@ -1595,9 +1597,7 @@ static int eb_relocate_vma(struct i915_execbuffer *eb, struct eb_vma *ev)
			 * can read from this userspace address.
			 */
			offset = gen8_canonical_addr(offset & ~UPDATE);
				__put_user(offset,
					   &urelocs[r - stack].presumed_offset);
			}
			__put_user(offset, &urelocs[r - stack].presumed_offset);
		} while (r++, --count);
		urelocs += ARRAY_SIZE(stack);
	} while (remain);