linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] staging: vboxvideo: Remove unnecessary parentheses
@ 2018-10-31 15:03 Shayenne da Luz Moura
  2018-10-31 15:32 ` Hans de Goede
  0 siblings, 1 reply; 2+ messages in thread
From: Shayenne da Luz Moura @ 2018-10-31 15:03 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Hans de Goede, Michael Thayer
  Cc: devel, linux-kernel, outreachy-kernel

Remove unneeded parentheses around the arguments of ||. This reduces
clutter and code behave in the same way.
Change suggested by checkpatch.pl.

vbox_main.c:119: CHECK: Unnecessary parentheses around 'rects[i].x2 <
crtc->x'

Signed-off-by: Shayenne da Luz Moura <shayenneluzmoura@gmail.com>
---
Changes in v2:
  - Make the commit message more clearer.

Changes in v3:
  - Update to apply patch to the latest kernel tree

 drivers/staging/vboxvideo/vbox_main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/vboxvideo/vbox_main.c b/drivers/staging/vboxvideo/vbox_main.c
index 7466c1103ff6..ad0e0b62bd1e 100644
--- a/drivers/staging/vboxvideo/vbox_main.c
+++ b/drivers/staging/vboxvideo/vbox_main.c
@@ -122,10 +122,10 @@ void vbox_framebuffer_dirty_rectangles(struct drm_framebuffer *fb,
 			struct vbva_cmd_hdr cmd_hdr;
 			unsigned int crtc_id = to_vbox_crtc(crtc)->crtc_id;
 
-			if ((rects[i].x1 > crtc_x + mode->hdisplay) ||
-			    (rects[i].y1 > crtc_y + mode->vdisplay) ||
-			    (rects[i].x2 < crtc_x) ||
-			    (rects[i].y2 < crtc_y))
+			if (rects[i].x1 > crtc_x + mode->hdisplay ||
+			    rects[i].y1 > crtc_y + mode->vdisplay ||
+			    rects[i].x2 < crtc_x ||
+			    rects[i].y2 < crtc_y)
 				continue;
 
 			cmd_hdr.x = (s16)rects[i].x1;
-- 
2.19.1


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

* Re: [PATCH v3] staging: vboxvideo: Remove unnecessary parentheses
  2018-10-31 15:03 [PATCH v3] staging: vboxvideo: Remove unnecessary parentheses Shayenne da Luz Moura
@ 2018-10-31 15:32 ` Hans de Goede
  0 siblings, 0 replies; 2+ messages in thread
From: Hans de Goede @ 2018-10-31 15:32 UTC (permalink / raw)
  To: Shayenne da Luz Moura, Greg Kroah-Hartman, Michael Thayer
  Cc: devel, linux-kernel, outreachy-kernel

Hi,

On 31-10-18 16:03, Shayenne da Luz Moura wrote:
> Remove unneeded parentheses around the arguments of ||. This reduces
> clutter and code behave in the same way.
> Change suggested by checkpatch.pl.
> 
> vbox_main.c:119: CHECK: Unnecessary parentheses around 'rects[i].x2 <
> crtc->x'
> 
> Signed-off-by: Shayenne da Luz Moura <shayenneluzmoura@gmail.com>

Thank you.

Still looks good to me:

Acked-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans



> ---
> Changes in v2:
>    - Make the commit message more clearer.
> 
> Changes in v3:
>    - Update to apply patch to the latest kernel tree
> 
>   drivers/staging/vboxvideo/vbox_main.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/vboxvideo/vbox_main.c b/drivers/staging/vboxvideo/vbox_main.c
> index 7466c1103ff6..ad0e0b62bd1e 100644
> --- a/drivers/staging/vboxvideo/vbox_main.c
> +++ b/drivers/staging/vboxvideo/vbox_main.c
> @@ -122,10 +122,10 @@ void vbox_framebuffer_dirty_rectangles(struct drm_framebuffer *fb,
>   			struct vbva_cmd_hdr cmd_hdr;
>   			unsigned int crtc_id = to_vbox_crtc(crtc)->crtc_id;
>   
> -			if ((rects[i].x1 > crtc_x + mode->hdisplay) ||
> -			    (rects[i].y1 > crtc_y + mode->vdisplay) ||
> -			    (rects[i].x2 < crtc_x) ||
> -			    (rects[i].y2 < crtc_y))
> +			if (rects[i].x1 > crtc_x + mode->hdisplay ||
> +			    rects[i].y1 > crtc_y + mode->vdisplay ||
> +			    rects[i].x2 < crtc_x ||
> +			    rects[i].y2 < crtc_y)
>   				continue;
>   
>   			cmd_hdr.x = (s16)rects[i].x1;
> 

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

end of thread, other threads:[~2018-10-31 15:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-31 15:03 [PATCH v3] staging: vboxvideo: Remove unnecessary parentheses Shayenne da Luz Moura
2018-10-31 15:32 ` Hans de Goede

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).