[PATCH 08/12] drm/edid: use a better variable name for EDID block read retries
Ville Syrjälä
ville.syrjala at linux.intel.com
Thu Mar 31 14:55:16 UTC 2022
On Tue, Mar 29, 2022 at 09:42:15PM +0300, Jani Nikula wrote:
> Just i is a bit terse, clarify what it's about.
>
> Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
> Signed-off-by: Jani Nikula <jani.nikula at intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> ---
> drivers/gpu/drm/drm_edid.c | 16 +++++++++-------
> 1 file changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 04eb6949c9c8..235d3cde2e97 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -1971,25 +1971,25 @@ static struct edid *drm_do_get_edid_base_block(struct drm_connector *connector,
> int *null_edid_counter = connector ? &connector->null_edid_counter : NULL;
> bool *edid_corrupt = connector ? &connector->edid_corrupt : NULL;
> void *edid;
> - int i;
> + int try;
>
> edid = kmalloc(EDID_LENGTH, GFP_KERNEL);
> if (edid == NULL)
> return NULL;
>
> /* base block fetch */
> - for (i = 0; i < 4; i++) {
> + for (try = 0; try < 4; try++) {
> if (get_edid_block(data, edid, 0, EDID_LENGTH))
> goto out;
> if (drm_edid_block_valid(edid, 0, false, edid_corrupt))
> break;
> - if (i == 0 && edid_is_zero(edid, EDID_LENGTH)) {
> + if (try == 0 && edid_is_zero(edid, EDID_LENGTH)) {
> if (null_edid_counter)
> (*null_edid_counter)++;
> goto carp;
> }
> }
> - if (i == 4)
> + if (try == 4)
> goto carp;
>
> return edid;
> @@ -2027,7 +2027,7 @@ struct edid *drm_do_get_edid(struct drm_connector *connector,
> size_t len),
> void *data)
> {
> - int i, j = 0, valid_extensions = 0;
> + int j, valid_extensions = 0;
> struct edid *edid, *new, *override;
>
> override = drm_get_override_edid(connector);
> @@ -2050,20 +2050,22 @@ struct edid *drm_do_get_edid(struct drm_connector *connector,
>
> for (j = 1; j <= edid->extensions; j++) {
> void *block = edid + j;
> + int try;
>
> - for (i = 0; i < 4; i++) {
> + for (try = 0; try < 4; try++) {
> if (get_edid_block(data, block, j, EDID_LENGTH))
> goto out;
> if (drm_edid_block_valid(block, j, false, NULL))
> break;
> }
>
> - if (i == 4)
> + if (try == 4)
> valid_extensions--;
> }
>
> if (valid_extensions != edid->extensions) {
> struct edid *base;
> + int i;
>
> connector_bad_edid(connector, (u8 *)edid, edid->extensions + 1);
>
> --
> 2.30.2
--
Ville Syrjälä
Intel
More information about the dri-devel
mailing list