diff mbox

[4/6] drm/edid: calculate address of current extension block only once

Message ID f9c3b00f-7cce-4380-9919-e9e89801de96@HUB1.rwth-ad.de (mailing list archive)
State New, archived
Headers show

Commit Message

Stefan Brüns Nov. 30, 2014, 6:57 p.m. UTC
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/drm_edid.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 1cbaf29..d68f56d 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1248,12 +1248,11 @@  struct edid *drm_do_get_edid(struct drm_connector *connector,
 	block = new;
 
 	for (j = 1; j <= block[0x7e]; j++) {
+		u8 *ext_block = block + (valid_extensions + 1) * EDID_LENGTH;
 		for (i = 0; i < 4; i++) {
-			if (get_edid_block(data,
-				  block + (valid_extensions + 1) * EDID_LENGTH,
-				  j, EDID_LENGTH))
+			if (get_edid_block(data, ext_block, j, EDID_LENGTH))
 				goto out;
-			if (drm_edid_block_valid(block + (valid_extensions + 1) * EDID_LENGTH, j, print_bad_edid)) {
+			if (drm_edid_block_valid(ext_block, j, print_bad_edid)) {
 				valid_extensions++;
 				break;
 			}