[Intel-gfx] [PATCH v5 2/7] drm/i915/gem: Typecheck page lookups

Andrzej Hajda andrzej.hajda at intel.com
Mon Jul 25 11:50:47 UTC 2022


On 25.07.2022 11:25, Gwan-gyeong Mun wrote:
> From: Chris Wilson <chris at chris-wilson.co.uk>
> 
> We need to check that we avoid integer overflows when looking up a page,
> and so fix all the instances where we have mistakenly used a plain
> integer instead of a more suitable long. Be pedantic and add integer
> typechecking to the lookup so that we can be sure that we are safe.
> And it also uses pgoff_t as our page lookups must remain compatible with
> the page cache, pgoff_t is currently exactly unsigned long.
> 
> v2: Move added i915_utils's macro into drm_util header (Jani N)
> v3: Make not use the same macro name on a function. (Mauro)
>      For kernel-doc, macros and functions are handled in the same namespace,
>      the same macro name on a function prevents ever adding documentation
>      for it.
> v4: Add kernel-doc markups to the kAPI functions and macros (Mauoro)
> v5: Fix an alignment to match open parenthesis
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Signed-off-by: Gwan-gyeong Mun <gwan-gyeong.mun at intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin at linux.intel.com>
> Cc: Matthew Auld <matthew.auld at intel.com>
> Cc: Thomas Hellström <thomas.hellstrom at linux.intel.com>
> Reviewed-by: Nirmoy Das <nirmoy.das at intel.com>
> Reviewed-by: Mauro Carvalho Chehab <mchehab at kernel.org>

Reviewed-by: Andrzej Hajda <andrzej.hajda at intel.com>

Regards
Andrzej


More information about the Intel-gfx mailing list