summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_edid.c
diff options
context:
space:
mode:
authorJani Nikula <jani.nikula@intel.com>2024-08-14 12:00:35 +0200
committerJani Nikula <jani.nikula@intel.com>2024-08-16 11:07:46 +0200
commitf76506358078809461866086c5e224d949002016 (patch)
tree3638fc5864dc01b2ca6e3e3333d9c46d982d51db /drivers/gpu/drm/drm_edid.c
parentstring: add mem_is_zero() helper to check if memory area is all zeros (diff)
downloadlinux-f76506358078809461866086c5e224d949002016.tar.xz
linux-f76506358078809461866086c5e224d949002016.zip
drm: use mem_is_zero() instead of !memchr_inv(s, 0, n)
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) | ) | ...> Reviewed-by: Kees Cook <kees@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/20240814100035.3100852-2-jani.nikula@intel.com Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'drivers/gpu/drm/drm_edid.c')
-rw-r--r--drivers/gpu/drm/drm_edid.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index ff1e47a9c83e..855beafb76ff 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1817,7 +1817,7 @@ static int edid_block_tag(const void *_block)
static bool edid_block_is_zero(const void *edid)
{
- return !memchr_inv(edid, 0, EDID_LENGTH);
+ return mem_is_zero(edid, EDID_LENGTH);
}
static bool drm_edid_eq(const struct drm_edid *drm_edid,