diff mbox

[2/3] drm/edid: calculate address of current extension block only once

Message ID 2fd77d8b-a0a0-4961-8670-358d469b90a5@HUB1.rwth-ad.de (mailing list archive)
State New, archived
Headers show

Commit Message

Stefan Brüns Nov. 20, 2014, 2:27 a.m. UTC
Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
---
 drivers/gpu/drm/drm_edid.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Jani Nikula Nov. 21, 2014, 1:35 p.m. UTC | #1
On Thu, 20 Nov 2014, Stefan Brüns <stefan.bruens@rwth-aachen.de> wrote:
> 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 --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index b072041..3a10f3f 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -1232,12 +1232,11 @@ drm_do_get_edid(struct drm_connector *connector, struct i2c_adapter *adapter)
>  	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 (drm_do_probe_ddc_edid(adapter,
> -				  block + (valid_extensions + 1) * EDID_LENGTH,
> -				  j, EDID_LENGTH))
> +			if (drm_do_probe_ddc_edid(adapter, 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;
>  			}
> -- 
> 2.1.2
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index b072041..3a10f3f 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1232,12 +1232,11 @@  drm_do_get_edid(struct drm_connector *connector, struct i2c_adapter *adapter)
 	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 (drm_do_probe_ddc_edid(adapter,
-				  block + (valid_extensions + 1) * EDID_LENGTH,
-				  j, EDID_LENGTH))
+			if (drm_do_probe_ddc_edid(adapter, 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;
 			}