kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] drm/i915: cleanup some indenting
@ 2015-02-25 13:17 Dan Carpenter
  2015-02-25 13:29 ` Jani Nikula
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2015-02-25 13:17 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx, kernel-janitors, dri-devel

Static checkers complain that we should probably add curly braces
because, from the indenting, it looks like seq_printf() should be inside
the list_for_each_entry() loop.  But the code is actually correct, it's
just the indenting which is off.

Besides fixing the indenting on seq_printf(), I did add curly braces,
because generally mult-line indents should have curly braces to make
them more readable.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 26e9c7b..a76b2ed 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -139,10 +139,11 @@ describe_obj(struct seq_file *m, struct drm_i915_gem_object *obj)
 		   obj->madv = I915_MADV_DONTNEED ? " purgeable" : "");
 	if (obj->base.name)
 		seq_printf(m, " (name: %d)", obj->base.name);
-	list_for_each_entry(vma, &obj->vma_list, vma_link)
+	list_for_each_entry(vma, &obj->vma_list, vma_link) {
 		if (vma->pin_count > 0)
 			pin_count++;
-		seq_printf(m, " (pinned x %d)", pin_count);
+	}
+	seq_printf(m, " (pinned x %d)", pin_count);
 	if (obj->pin_display)
 		seq_printf(m, " (display)");
 	if (obj->fence_reg != I915_FENCE_REG_NONE)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [patch] drm/i915: cleanup some indenting
  2015-02-25 13:17 [patch] drm/i915: cleanup some indenting Dan Carpenter
@ 2015-02-25 13:29 ` Jani Nikula
  2015-02-25 13:54   ` [Intel-gfx] " Daniel Vetter
  0 siblings, 1 reply; 3+ messages in thread
From: Jani Nikula @ 2015-02-25 13:29 UTC (permalink / raw)
  To: Dan Carpenter, Daniel Vetter
  Cc: David Airlie, intel-gfx, kernel-janitors, dri-devel

On Wed, 25 Feb 2015, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> Static checkers complain that we should probably add curly braces
> because, from the indenting, it looks like seq_printf() should be inside
> the list_for_each_entry() loop.  But the code is actually correct, it's
> just the indenting which is off.
>
> Besides fixing the indenting on seq_printf(), I did add curly braces,
> because generally mult-line indents should have curly braces to make
> them more readable.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

The unintended indent was left behind and not unindented in

commit d7f46fc4e7323887494db13f063a8e59861fefb0
Author: Ben Widawsky <benjamin.widawsky@intel.com>
Date:   Fri Dec 6 14:10:55 2013 -0800

    drm/i915: Make pin count per VMA

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 26e9c7b..a76b2ed 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -139,10 +139,11 @@ describe_obj(struct seq_file *m, struct drm_i915_gem_object *obj)
>  		   obj->madv = I915_MADV_DONTNEED ? " purgeable" : "");
>  	if (obj->base.name)
>  		seq_printf(m, " (name: %d)", obj->base.name);
> -	list_for_each_entry(vma, &obj->vma_list, vma_link)
> +	list_for_each_entry(vma, &obj->vma_list, vma_link) {
>  		if (vma->pin_count > 0)
>  			pin_count++;
> -		seq_printf(m, " (pinned x %d)", pin_count);
> +	}
> +	seq_printf(m, " (pinned x %d)", pin_count);
>  	if (obj->pin_display)
>  		seq_printf(m, " (display)");
>  	if (obj->fence_reg != I915_FENCE_REG_NONE)

-- 
Jani Nikula, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Intel-gfx] [patch] drm/i915: cleanup some indenting
  2015-02-25 13:29 ` Jani Nikula
@ 2015-02-25 13:54   ` Daniel Vetter
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Vetter @ 2015-02-25 13:54 UTC (permalink / raw)
  To: Jani Nikula
  Cc: intel-gfx, kernel-janitors, dri-devel, Daniel Vetter,
	Dan Carpenter

On Wed, Feb 25, 2015 at 03:29:05PM +0200, Jani Nikula wrote:
> On Wed, 25 Feb 2015, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> > Static checkers complain that we should probably add curly braces
> > because, from the indenting, it looks like seq_printf() should be inside
> > the list_for_each_entry() loop.  But the code is actually correct, it's
> > just the indenting which is off.
> >
> > Besides fixing the indenting on seq_printf(), I did add curly braces,
> > because generally mult-line indents should have curly braces to make
> > them more readable.
> >
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> The unintended indent was left behind and not unindented in
> 
> commit d7f46fc4e7323887494db13f063a8e59861fefb0
> Author: Ben Widawsky <benjamin.widawsky@intel.com>
> Date:   Fri Dec 6 14:10:55 2013 -0800
> 
>     drm/i915: Make pin count per VMA

Added to the commit message.
> 
> Reviewed-by: Jani Nikula <jani.nikula@intel.com>

Queued for -next, thanks for the patch.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-02-25 13:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-25 13:17 [patch] drm/i915: cleanup some indenting Dan Carpenter
2015-02-25 13:29 ` Jani Nikula
2015-02-25 13:54   ` [Intel-gfx] " Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).