public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: zys.zljxml@gmail.com, dri-devel@lists.freedesktop.org,
	intel-gfx@lists.freedesktop.org, jani.nikula@linux.intel.com,
	joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com,
	airlied@linux.ie, daniel@ffwll.ch
Cc: bob.beckett@collabora.com, matthew.auld@intel.com,
	thomas.hellstrom@linux.intel.com, kernel@collabora.com,
	linux-kernel@vger.kernel.org, katrinzhou <katrinzhou@tencent.com>
Subject: Re: [PATCH] drm/i915/gem: remove unused assignments
Date: Mon, 20 Jun 2022 11:18:53 +0100	[thread overview]
Message-ID: <7a2028c6-8ed6-1fc4-3abf-b13f7254cdee@linux.intel.com> (raw)
In-Reply-To: <20220620100216.1791284-1-zys.zljxml@gmail.com>


On 20/06/2022 11:02, zys.zljxml@gmail.com wrote:
> From: katrinzhou <katrinzhou@tencent.com>
> 
> The variable ret is reassigned and the value EINVAL is never used.
> Thus, remove the unused assignments.
> 
> Addresses-Coverity: ("Unused value")
> Fixes: d4433c7600f7 ("drm/i915/gem: Use the proto-context to handle create parameters (v5)")
> Signed-off-by: katrinzhou <katrinzhou@tencent.com>
> ---
>   drivers/gpu/drm/i915/gem/i915_gem_context.c | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c b/drivers/gpu/drm/i915/gem/i915_gem_context.c
> index ab4c5ab28e4d..d5ef5243673a 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_context.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c
> @@ -931,8 +931,6 @@ static int set_proto_ctx_param(struct drm_i915_file_private *fpriv,
>   		break;
>   
>   	case I915_CONTEXT_PARAM_PERSISTENCE:
> -		if (args->size)
> -			ret = -EINVAL;
>   		ret = proto_context_set_persistence(fpriv->dev_priv, pc,
>   						    args->value);

AFAICT fix should end up with code like this:

if (args->size)
	ret = -EINVAL;
else
	ret = proto_context_set_persistence(...)
break;


Alternatively move args->size checking into 
proto_context_set_persistence to align with set_persistence().

Regards,

Tvrtko

>   		break;

  parent reply	other threads:[~2022-06-20 10:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-20 10:02 [PATCH] drm/i915/gem: remove unused assignments zys.zljxml
2022-06-20 10:12 ` Jani Nikula
2022-06-21  2:21   ` Katrin Jo
2022-06-20 10:18 ` Tvrtko Ursulin [this message]
2022-06-21  2:26   ` Katrin Jo
2022-06-22  6:52     ` Tvrtko Ursulin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7a2028c6-8ed6-1fc4-3abf-b13f7254cdee@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=airlied@linux.ie \
    --cc=bob.beckett@collabora.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=katrinzhou@tencent.com \
    --cc=kernel@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew.auld@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=thomas.hellstrom@linux.intel.com \
    --cc=zys.zljxml@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox