Skip to content

Commit

Permalink
drm: use memchr_inv()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Akinobu Mita authored and Dave Airlie committed Nov 20, 2012
1 parent c61eef7 commit 6311803
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/gpu/drm/drm_edid.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 6311803

Please sign in to comment.