[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <87h6ejmjod.fsf@intel.com>
Date: Mon, 27 May 2024 17:08:34 +0300
From: Jani Nikula <jani.nikula@...el.com>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
intel-gfx@...ts.freedesktop.org, Kees Cook <keescook@...omium.org>, Andy
Shevchenko <andy@...nel.org>
Subject: Re: [PATCH 2/2] drm: use mem_is_zero() instead of !memchr_inv(s, 0, n)
On Mon, 27 May 2024, Andy Shevchenko <andy.shevchenko@...il.com> wrote:
> On Mon, May 27, 2024 at 12:43 PM Jani Nikula <jani.nikula@...el.com> 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()
I can leave out these parts of the patch.
BR,
Jani.
>
> ...
>
>> - if (memchr_inv(guid, 0, 16))
>> + if (!mem_is_zero(guid, 16))
>> return true;
>
> Ditto.
--
Jani Nikula, Intel
Powered by blists - more mailing lists