drm/radeon/audio: break out of loops once we match connector
authorStefan Brüns <stefan.bruens@rwth-aachen.de>
Sat, 12 Jul 2014 23:47:15 +0000 (01:47 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 5 Aug 2014 12:53:28 +0000 (08:53 -0400)
No need to continue with the loops once we've matched
the appropriate connector.
See commit 8a992ee14551eae53fd3ab6c2dc8e06ba6fff174

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/dce6_afmt.c

index af936cc..edcf159 100644 (file)
@@ -164,8 +164,10 @@ void dce6_afmt_write_speaker_allocation(struct drm_encoder *encoder)
        offset = dig->afmt->pin->offset;
 
        list_for_each_entry(connector, &encoder->dev->mode_config.connector_list, head) {
-               if (connector->encoder == encoder)
+               if (connector->encoder == encoder) {
                        radeon_connector = to_radeon_connector(connector);
+                       break;
+               }
        }
 
        if (!radeon_connector) {
@@ -225,8 +227,10 @@ void dce6_afmt_write_sad_regs(struct drm_encoder *encoder)
        offset = dig->afmt->pin->offset;
 
        list_for_each_entry(connector, &encoder->dev->mode_config.connector_list, head) {
-               if (connector->encoder == encoder)
+               if (connector->encoder == encoder) {
                        radeon_connector = to_radeon_connector(connector);
+                       break;
+               }
        }
 
        if (!radeon_connector) {