return 0;
idx += sizeof(struct displayid_hdr);
- while (block = (struct displayid_block *)&displayid[idx],
- 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);
+ for_each_displayid_db(displayid, block, idx, length) {
switch (block->tag) {
case DATA_BLOCK_TYPE_1_DETAILED_TIMING:
num_modes += add_displayid_detailed_1_modes(connector, block);
return ret;
idx += sizeof(struct displayid_hdr);
- while (block = (struct displayid_block *)&displayid[idx],
- 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);
+ for_each_displayid_db(displayid, block, idx, length) {
DRM_DEBUG_KMS("block id 0x%x, rev %d, len %d\n",
block->tag, block->rev, block->num_bytes);