diff mbox series

[next] drm/i915: remove redundant assignement to variable err

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

Commit Message

Colin Ian King April 15, 2024, 9:56 a.m. UTC
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(-)

Comments

Andi Shyti April 15, 2024, 11:21 a.m. UTC | #1
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 mbox series

Patch

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;