The variable err is being assigned a value 0 that is never read, the break statement escapes a do-while loop and then the code returns without referencing err. The assignment is redundant and can be removed. Cleans up clang scan build warning: drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c:1075:5: warning: Value stored to 'err' is never read [deadcode.DeadStores] Signed-off-by: Colin Ian King <colin.i.king@xxxxxxxxx> --- drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c index 99a9ade73956..9ca9e9505244 100644 --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c @@ -1071,10 +1071,8 @@ static int igt_fill_mappable(struct intel_memory_region *mr, if (err != -ENXIO && err != -ENOMEM) goto err_close; - if (size == mr->min_page_size) { - err = 0; + if (size == mr->min_page_size) break; - } size >>= 1; continue; -- 2.39.2