Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/displayid: pass iter to drm_find_displayid_extension()

It's more convenient to pass iter than a handful of its members to
drm_find_displayid_extension(), especially as we're about to add another
member.

Rename the function find_next_displayid_extension() while at it, to be
more descriptive.

Cc: Tiago Martins Araújo <tiago.martins.araujo@gmail.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Tested-by: Tiago Martins Araújo <tiago.martins.araujo@gmail.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/3837ae7f095e77a082ac2422ce2fac96c4f9373d.1761681968.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>

+7 -12
+7 -12
drivers/gpu/drm/drm_displayid.c
··· 48 48 return base; 49 49 } 50 50 51 - static const u8 *drm_find_displayid_extension(const struct drm_edid *drm_edid, 52 - int *length, int *idx, 53 - int *ext_index) 51 + static const u8 *find_next_displayid_extension(struct displayid_iter *iter) 54 52 { 55 53 const struct displayid_header *base; 56 54 const u8 *displayid; 57 55 58 - displayid = drm_edid_find_extension(drm_edid, DISPLAYID_EXT, ext_index); 56 + displayid = drm_edid_find_extension(iter->drm_edid, DISPLAYID_EXT, &iter->ext_index); 59 57 if (!displayid) 60 58 return NULL; 61 59 62 60 /* EDID extensions block checksum isn't for us */ 63 - *length = EDID_LENGTH - 1; 64 - *idx = 1; 61 + iter->length = EDID_LENGTH - 1; 62 + iter->idx = 1; 65 63 66 - base = validate_displayid(displayid, *length, *idx); 64 + base = validate_displayid(displayid, iter->length, iter->idx); 67 65 if (IS_ERR(base)) 68 66 return NULL; 69 67 70 - *length = *idx + sizeof(*base) + base->bytes; 68 + iter->length = iter->idx + sizeof(*base) + base->bytes; 71 69 72 70 return displayid; 73 71 } ··· 124 126 /* The first section we encounter is the base section */ 125 127 bool base_section = !iter->section; 126 128 127 - iter->section = drm_find_displayid_extension(iter->drm_edid, 128 - &iter->length, 129 - &iter->idx, 130 - &iter->ext_index); 129 + iter->section = find_next_displayid_extension(iter); 131 130 if (!iter->section) { 132 131 iter->drm_edid = NULL; 133 132 return NULL;