Commit 80d42db0 authored by Andres Rodriguez's avatar Andres Rodriguez Committed by Dave Airlie

drm/edid: use for_each_displayid_db where applicable

Replace the duplicated versions of the while loop with the new macro.
Signed-off-by: default avatarAndres Rodriguez <andresx7@gmail.com>
Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190619183033.6922-1-andresx7@gmail.com
parent e28ad544
...@@ -4824,11 +4824,7 @@ static int add_displayid_detailed_modes(struct drm_connector *connector, ...@@ -4824,11 +4824,7 @@ static int add_displayid_detailed_modes(struct drm_connector *connector,
return 0; return 0;
idx += sizeof(struct displayid_hdr); idx += sizeof(struct displayid_hdr);
while (block = (struct displayid_block *)&displayid[idx], for_each_displayid_db(displayid, block, idx, length) {
idx + sizeof(struct displayid_block) <= length &&
idx + sizeof(struct displayid_block) + block->num_bytes <= length &&
block->num_bytes > 0) {
idx += block->num_bytes + sizeof(struct displayid_block);
switch (block->tag) { switch (block->tag) {
case DATA_BLOCK_TYPE_1_DETAILED_TIMING: case DATA_BLOCK_TYPE_1_DETAILED_TIMING:
num_modes += add_displayid_detailed_1_modes(connector, block); num_modes += add_displayid_detailed_1_modes(connector, block);
...@@ -5445,11 +5441,7 @@ static int drm_parse_display_id(struct drm_connector *connector, ...@@ -5445,11 +5441,7 @@ static int drm_parse_display_id(struct drm_connector *connector,
return ret; return ret;
idx += sizeof(struct displayid_hdr); idx += sizeof(struct displayid_hdr);
while (block = (struct displayid_block *)&displayid[idx], for_each_displayid_db(displayid, block, idx, length) {
idx + sizeof(struct displayid_block) <= length &&
idx + sizeof(struct displayid_block) + block->num_bytes <= length &&
block->num_bytes > 0) {
idx += block->num_bytes + sizeof(struct displayid_block);
DRM_DEBUG_KMS("block id 0x%x, rev %d, len %d\n", DRM_DEBUG_KMS("block id 0x%x, rev %d, len %d\n",
block->tag, block->rev, block->num_bytes); block->tag, block->rev, block->num_bytes);
......
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