From: Jani Nikula <jani.nikula@linux.intel.com>
To: zys.zljxml@gmail.com, dri-devel@lists.freedesktop.org,
intel-gfx@lists.freedesktop.org, joonas.lahtinen@linux.intel.com,
rodrigo.vivi@intel.com, tvrtko.ursulin@linux.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 13:12:55 +0300 [thread overview]
Message-ID: <878rprtzh4.fsf@intel.com> (raw)
In-Reply-To: <20220620100216.1791284-1-zys.zljxml@gmail.com>
On Mon, 20 Jun 2022, 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.
It's obviously a bug, but it's not obvious just throwing the code away
is the fix. Maybe there's a missing "else" instead.
BR,
Jani.
>
> 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);
> break;
--
Jani Nikula, Intel Open Source Graphics Center
next prev parent reply other threads:[~2022-06-20 10:13 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 [this message]
2022-06-21 2:21 ` Katrin Jo
2022-06-20 10:18 ` Tvrtko Ursulin
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=878rprtzh4.fsf@intel.com \
--to=jani.nikula@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=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=tvrtko.ursulin@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