Message ID | 20230307094643.532271-1-tejas.upadhyay@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm/i915/selftest: Remove avoidable init assignment | expand |
On Tue, Mar 07, 2023 at 03:16:43PM +0530, Tejas Upadhyay wrote: > We can skip the assignment and i915 variable > altogether and use refernce directly. Also used at > single place only. > > Signed-off-by: Tejas Upadhyay <tejas.upadhyay@intel.com> trusting the compiler, Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> > --- > drivers/gpu/drm/i915/selftests/i915_request.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/i915/selftests/i915_request.c b/drivers/gpu/drm/i915/selftests/i915_request.c > index 7a27aba3da8a..a9b79888c193 100644 > --- a/drivers/gpu/drm/i915/selftests/i915_request.c > +++ b/drivers/gpu/drm/i915/selftests/i915_request.c > @@ -1117,9 +1117,8 @@ static int live_empty_request(void *arg) > > static struct i915_vma *recursive_batch(struct intel_gt *gt) > { > - struct drm_i915_private *i915 = gt->i915; > struct drm_i915_gem_object *obj; > - const int ver = GRAPHICS_VER(i915); > + const int ver = GRAPHICS_VER(gt->i915); > struct i915_vma *vma; > u32 *cmd; > int err; > -- > 2.25.1 >
diff --git a/drivers/gpu/drm/i915/selftests/i915_request.c b/drivers/gpu/drm/i915/selftests/i915_request.c index 7a27aba3da8a..a9b79888c193 100644 --- a/drivers/gpu/drm/i915/selftests/i915_request.c +++ b/drivers/gpu/drm/i915/selftests/i915_request.c @@ -1117,9 +1117,8 @@ static int live_empty_request(void *arg) static struct i915_vma *recursive_batch(struct intel_gt *gt) { - struct drm_i915_private *i915 = gt->i915; struct drm_i915_gem_object *obj; - const int ver = GRAPHICS_VER(i915); + const int ver = GRAPHICS_VER(gt->i915); struct i915_vma *vma; u32 *cmd; int err;
We can skip the assignment and i915 variable altogether and use refernce directly. Also used at single place only. Signed-off-by: Tejas Upadhyay <tejas.upadhyay@intel.com> --- drivers/gpu/drm/i915/selftests/i915_request.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)