From patchwork Fri Jul 4 08:30:45 2014
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Philipp Zabel
X-Patchwork-Id: 4478771
Return-Path:
X-Original-To: patchwork-linux-arm@patchwork.kernel.org
Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org
Received: from mail.kernel.org (mail.kernel.org [198.145.19.201])
by patchwork1.web.kernel.org (Postfix) with ESMTP id C147F9F26C
for ;
Fri, 4 Jul 2014 08:33:35 +0000 (UTC)
Received: from mail.kernel.org (localhost [127.0.0.1])
by mail.kernel.org (Postfix) with ESMTP id 13E05203E6
for ;
Fri, 4 Jul 2014 08:33:35 +0000 (UTC)
Received: from bombadil.infradead.org (bombadil.infradead.org
[198.137.202.9])
(using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mail.kernel.org (Postfix) with ESMTPS id 2BCDF203E5
for ;
Fri, 4 Jul 2014 08:33:34 +0000 (UTC)
Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux))
id 1X2yuG-0007J2-DR; Fri, 04 Jul 2014 08:31:44 +0000
Received: from metis.ext.pengutronix.de
([2001:6f8:1178:4:290:27ff:fe1d:cc33])
by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat
Linux)) id 1X2yu9-0007BE-6J
for linux-arm-kernel@lists.infradead.org;
Fri, 04 Jul 2014 08:31:37 +0000
Received: from dude.hi.pengutronix.de ([10.1.0.7] helo=dude.pengutronix.de)
by metis.ext.pengutronix.de with esmtp (Exim 4.72)
(envelope-from )
id 1X2ytR-0006r4-1l; Fri, 04 Jul 2014 10:30:53 +0200
From: Philipp Zabel
To: Russell King
Subject: [PATCH 4/5] drm: use for_each_endpoint_of_node macro in
drm_of_find_possible_crtcs
Date: Fri, 4 Jul 2014 10:30:45 +0200
Message-Id: <1404462646-1769-5-git-send-email-p.zabel@pengutronix.de>
X-Mailer: git-send-email 2.0.0
In-Reply-To: <1404462646-1769-1-git-send-email-p.zabel@pengutronix.de>
References: <1404462646-1769-1-git-send-email-p.zabel@pengutronix.de>
X-SA-Exim-Connect-IP: 10.1.0.7
X-SA-Exim-Mail-From: p.zabel@pengutronix.de
X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de);
SAEximRunCond expanded to false
X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3
X-CRM114-CacheID: sfid-20140704_013137_470899_D1017812
X-CRM114-Status: GOOD ( 12.56 )
X-Spam-Score: -0.0 (/)
Cc: devel@driverdev.osuosl.org, Philipp Zabel ,
Greg Kroah-Hartman ,
Laurent Pinchart ,
kernel@pengutronix.de, Grant Likely ,
linux-arm-kernel@lists.infradead.org
X-BeenThere: linux-arm-kernel@lists.infradead.org
X-Mailman-Version: 2.1.18-1
Precedence: list
List-Id:
List-Unsubscribe:
,
List-Archive:
List-Post:
List-Help:
List-Subscribe:
,
MIME-Version: 1.0
Sender: "linux-arm-kernel"
Errors-To:
linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, T_RP_MATCHES_RCVD,
UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org
X-Virus-Scanned: ClamAV using ClamSMTP
Using the for_each_... macro should make the code a bit shorter and
easier to read.
Signed-off-by: Philipp Zabel
---
drivers/gpu/drm/drm_of.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c
index 46d9678..1b315b6 100644
--- a/drivers/gpu/drm/drm_of.c
+++ b/drivers/gpu/drm/drm_of.c
@@ -44,11 +44,7 @@ uint32_t drm_of_find_possible_crtcs(struct drm_device *dev,
struct device_node *remote_port, *ep = NULL;
uint32_t possible_crtcs = 0;
- do {
- ep = of_graph_get_next_endpoint(port, ep);
- if (!ep)
- break;
-
+ for_each_endpoint_of_node(port, ep) {
remote_port = of_graph_get_remote_port(ep);
if (!remote_port) {
of_node_put(ep);
@@ -58,7 +54,7 @@ uint32_t drm_of_find_possible_crtcs(struct drm_device *dev,
possible_crtcs |= drm_crtc_port_mask(dev, remote_port);
of_node_put(remote_port);
- } while (1);
+ }
return possible_crtcs;
}