From: Jani Nikula <jani.nikula@intel.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
intel-gfx@lists.freedesktop.org,
Kees Cook <keescook@chromium.org>,
Andy Shevchenko <andy@kernel.org>
Subject: Re: [PATCH 2/2] drm: use mem_is_zero() instead of !memchr_inv(s, 0, n)
Date: Mon, 27 May 2024 17:08:34 +0300 [thread overview]
Message-ID: <87h6ejmjod.fsf@intel.com> (raw)
In-Reply-To: <CAHp75Ve0vyOv3KNY_7286wLKd8u6HOvu0Trm17rs46h-BOGsfA@mail.gmail.com>
On Mon, 27 May 2024, Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> On Mon, May 27, 2024 at 12:43 PM Jani Nikula <jani.nikula@intel.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
next prev parent reply other threads:[~2024-05-27 14:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-27 9:43 [PATCH 1/2] string: add mem_is_zero() helper to check if memory area is all zeros Jani Nikula
2024-05-27 9:43 ` [PATCH 2/2] drm: use mem_is_zero() instead of !memchr_inv(s, 0, n) Jani Nikula
2024-05-27 13:19 ` Andy Shevchenko
2024-05-27 14:08 ` Jani Nikula [this message]
2024-05-27 13:27 ` [PATCH 1/2] string: add mem_is_zero() helper to check if memory area is all zeros Andy Shevchenko
2024-05-27 14:06 ` Jani Nikula
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87h6ejmjod.fsf@intel.com \
--to=jani.nikula@intel.com \
--cc=andy.shevchenko@gmail.com \
--cc=andy@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox