Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Wang, X" <x.wang@intel.com>
To: "Lin, Shuicheng" <shuicheng.lin@intel.com>,
	"intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH] drm/xe/madvise: Remove unreachable madvise_funcs NULL check
Date: Thu, 24 Sep 2026 15:26:58 -0700	[thread overview]
Message-ID: <bba15354-2204-4a26-a848-e5bdf2cad523@intel.com> (raw)
In-Reply-To: <DM4PR11MB54561853ADFA943F9045CCCFEA812@DM4PR11MB5456.namprd11.prod.outlook.com>



On 9/24/2026 13:44, Lin, Shuicheng wrote:
> On Thu, Sep 24, 2026 11:31 AM Xin Wang wrote:
>> On 9/14/2026 18:12, Shuicheng Lin wrote:
>>> The NULL check on madvise_funcs[attr_type] in xe_vm_madvise_ioctl() is
>>> unreachable. madvise_args_are_sane() already validates args->type via
>>> a switch statement whose default case rejects any type not present in
>>> madvise_funcs[]. Every type that passes the sanity check has a
>>> corresponding entry in the table.
>>>
>>> Beyond being dead code, the check's error path (goto err_fini) would
>>> also skip xe_svm_notifier_unlock() if it were somehow reached with
>>> has_svm_userptr_vmas set, since err_fini only tears down the drm_exec.
>>> Removing the check eliminates both the redundancy and the latent
>>> unwind hazard.
>>>
>>> No functional change.
>>>
>>> Assisted-by: LLM
>> The code change looks good to me. One small commit-message nit:
>> Documentation/process/coding-assistants.rst specifies the format
>> "Assisted-by: AGENT_NAME:MODEL_VERSION". Could you replace
>> "Assisted-by: LLM" with the tool and model version used? If it was the same
>> as v1, you could restore its Assisted-by tag.
> Thanks for the review.
> LLM is the latest suggestion of the doc as below.
> "
> -  Assisted-by: AGENT_NAME:MODEL_VERSION [TOOL1] [TOOL2]
> +  Assisted-by: LLM [TOOL1] [TOOL2]
> "
>
> Shuicheng
You're right. I checked an older version of the documentation and
missed the update to the Assisted-by format. "Assisted-by: LLM" is
correct here. Sorry for the noise; please disregard my comment about
that tag.

My Reviewed-by stands.

Thanks,
Xin

>> Reviewed-by: Xin Wang <x.wang@intel.com>
>>> Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
>>> ---
>>> Cc: Arvind Yadav <arvind.yadav@intel.com>
>>> Cc: Matthew Brost <matthew.brost@intel.com>
>>> Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
>>> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
>>> ---
>>>    drivers/gpu/drm/xe/xe_vm_madvise.c | 6 ------
>>>    1 file changed, 6 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/xe/xe_vm_madvise.c
>>> b/drivers/gpu/drm/xe/xe_vm_madvise.c
>>> index 0474768a38aa..5c7aefc641ee 100644
>>> --- a/drivers/gpu/drm/xe/xe_vm_madvise.c
>>> +++ b/drivers/gpu/drm/xe/xe_vm_madvise.c
>>> @@ -713,12 +713,6 @@ int xe_vm_madvise_ioctl(struct drm_device *dev,
>>> void *data, struct drm_file *fil
>>>
>>>    	attr_type = array_index_nospec(args->type,
>>> ARRAY_SIZE(madvise_funcs));
>>>
>>> -	/* Ensure the madvise function exists for this type */
>>> -	if (!madvise_funcs[attr_type]) {
>>> -		err = -EINVAL;
>>> -		goto err_fini;
>>> -	}
>>> -
>>>    	madvise_funcs[attr_type](xe, vm, madvise_range.vmas,
>> madvise_range.num_vmas, args,
>>>    				 &details);
>>>


  reply	other threads:[~2026-09-24 22:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-15  1:12 [PATCH] drm/xe/madvise: Remove unreachable madvise_funcs NULL check Shuicheng Lin
2026-09-15  1:20 ` ✓ CI.KUnit: success for drm/xe/madvise: Remove unreachable madvise_funcs NULL check (rev2) Patchwork
2026-09-15  6:13 ` ✓ Xe.CI.FULL: " Patchwork
2026-09-25 15:43   ` Lin, Shuicheng
2026-09-24 18:30 ` [PATCH] drm/xe/madvise: Remove unreachable madvise_funcs NULL check Wang, X
2026-09-24 20:44   ` Lin, Shuicheng
2026-09-24 22:26     ` Wang, X [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-07-08 18:09 Shuicheng Lin

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=bba15354-2204-4a26-a848-e5bdf2cad523@intel.com \
    --to=x.wang@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=shuicheng.lin@intel.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