Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1635889 > unrolled thread

[PATCH 4/9] drm/i915: Delete unnecessary braces in three functions

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2017-05-04 19:00 +0200
Last post2017-05-05 08:00 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4/9] drm/i915: Delete unnecessary braces in three functions SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-04 19:00 +0200
    Re: [PATCH 4/9] drm/i915: Delete unnecessary braces in three functions Jani Nikula <jani.nikula@linux.intel.com> - 2017-05-05 08:00 +0200

#1635889 — [PATCH 4/9] drm/i915: Delete unnecessary braces in three functions

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2017-05-04 19:00 +0200
Subject[PATCH 4/9] drm/i915: Delete unnecessary braces in three functions
Message-ID<tDsgF-6aT-5@gated-at.bofh.it>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Thu, 4 May 2017 13:40:53 +0200

Do not use curly brackets at some source code places
where a single statement should be sufficient.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 296108464f2b..bf9a2e8d8c16 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -565,13 +565,13 @@ static int i915_gem_pageflip_info(struct seq_file *m, void *data)
 			u32 addr;
 
 			pending = atomic_read(&work->pending);
-			if (pending) {
+			if (pending)
 				seq_printf(m, "Flip ioctl preparing on pipe %c (plane %c)\n",
 					   pipe, plane);
-			} else {
+			else
 				seq_printf(m, "Flip pending (waiting for vsync) on pipe %c (plane %c)\n",
 					   pipe, plane);
-			}
+
 			if (work->flip_queued_req) {
 				struct intel_engine_cs *engine = work->flip_queued_req->engine;
 
@@ -3130,13 +3130,11 @@ static void intel_plane_info(struct seq_file *m, struct intel_crtc *intel_crtc)
 		}
 
 		state = plane->state;
-
-		if (state->fb) {
+		if (state->fb)
 			drm_get_format_name(state->fb->format->format,
 					    &format_name);
-		} else {
+		else
 			sprintf(format_name.str, "N/A");
-		}
 
 		seq_printf(m, "\t--Plane id %d: type=%s, crtc_pos=%4dx%4d, crtc_size=%4dx%4d, src_pos=%d.%04ux%d.%04u, src_size=%d.%04ux%d.%04u, format=%s, rotation=%s\n",
 			   plane->base.id,
@@ -4636,13 +4634,12 @@ static int i915_sseu_status(struct seq_file *m, void *unused)
 
 	intel_runtime_pm_get(dev_priv);
 
-	if (IS_CHERRYVIEW(dev_priv)) {
+	if (IS_CHERRYVIEW(dev_priv))
 		cherryview_sseu_device_status(dev_priv, &sseu);
-	} else if (IS_BROADWELL(dev_priv)) {
+	else if (IS_BROADWELL(dev_priv))
 		broadwell_sseu_device_status(dev_priv, &sseu);
-	} else if (INTEL_GEN(dev_priv) >= 9) {
+	else if (INTEL_GEN(dev_priv) >= 9)
 		gen9_sseu_device_status(dev_priv, &sseu);
-	}
 
 	intel_runtime_pm_put(dev_priv);
 
-- 
2.12.2

[toc] | [next] | [standalone]


#1636175

FromJani Nikula <jani.nikula@linux.intel.com>
Date2017-05-05 08:00 +0200
Message-ID<tDErv-5VP-1@gated-at.bofh.it>
In reply to#1635889
On Thu, 04 May 2017, SF Markus Elfring <elfring@users.sourceforge.net> wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Thu, 4 May 2017 13:40:53 +0200
>
> Do not use curly brackets at some source code places
> where a single statement should be sufficient.

We only tend to do this kind of changes when we're changing the
surrounding code anyway. I'm sure there are plenty of places where you
could add or remove braces, but it's not productive to go around
changing just them.

BR,
Jani.


>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
>  drivers/gpu/drm/i915/i915_debugfs.c | 19 ++++++++-----------
>  1 file changed, 8 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 296108464f2b..bf9a2e8d8c16 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -565,13 +565,13 @@ static int i915_gem_pageflip_info(struct seq_file *m, void *data)
>  			u32 addr;
>  
>  			pending = atomic_read(&work->pending);
> -			if (pending) {
> +			if (pending)
>  				seq_printf(m, "Flip ioctl preparing on pipe %c (plane %c)\n",
>  					   pipe, plane);
> -			} else {
> +			else
>  				seq_printf(m, "Flip pending (waiting for vsync) on pipe %c (plane %c)\n",
>  					   pipe, plane);
> -			}
> +
>  			if (work->flip_queued_req) {
>  				struct intel_engine_cs *engine = work->flip_queued_req->engine;
>  
> @@ -3130,13 +3130,11 @@ static void intel_plane_info(struct seq_file *m, struct intel_crtc *intel_crtc)
>  		}
>  
>  		state = plane->state;
> -
> -		if (state->fb) {
> +		if (state->fb)
>  			drm_get_format_name(state->fb->format->format,
>  					    &format_name);
> -		} else {
> +		else
>  			sprintf(format_name.str, "N/A");
> -		}
>  
>  		seq_printf(m, "\t--Plane id %d: type=%s, crtc_pos=%4dx%4d, crtc_size=%4dx%4d, src_pos=%d.%04ux%d.%04u, src_size=%d.%04ux%d.%04u, format=%s, rotation=%s\n",
>  			   plane->base.id,
> @@ -4636,13 +4634,12 @@ static int i915_sseu_status(struct seq_file *m, void *unused)
>  
>  	intel_runtime_pm_get(dev_priv);
>  
> -	if (IS_CHERRYVIEW(dev_priv)) {
> +	if (IS_CHERRYVIEW(dev_priv))
>  		cherryview_sseu_device_status(dev_priv, &sseu);
> -	} else if (IS_BROADWELL(dev_priv)) {
> +	else if (IS_BROADWELL(dev_priv))
>  		broadwell_sseu_device_status(dev_priv, &sseu);
> -	} else if (INTEL_GEN(dev_priv) >= 9) {
> +	else if (INTEL_GEN(dev_priv) >= 9)
>  		gen9_sseu_device_status(dev_priv, &sseu);
> -	}
>  
>  	intel_runtime_pm_put(dev_priv);

-- 
Jani Nikula, Intel Open Source Technology Center

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web