diff mbox series

drm/i915/selftest: Remove avoidable init assignment

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

Commit Message

Upadhyay, Tejas March 7, 2023, 9:46 a.m. UTC
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(-)

Comments

Rodrigo Vivi March 7, 2023, 1:36 p.m. UTC | #1
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 mbox series

Patch

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;