* [PATCH][next] drm/i915: remove redundant assignement to variable err
@ 2024-04-15 9:56 Colin Ian King
2024-04-15 11:21 ` Andi Shyti
0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2024-04-15 9:56 UTC (permalink / raw)
To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
David Airlie, Daniel Vetter, Andi Shyti, intel-gfx, dri-devel
Cc: kernel-janitors, linux-kernel
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(-)
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH][next] drm/i915: remove redundant assignement to variable err
2024-04-15 9:56 [PATCH][next] drm/i915: remove redundant assignement to variable err Colin Ian King
@ 2024-04-15 11:21 ` Andi Shyti
0 siblings, 0 replies; 2+ messages in thread
From: Andi Shyti @ 2024-04-15 11:21 UTC (permalink / raw)
To: Colin Ian King
Cc: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
David Airlie, Daniel Vetter, Andi Shyti, intel-gfx, dri-devel,
kernel-janitors, linux-kernel
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-04-15 11:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-15 9:56 [PATCH][next] drm/i915: remove redundant assignement to variable err Colin Ian King
2024-04-15 11:21 ` Andi Shyti
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®