Re: [PATCH 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 Mon, May 27, 2024 at 12:43 PM Jani Nikula <jani.nikula@xxxxxxxxx> wrote:
>
> Use the mem_is_zero() helper where possible.

...

> -       if (memchr_inv(guid, 0, 16) == NULL) {
> +       if (mem_is_zero(guid, 16)) {
>                 tmp64 = get_jiffies_64();
>                 memcpy(&guid[0], &tmp64, sizeof(u64));
>                 memcpy(&guid[8], &tmp64, sizeof(u64));

What is the type of guid? Shouldn't it be guid_t with the respective
guid_is_null()

...

> -       if (memchr_inv(guid, 0, 16))
> +       if (!mem_is_zero(guid, 16))
>                 return true;

Ditto.

-- 
With Best Regards,
Andy Shevchenko




[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