[Intel-gfx] [PATCH 07/39] drm/i915: Introduce the i915_user_extension_method
Tvrtko Ursulin
tvrtko.ursulin at linux.intel.com
Thu Mar 14 16:10:32 UTC 2019
On 14/03/2019 14:59, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2019-03-14 14:52:00)
>>
>> On 13/03/2019 14:43, Chris Wilson wrote:
>>> +int i915_user_extensions(struct i915_user_extension __user *ext,
>>> + const i915_user_extension_fn *tbl,
>>> + unsigned long count,
>>
>> Could shrink to unsigned int if going to 32-bit "name". And...
>>
>>> + void *data)
>>> +{
>>> + unsigned int stackdepth = 512;
>>> +
>>> + while (ext) {
>>> + int i, err;
>>> + u64 x;
>>
>> ... so it is u32 in this version.
>
> This was a convenience to use one variable for both; it doesn't affect
> the get_user() as that is determined by the sizeof(*ptr) and not the
My bad, I thought the destination controls the size.
> local. However, it did upset array_index_nospec() on 32bit, so it did
> become a u32. So unsigned int count also makes some sense, I was using
> the natural type for ARRAY_SIZE() so that we didn't accidentally
> truncate, but shrinking the array bound is not as harmful.
Ok.
Regards,
Tvrtko
More information about the Intel-gfx
mailing list