mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-23 14:59:04 -04:00
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>
This commit is contained in:
@@ -48,26 +48,24 @@ validate_displayid(const u8 *displayid, int length, int idx)
|
||||
return base;
|
||||
}
|
||||
|
||||
static const u8 *drm_find_displayid_extension(const struct drm_edid *drm_edid,
|
||||
int *length, int *idx,
|
||||
int *ext_index)
|
||||
static const u8 *find_next_displayid_extension(struct displayid_iter *iter)
|
||||
{
|
||||
const struct displayid_header *base;
|
||||
const u8 *displayid;
|
||||
|
||||
displayid = drm_edid_find_extension(drm_edid, DISPLAYID_EXT, ext_index);
|
||||
displayid = drm_edid_find_extension(iter->drm_edid, DISPLAYID_EXT, &iter->ext_index);
|
||||
if (!displayid)
|
||||
return NULL;
|
||||
|
||||
/* EDID extensions block checksum isn't for us */
|
||||
*length = EDID_LENGTH - 1;
|
||||
*idx = 1;
|
||||
iter->length = EDID_LENGTH - 1;
|
||||
iter->idx = 1;
|
||||
|
||||
base = validate_displayid(displayid, *length, *idx);
|
||||
base = validate_displayid(displayid, iter->length, iter->idx);
|
||||
if (IS_ERR(base))
|
||||
return NULL;
|
||||
|
||||
*length = *idx + sizeof(*base) + base->bytes;
|
||||
iter->length = iter->idx + sizeof(*base) + base->bytes;
|
||||
|
||||
return displayid;
|
||||
}
|
||||
@@ -126,10 +124,7 @@ __displayid_iter_next(struct displayid_iter *iter)
|
||||
/* The first section we encounter is the base section */
|
||||
bool base_section = !iter->section;
|
||||
|
||||
iter->section = drm_find_displayid_extension(iter->drm_edid,
|
||||
&iter->length,
|
||||
&iter->idx,
|
||||
&iter->ext_index);
|
||||
iter->section = find_next_displayid_extension(iter);
|
||||
if (!iter->section) {
|
||||
iter->drm_edid = NULL;
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user