drm/edid: Rename local variable block to edid
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 17 Oct 2016 08:35:12 +0000 (09:35 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 17 Oct 2016 12:26:05 +0000 (14:26 +0200)
The "block" variable points to the entire edid, not individual blocks
despite it being named such.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161017083514.21772-1-chris@chris-wilson.co.uk
drivers/gpu/drm/drm_edid.c

index ec77bd3e1f08e62c42c51cb954683fbf3074d961..3b4ac28f509e6de5ab2ec07aef8a96271e131cc8 100644 (file)
@@ -1282,20 +1282,20 @@ struct edid *drm_do_get_edid(struct drm_connector *connector,
        void *data)
 {
        int i, j = 0, valid_extensions = 0;
-       u8 *block, *new;
+       u8 *edid, *new;
        bool print_bad_edid = !connector->bad_edid_counter || (drm_debug & DRM_UT_KMS);
 
-       if ((block = kmalloc(EDID_LENGTH, GFP_KERNEL)) == NULL)
+       if ((edid = kmalloc(EDID_LENGTH, GFP_KERNEL)) == NULL)
                return NULL;
 
        /* base block fetch */
        for (i = 0; i < 4; i++) {
-               if (get_edid_block(data, block, 0, EDID_LENGTH))
+               if (get_edid_block(data, edid, 0, EDID_LENGTH))
                        goto out;
-               if (drm_edid_block_valid(block, 0, print_bad_edid,
+               if (drm_edid_block_valid(edid, 0, print_bad_edid,
                                         &connector->edid_corrupt))
                        break;
-               if (i == 0 && drm_edid_is_zero(block, EDID_LENGTH)) {
+               if (i == 0 && drm_edid_is_zero(edid, EDID_LENGTH)) {
                        connector->null_edid_counter++;
                        goto carp;
                }
@@ -1304,21 +1304,21 @@ struct edid *drm_do_get_edid(struct drm_connector *connector,
                goto carp;
 
        /* if there's no extensions, we're done */
-       if (block[0x7e] == 0)
-               return (struct edid *)block;
+       if (edid[0x7e] == 0)
+               return (struct edid *)edid;
 
-       new = krealloc(block, (block[0x7e] + 1) * EDID_LENGTH, GFP_KERNEL);
+       new = krealloc(edid, (edid[0x7e] + 1) * EDID_LENGTH, GFP_KERNEL);
        if (!new)
                goto out;
-       block = new;
+       edid = new;
 
-       for (j = 1; j <= block[0x7e]; j++) {
+       for (j = 1; j <= edid[0x7e]; j++) {
                for (i = 0; i < 4; i++) {
                        if (get_edid_block(data,
-                                 block + (valid_extensions + 1) * EDID_LENGTH,
+                                 edid + (valid_extensions + 1) * EDID_LENGTH,
                                  j, EDID_LENGTH))
                                goto out;
-                       if (drm_edid_block_valid(block + (valid_extensions + 1)
+                       if (drm_edid_block_valid(edid + (valid_extensions + 1)
                                                 * EDID_LENGTH, j,
                                                 print_bad_edid,
                                                 NULL)) {
@@ -1336,16 +1336,16 @@ struct edid *drm_do_get_edid(struct drm_connector *connector,
                }
        }
 
-       if (valid_extensions != block[0x7e]) {
-               block[EDID_LENGTH-1] += block[0x7e] - valid_extensions;
-               block[0x7e] = valid_extensions;
-               new = krealloc(block, (valid_extensions + 1) * EDID_LENGTH, GFP_KERNEL);
+       if (valid_extensions != edid[0x7e]) {
+               edid[EDID_LENGTH-1] += edid[0x7e] - valid_extensions;
+               edid[0x7e] = valid_extensions;
+               new = krealloc(edid, (valid_extensions + 1) * EDID_LENGTH, GFP_KERNEL);
                if (!new)
                        goto out;
-               block = new;
+               edid = new;
        }
 
-       return (struct edid *)block;
+       return (struct edid *)edid;
 
 carp:
        if (print_bad_edid) {
@@ -1355,7 +1355,7 @@ carp:
        connector->bad_edid_counter++;
 
 out:
-       kfree(block);
+       kfree(edid);
        return NULL;
 }
 EXPORT_SYMBOL_GPL(drm_do_get_edid);