mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/i915/userptr: remove redundation assignment to variable ret
@ 2022-07-30 12:23 Colin Ian King
  2022-08-01 17:11 ` Niranjana Vishwanathapura
  0 siblings, 1 reply; 2+ messages in thread
From: Colin Ian King @ 2022-07-30 12:23 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, intel-gfx, dri-devel
  Cc: kernel-janitors, linux-kernel

Variable ret is assigned a value that is never read; it is either
being re-assigned during the following while-loop or after the loop.
The assignmnt is redundant and can be removed.

Cleans up clang scan build warning:
drivers/gpu/drm/i915/gem/i915_gem_userptr.c:295:11: warning: Although
the value stored to 'ret' is used in the enclosing expression, the
value is never actually read from 'ret' [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_userptr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c b/drivers/gpu/drm/i915/gem/i915_gem_userptr.c
index 8423df021b71..075aef875a07 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_userptr.c
@@ -292,7 +292,7 @@ int i915_gem_object_userptr_submit_init(struct drm_i915_gem_object *obj)
 	if (!i915_gem_object_is_readonly(obj))
 		gup_flags |= FOLL_WRITE;
 
-	pinned = ret = 0;
+	pinned = 0;
 	while (pinned < num_pages) {
 		ret = pin_user_pages_fast(obj->userptr.ptr + pinned * PAGE_SIZE,
 					  num_pages - pinned, gup_flags,
-- 
2.35.3


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/i915/userptr: remove redundation assignment to variable ret
  2022-07-30 12:23 [PATCH] drm/i915/userptr: remove redundation assignment to variable ret Colin Ian King
@ 2022-08-01 17:11 ` Niranjana Vishwanathapura
  0 siblings, 0 replies; 2+ messages in thread
From: Niranjana Vishwanathapura @ 2022-08-01 17:11 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin,
	David Airlie, intel-gfx, dri-devel, kernel-janitors,
	linux-kernel

On Sat, Jul 30, 2022 at 01:23:42PM +0100, Colin Ian King wrote:
>Variable ret is assigned a value that is never read; it is either
>being re-assigned during the following while-loop or after the loop.
>The assignmnt is redundant and can be removed.
>
>Cleans up clang scan build warning:
>drivers/gpu/drm/i915/gem/i915_gem_userptr.c:295:11: warning: Although
>the value stored to 'ret' is used in the enclosing expression, the
>value is never actually read from 'ret' [deadcode.DeadStores]
>
>Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
>---
> drivers/gpu/drm/i915/gem/i915_gem_userptr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c b/drivers/gpu/drm/i915/gem/i915_gem_userptr.c
>index 8423df021b71..075aef875a07 100644
>--- a/drivers/gpu/drm/i915/gem/i915_gem_userptr.c
>+++ b/drivers/gpu/drm/i915/gem/i915_gem_userptr.c
>@@ -292,7 +292,7 @@ int i915_gem_object_userptr_submit_init(struct drm_i915_gem_object *obj)
> 	if (!i915_gem_object_is_readonly(obj))
> 		gup_flags |= FOLL_WRITE;
>
>-	pinned = ret = 0;
>+	pinned = 0;
> 	while (pinned < num_pages) {
> 		ret = pin_user_pages_fast(obj->userptr.ptr + pinned * PAGE_SIZE,
> 					  num_pages - pinned, gup_flags,

LGTM.
Reviewed-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>

>-- 
>2.35.3
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-08-01 17:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-30 12:23 [PATCH] drm/i915/userptr: remove redundation assignment to variable ret Colin Ian King
2022-08-01 17:11 ` Niranjana Vishwanathapura

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome