summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_edid.c
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2012-11-09 12:10:42 +0000
committerDave Airlie <airlied@redhat.com>2012-11-20 16:06:17 +1000
commit6311803b1294432ee680fec5e628efae0d485fa2 (patch)
tree1eb5e83d7f1b6b8872fcd2d3abda782f4f5e881d /drivers/gpu/drm/drm_edid.c
parentc61eef726a78ae77b6ce223d01ea2130f465fe5c (diff)
drm: use memchr_inv()
Use memchr_inv() to check the specified memory region is filled with zero. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: David Airlie <airlied@linux.ie> Cc: dri-devel@lists.freedesktop.org Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_edid.c')
-rw-r--r--drivers/gpu/drm/drm_edid.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 856dcd91b3d4..164820003546 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -307,12 +307,9 @@ drm_do_probe_ddc_edid(struct i2c_adapter *adapter, unsigned char *buf,
static bool drm_edid_is_zero(u8 *in_edid, int length)
{
- int i;
- u32 *raw_edid = (u32 *)in_edid;
+ if (memchr_inv(in_edid, 0, length))
+ return false;
- for (i = 0; i < length / 4; i++)
- if (*(raw_edid + i) != 0)
- return false;
return true;
}