Re: [PATCH v2 2/2] drm: use mem_is_zero() instead of !memchr_inv(s, 0, n)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 14, 2024 at 01:00:35PM +0300, Jani Nikula wrote:
> Use the mem_is_zero() helper where possible.
> 
> Conversion done using cocci:
> 
> | @@
> | expression PTR;
> | expression SIZE;
> | @@
> |
> |   <...
> | (
> | - memchr_inv(PTR, 0, SIZE) == NULL
> | + mem_is_zero(PTR, SIZE)
> | |
> | - !memchr_inv(PTR, 0, SIZE)
> | + mem_is_zero(PTR, SIZE)
> | |
> | - memchr_inv(PTR, 0, SIZE)
> | + !mem_is_zero(PTR, SIZE)
> | )
> |   ...>
> 
> Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx>

Thanks for these patches! Since drm is the first user, feel free to
carry it there unless you'd prefer I carry it in my trees?

Reviewed-by: Kees Cook <kees@xxxxxxxxxx>

-- 
Kees Cook



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux