Commit e38e1289 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/dp/mst: Use memchr_inv() instead of memcmp() against a zeroed array

We have memch_inv(), so no need to memcmp() against a zeroed temp array.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170712155254.26455-1-ville.syrjala@linux.intel.comReviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent a4370c77
......@@ -1337,15 +1337,17 @@ static void drm_dp_mst_link_probe_work(struct work_struct *work)
static bool drm_dp_validate_guid(struct drm_dp_mst_topology_mgr *mgr,
u8 *guid)
{
static u8 zero_guid[16];
u64 salt;
if (!memcmp(guid, zero_guid, 16)) {
u64 salt = get_jiffies_64();
memcpy(&guid[0], &salt, sizeof(u64));
memcpy(&guid[8], &salt, sizeof(u64));
return false;
}
return true;
if (memchr_inv(guid, 0, 16))
return true;
salt = get_jiffies_64();
memcpy(&guid[0], &salt, sizeof(u64));
memcpy(&guid[8], &salt, sizeof(u64));
return false;
}
#if 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment