[PATCH v4 14/21] modetest: Remove the struct connector_arg encoder field

Laurent Pinchart laurent.pinchart at ideasonboard.com
Tue Mar 19 07:55:55 PDT 2013


The field is no needed, make it a local variable where used.

Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
 tests/modetest/modetest.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tests/modetest/modetest.c b/tests/modetest/modetest.c
index 70fa262..ba025d6 100644
--- a/tests/modetest/modetest.c
+++ b/tests/modetest/modetest.c
@@ -637,7 +637,6 @@ struct connector_arg {
 	char format_str[5];
 	unsigned int fourcc;
 	drmModeModeInfo *mode;
-	drmModeEncoder *encoder;
 	int crtc;
 	unsigned int fb_id[2], current_fb_id;
 	struct timeval start;
@@ -657,6 +656,7 @@ struct plane_arg {
 static void connector_find_mode(struct device *dev, struct connector_arg *c)
 {
 	drmModeConnector *connector;
+	drmModeEncoder *encoder;
 	int i, j;
 
 	/* First, find the connector & mode */
@@ -690,16 +690,16 @@ static void connector_find_mode(struct device *dev, struct connector_arg *c)
 
 	/* Now get the encoder */
 	for (i = 0; i < dev->resources->res->count_encoders; i++) {
-		c->encoder = dev->resources->encoders[i].encoder;
-		if (!c->encoder)
+		encoder = dev->resources->encoders[i].encoder;
+		if (!encoder)
 			continue;
 
-		if (c->encoder->encoder_id  == connector->encoder_id)
+		if (encoder->encoder_id  == connector->encoder_id)
 			break;
 	}
 
 	if (c->crtc == -1)
-		c->crtc = c->encoder->crtc_id;
+		c->crtc = encoder->crtc_id;
 }
 
 /* -----------------------------------------------------------------------------
-- 
1.8.1.5



More information about the dri-devel mailing list