public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Katrin Jo <zys.zljxml@gmail.com>
Cc: 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 Vetter <daniel@ffwll.ch>,
	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: Wed, 22 Jun 2022 07:52:00 +0100	[thread overview]
Message-ID: <136dd37c-128a-714e-993f-65a119b7003b@linux.intel.com> (raw)
In-Reply-To: <CAOaDN_T_ZVCfhmbqd1AJnt3vhTuxnGhKsxG2fjjF8-u4wXOBcg@mail.gmail.com>


On 21/06/2022 03:26, Katrin Jo wrote:
> On Mon, Jun 20, 2022 at 6:19 PM Tvrtko Ursulin
> <tvrtko.ursulin@linux.intel.com> wrote:
>>
>>
>> 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;
> 
> Thanks for reviewing! I sent the V2 patch, modified according to your
> suggestion.

I have merged the v2 to drm-intel-gt-next - thanks for the fix!

Regards,

Tvrtko

      reply	other threads:[~2022-06-22  6:52 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
2022-06-21  2:26   ` Katrin Jo
2022-06-22  6:52     ` Tvrtko Ursulin [this message]

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=136dd37c-128a-714e-993f-65a119b7003b@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