Message ID | 20240415095659.482989-1-colin.i.king@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [next] drm/i915: remove redundant assignement to variable err | expand |
Hi Colin, On Mon, Apr 15, 2024 at 10:56:59AM +0100, Colin Ian King wrote: > 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@gmail.com> Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com> Thanks, Andi
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;
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@gmail.com> --- drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)