diff mbox

drm/radeon/audio: break out of loops once we match connector

Message ID 1405208836-14854-2-git-send-email-stefan.bruens@rwth-aachen.de (mailing list archive)
State New, archived
Headers show

Commit Message

Stefan Brüns July 12, 2014, 11:47 p.m. UTC
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>
---
 drivers/gpu/drm/radeon/dce6_afmt.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Alex Deucher July 14, 2014, 3:14 p.m. UTC | #1
On Sat, Jul 12, 2014 at 7:47 PM, Stefan Brüns
<stefan.bruens@rwth-aachen.de> wrote:
> No need to continue with the loops once we've matched
> the appropriate connector.
> See commit 8a992ee14551eae53fd3ab6c2dc8e06ba6fff174

Applied.  Thanks.

Alex

>
> Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
> ---
>  drivers/gpu/drm/radeon/dce6_afmt.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/dce6_afmt.c b/drivers/gpu/drm/radeon/dce6_afmt.c
> index 2b14506..8a76180 100644
> --- a/drivers/gpu/drm/radeon/dce6_afmt.c
> +++ b/drivers/gpu/drm/radeon/dce6_afmt.c
> @@ -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) {
> --
> 1.8.4.5
>
> _______________________________________________
> 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/radeon/dce6_afmt.c b/drivers/gpu/drm/radeon/dce6_afmt.c
index 2b14506..8a76180 100644
--- a/drivers/gpu/drm/radeon/dce6_afmt.c
+++ b/drivers/gpu/drm/radeon/dce6_afmt.c
@@ -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) {