diff mbox

[v2,2/2] drm/i915: Use for_each_power_domain() in i915_power_domain_info()

Message ID 1486559530-15141-2-git-send-email-joonas.lahtinen@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Joonas Lahtinen Feb. 8, 2017, 1:12 p.m. UTC
Macro seems to do exactly the same thing.

Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Comments

Chris Wilson Feb. 8, 2017, 1:39 p.m. UTC | #1
On Wed, Feb 08, 2017 at 03:12:10PM +0200, Joonas Lahtinen wrote:
> Macro seems to do exactly the same thing.

And a chance there for BIT()!
> 
> Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
Joonas Lahtinen Feb. 8, 2017, 3:31 p.m. UTC | #2
On ke, 2017-02-08 at 13:39 +0000, Chris Wilson wrote:
> On Wed, Feb 08, 2017 at 03:12:10PM +0200, Joonas Lahtinen wrote:
> > 
> > Macro seems to do exactly the same thing.
> 
> And a chance there for BIT()!
> > 
> > 
> > Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

Pushed, thanks for the review.

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 152f23d..6400f83 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -2822,15 +2822,10 @@  static int i915_power_domain_info(struct seq_file *m, void *unused)
 		seq_printf(m, "%-25s %d\n", power_well->name,
 			   power_well->count);
 
-		for (power_domain = 0; power_domain < POWER_DOMAIN_NUM;
-		     power_domain++) {
-			if (!(BIT(power_domain) & power_well->domains))
-				continue;
-
+		for_each_power_domain(power_domain, power_well->domains)
 			seq_printf(m, "  %-23s %d\n",
 				 intel_display_power_domain_str(power_domain),
 				 power_domains->domain_use_count[power_domain]);
-		}
 	}
 
 	mutex_unlock(&power_domains->lock);