Skip to content

Commit 149b97d

Browse files
jnikulagregkh
authored andcommitted
drm/displayid: pass iter to drm_find_displayid_extension()
commit 520f37c upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f9e805f commit 149b97d

1 file changed

Lines changed: 7 additions & 12 deletions

File tree

drivers/gpu/drm/drm_displayid.c

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,26 +48,24 @@ validate_displayid(const u8 *displayid, int length, int idx)
4848
return base;
4949
}
5050

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)
5452
{
5553
const struct displayid_header *base;
5654
const u8 *displayid;
5755

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);
5957
if (!displayid)
6058
return NULL;
6159

6260
/* 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;
6563

66-
base = validate_displayid(displayid, *length, *idx);
64+
base = validate_displayid(displayid, iter->length, iter->idx);
6765
if (IS_ERR(base))
6866
return NULL;
6967

70-
*length = *idx + sizeof(*base) + base->bytes;
68+
iter->length = iter->idx + sizeof(*base) + base->bytes;
7169

7270
return displayid;
7371
}
@@ -126,10 +124,7 @@ __displayid_iter_next(struct displayid_iter *iter)
126124
/* The first section we encounter is the base section */
127125
bool base_section = !iter->section;
128126

129-
iter->section = drm_find_displayid_extension(iter->drm_edid,
130-
&iter->length,
131-
&iter->idx,
132-
&iter->ext_index);
127+
iter->section = find_next_displayid_extension(iter);
133128
if (!iter->section) {
134129
iter->drm_edid = NULL;
135130
return NULL;

0 commit comments

Comments
 (0)