From: Jani Nikula <jani.nikula@intel.com>
To: Kees Cook <kees@kernel.org>
Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
intel-gfx@lists.freedesktop.org,
Andy Shevchenko <andy@kernel.org>
Subject: Re: [PATCH v2 2/2] drm: use mem_is_zero() instead of !memchr_inv(s, 0, n)
Date: Fri, 16 Aug 2024 16:12:20 +0300 [thread overview]
Message-ID: <87ed6o7gsr.fsf@intel.com> (raw)
In-Reply-To: <202408150907.5B5C5FCDF@keescook>
On Thu, 15 Aug 2024, Kees Cook <kees@kernel.org> wrote:
> 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@intel.com>
>
> 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@kernel.org>
Thanks for the reviews. I've gone ahead and merged both to
drm-misc-next, heading for the next merge window.
BR,
Jani.
--
Jani Nikula, Intel
next prev parent reply other threads:[~2024-08-16 13:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-14 10:00 [PATCH v2 1/2] string: add mem_is_zero() helper to check if memory area is all zeros Jani Nikula
2024-08-14 10:00 ` [PATCH v2 2/2] drm: use mem_is_zero() instead of !memchr_inv(s, 0, n) Jani Nikula
2024-08-15 16:07 ` Kees Cook
2024-08-16 13:12 ` Jani Nikula [this message]
2024-08-14 12:44 ` [PATCH v2 1/2] string: add mem_is_zero() helper to check if memory area is all zeros Andy Shevchenko
2024-08-15 16:07 ` Kees Cook
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=87ed6o7gsr.fsf@intel.com \
--to=jani.nikula@intel.com \
--cc=andy@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=kees@kernel.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