All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/2] staging: vc04_services: Fix two checkpatch warnings
@ 2019-03-05 22:51 Daniela Mormocea
  2019-03-05 22:52 ` [PATCH v5 1/2] Fix multiple line dereference Daniela Mormocea
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Daniela Mormocea @ 2019-03-05 22:51 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Daniela Mormocea

These patches fix the following warnings:
-Avoid multiple line dereference
-Logical continuations should be on the previous line

Changes in v5:
-add driver name in all the patches from the series

Changes in v4:
-add driver name in subject

Changes in v3:
-add cover-letter to patch series

Changes in v2:
-make these a patch series

Daniela Mormocea (2):
  Fix multiple line dereference
  Fix logical continuations warnings

 .../vc04_services/bcm2835-camera/bcm2835-camera.c  | 51 ++++++++--------------
 1 file changed, 19 insertions(+), 32 deletions(-)

-- 
2.7.4



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

* [PATCH v5 1/2] Fix multiple line dereference
  2019-03-05 22:51 [PATCH v5 0/2] staging: vc04_services: Fix two checkpatch warnings Daniela Mormocea
@ 2019-03-05 22:52 ` Daniela Mormocea
  2019-03-05 22:52 ` [PATCH v5 2/2] Fix logical continuations warnings Daniela Mormocea
  2019-03-06  6:39 ` [Outreachy kernel] [PATCH v5 0/2] staging: vc04_services: Fix two checkpatch warnings Julia Lawall
  2 siblings, 0 replies; 5+ messages in thread
From: Daniela Mormocea @ 2019-03-05 22:52 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Daniela Mormocea

Fix multiple line dereference to avoid checkpatch warnings

Signed-off-by: Daniela Mormocea <daniela.mormocea@gmail.com>
---

Changes in v5:
-add driver name in all the patches from the series

Changes in v4:
-add driver name in subject

Changes in v3:
-add cover-letter to patch series

Changes in v2:
-make these a patch series


 .../vc04_services/bcm2835-camera/bcm2835-camera.c  | 39 ++++++++--------------
 1 file changed, 13 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
index 611a6ee..e71738a 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
@@ -312,8 +312,7 @@ static void buffer_cleanup(struct vb2_buffer *vb)
 static inline bool is_capturing(struct bm2835_mmal_dev *dev)
 {
 	return dev->capture.camera_port ==
-	    &dev->
-	    component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_CAPTURE];
+	    &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_CAPTURE];
 }
 
 static void buffer_cb(struct vchiq_mmal_instance *instance,
@@ -751,8 +750,7 @@ static int vidioc_overlay(struct file *file, void *f, unsigned int on)
 		return 0;	/* already in requested state */
 
 	src =
-	    &dev->component[MMAL_COMPONENT_CAMERA]->
-	    output[MMAL_CAMERA_PORT_PREVIEW];
+	    &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_PREVIEW];
 
 	if (!on) {
 		/* disconnect preview ports and disable component */
@@ -807,8 +805,7 @@ static int vidioc_g_fbuf(struct file *file, void *fh,
 	 */
 	struct bm2835_mmal_dev *dev = video_drvdata(file);
 	struct vchiq_mmal_port *preview_port =
-		    &dev->component[MMAL_COMPONENT_CAMERA]->
-		    output[MMAL_CAMERA_PORT_PREVIEW];
+		    &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_PREVIEW];
 
 	a->capability = V4L2_FBUF_CAP_EXTERNOVERLAY |
 			V4L2_FBUF_CAP_GLOBAL_ALPHA;
@@ -1000,8 +997,7 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev,
 					       dev->capture.camera_port, NULL);
 		dev->capture.camera_port = NULL;
 		ret = vchiq_mmal_component_disable(dev->instance,
-						   dev->capture.
-						   encode_component);
+						   dev->capture.encode_component);
 		if (ret)
 			v4l2_err(&dev->v4l2_dev,
 				 "Failed to disable encode component %d\n",
@@ -1016,26 +1012,22 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev,
 		if (f->fmt.pix.width <= max_video_width
 		    && f->fmt.pix.height <= max_video_height)
 			camera_port = port =
-			    &dev->component[MMAL_COMPONENT_CAMERA]->
-			    output[MMAL_CAMERA_PORT_VIDEO];
+			    &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_VIDEO];
 		else
 			camera_port = port =
-			    &dev->component[MMAL_COMPONENT_CAMERA]->
-			    output[MMAL_CAMERA_PORT_CAPTURE];
+			    &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_CAPTURE];
 		break;
 	case MMAL_COMPONENT_IMAGE_ENCODE:
 		encode_component = dev->component[MMAL_COMPONENT_IMAGE_ENCODE];
 		port = &dev->component[MMAL_COMPONENT_IMAGE_ENCODE]->output[0];
 		camera_port =
-		    &dev->component[MMAL_COMPONENT_CAMERA]->
-		    output[MMAL_CAMERA_PORT_CAPTURE];
+		    &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_CAPTURE];
 		break;
 	case MMAL_COMPONENT_VIDEO_ENCODE:
 		encode_component = dev->component[MMAL_COMPONENT_VIDEO_ENCODE];
 		port = &dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->output[0];
 		camera_port =
-		    &dev->component[MMAL_COMPONENT_CAMERA]->
-		    output[MMAL_CAMERA_PORT_VIDEO];
+		    &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_VIDEO];
 		break;
 	default:
 		break;
@@ -1077,13 +1069,11 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev,
 
 	if (!ret
 	    && camera_port ==
-	    &dev->component[MMAL_COMPONENT_CAMERA]->
-	    output[MMAL_CAMERA_PORT_VIDEO]) {
+	    &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_VIDEO]) {
 		bool overlay_enabled =
 		    !!dev->component[MMAL_COMPONENT_PREVIEW]->enabled;
 		struct vchiq_mmal_port *preview_port =
-		    &dev->component[MMAL_COMPONENT_CAMERA]->
-		    output[MMAL_CAMERA_PORT_PREVIEW];
+		    &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_PREVIEW];
 		/* Preview and encode ports need to match on resolution */
 		if (overlay_enabled) {
 			/* Need to disable the overlay before we can update
@@ -1677,8 +1667,7 @@ static int mmal_init(struct bm2835_mmal_dev *dev)
 
 	/* get the video encoder component ready */
 	ret = vchiq_mmal_component_init(dev->instance, "ril.video_encode",
-					&dev->
-					component[MMAL_COMPONENT_VIDEO_ENCODE]);
+					&dev->component[MMAL_COMPONENT_VIDEO_ENCODE]);
 	if (ret < 0)
 		goto unreg_image_encoder;
 
@@ -1801,12 +1790,10 @@ static void bcm2835_cleanup_instance(struct bm2835_mmal_dev *dev)
 				     dev->component[MMAL_COMPONENT_CAMERA]);
 
 	vchiq_mmal_component_finalise(dev->instance,
-				      dev->
-				      component[MMAL_COMPONENT_VIDEO_ENCODE]);
+				      dev->component[MMAL_COMPONENT_VIDEO_ENCODE]);
 
 	vchiq_mmal_component_finalise(dev->instance,
-				      dev->
-				      component[MMAL_COMPONENT_IMAGE_ENCODE]);
+				      dev->component[MMAL_COMPONENT_IMAGE_ENCODE]);
 
 	vchiq_mmal_component_finalise(dev->instance,
 				      dev->component[MMAL_COMPONENT_PREVIEW]);
-- 
2.7.4



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

* [PATCH v5 2/2] Fix logical continuations warnings
  2019-03-05 22:51 [PATCH v5 0/2] staging: vc04_services: Fix two checkpatch warnings Daniela Mormocea
  2019-03-05 22:52 ` [PATCH v5 1/2] Fix multiple line dereference Daniela Mormocea
@ 2019-03-05 22:52 ` Daniela Mormocea
  2019-03-06  6:35   ` [Outreachy kernel] " Julia Lawall
  2019-03-06  6:39 ` [Outreachy kernel] [PATCH v5 0/2] staging: vc04_services: Fix two checkpatch warnings Julia Lawall
  2 siblings, 1 reply; 5+ messages in thread
From: Daniela Mormocea @ 2019-03-05 22:52 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Daniela Mormocea

Fix boolean operators break in the right place

Signed-off-by: Daniela Mormocea <daniela.mormocea@gmail.com>
---

Changes in v5:
-add driver name in all the patches from the series

Changes in v4:
-add driver name in subject

Changes in v3:
-add cover-letter to patch series

Changes in v2:
-make these a patch series


 .../staging/vc04_services/bcm2835-camera/bcm2835-camera.c    | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
index e71738a..d22b928 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
@@ -512,8 +512,8 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count)
 		msleep(300);
 
 	/* enable the connection from camera to encoder (if applicable) */
-	if (dev->capture.camera_port != dev->capture.port
-	    && dev->capture.camera_port) {
+	if (dev->capture.camera_port != dev->capture.port &&
+	    dev->capture.camera_port) {
 		ret = vchiq_mmal_port_enable(dev->instance,
 					     dev->capture.camera_port, NULL);
 		if (ret) {
@@ -1009,8 +1009,8 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev,
 	switch (mfmt->mmal_component) {
 	case MMAL_COMPONENT_CAMERA:
 		/* Make a further decision on port based on resolution */
-		if (f->fmt.pix.width <= max_video_width
-		    && f->fmt.pix.height <= max_video_height)
+		if (f->fmt.pix.width <= max_video_width &&
+		    f->fmt.pix.height <= max_video_height)
 			camera_port = port =
 			    &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_VIDEO];
 		else
@@ -1067,8 +1067,8 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev,
 
 	ret = vchiq_mmal_port_set_format(dev->instance, camera_port);
 
-	if (!ret
-	    && camera_port ==
+	if (!ret &&
+	    camera_port ==
 	    &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_VIDEO]) {
 		bool overlay_enabled =
 		    !!dev->component[MMAL_COMPONENT_PREVIEW]->enabled;
-- 
2.7.4



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

* Re: [Outreachy kernel] [PATCH v5 2/2] Fix logical continuations warnings
  2019-03-05 22:52 ` [PATCH v5 2/2] Fix logical continuations warnings Daniela Mormocea
@ 2019-03-06  6:35   ` Julia Lawall
  0 siblings, 0 replies; 5+ messages in thread
From: Julia Lawall @ 2019-03-06  6:35 UTC (permalink / raw)
  To: Daniela Mormocea; +Cc: outreachy-kernel

The subject line still doesn't indicate the affected driver.

julia

On Wed, 6 Mar 2019, Daniela Mormocea wrote:

> Fix boolean operators break in the right place
>
> Signed-off-by: Daniela Mormocea <daniela.mormocea@gmail.com>
> ---
>
> Changes in v5:
> -add driver name in all the patches from the series
>
> Changes in v4:
> -add driver name in subject
>
> Changes in v3:
> -add cover-letter to patch series
>
> Changes in v2:
> -make these a patch series
>
>
>  .../staging/vc04_services/bcm2835-camera/bcm2835-camera.c    | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> index e71738a..d22b928 100644
> --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> @@ -512,8 +512,8 @@ static int start_streaming(struct vb2_queue *vq, unsigned int count)
>  		msleep(300);
>
>  	/* enable the connection from camera to encoder (if applicable) */
> -	if (dev->capture.camera_port != dev->capture.port
> -	    && dev->capture.camera_port) {
> +	if (dev->capture.camera_port != dev->capture.port &&
> +	    dev->capture.camera_port) {
>  		ret = vchiq_mmal_port_enable(dev->instance,
>  					     dev->capture.camera_port, NULL);
>  		if (ret) {
> @@ -1009,8 +1009,8 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev,
>  	switch (mfmt->mmal_component) {
>  	case MMAL_COMPONENT_CAMERA:
>  		/* Make a further decision on port based on resolution */
> -		if (f->fmt.pix.width <= max_video_width
> -		    && f->fmt.pix.height <= max_video_height)
> +		if (f->fmt.pix.width <= max_video_width &&
> +		    f->fmt.pix.height <= max_video_height)
>  			camera_port = port =
>  			    &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_VIDEO];
>  		else
> @@ -1067,8 +1067,8 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev,
>
>  	ret = vchiq_mmal_port_set_format(dev->instance, camera_port);
>
> -	if (!ret
> -	    && camera_port ==
> +	if (!ret &&
> +	    camera_port ==
>  	    &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_VIDEO]) {
>  		bool overlay_enabled =
>  		    !!dev->component[MMAL_COMPONENT_PREVIEW]->enabled;
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1551826351-28120-1-git-send-email-daniela.mormocea%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>


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

* Re: [Outreachy kernel] [PATCH v5 0/2] staging: vc04_services: Fix two checkpatch warnings
  2019-03-05 22:51 [PATCH v5 0/2] staging: vc04_services: Fix two checkpatch warnings Daniela Mormocea
  2019-03-05 22:52 ` [PATCH v5 1/2] Fix multiple line dereference Daniela Mormocea
  2019-03-05 22:52 ` [PATCH v5 2/2] Fix logical continuations warnings Daniela Mormocea
@ 2019-03-06  6:39 ` Julia Lawall
  2 siblings, 0 replies; 5+ messages in thread
From: Julia Lawall @ 2019-03-06  6:39 UTC (permalink / raw)
  To: Daniela Mormocea; +Cc: outreachy-kernel

OK, you have a more reasonable subject line now in the cover letter, but
it needs to be in all of the patches too.

However, if I look at the file you have changed, the recent patches on
this file have a subject line with staging: bcm2835-camera: not staging:
vc04_services:.  Please go back and read the entire tutorial again.  It
has information about how to choose the subject line, how to make a
series, etc.  These are things that have evolved in a particular way in
the Linux kernel community.  You can't guess on your own what is the right
thing to do.

julia

On Wed, 6 Mar 2019, Daniela Mormocea wrote:

> These patches fix the following warnings:
> -Avoid multiple line dereference
> -Logical continuations should be on the previous line
>
> Changes in v5:
> -add driver name in all the patches from the series
>
> Changes in v4:
> -add driver name in subject
>
> Changes in v3:
> -add cover-letter to patch series
>
> Changes in v2:
> -make these a patch series
>
> Daniela Mormocea (2):
>   Fix multiple line dereference
>   Fix logical continuations warnings
>
>  .../vc04_services/bcm2835-camera/bcm2835-camera.c  | 51 ++++++++--------------
>  1 file changed, 19 insertions(+), 32 deletions(-)
>
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1551826297-28015-1-git-send-email-daniela.mormocea%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>


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

end of thread, other threads:[~2019-03-06  6:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-05 22:51 [PATCH v5 0/2] staging: vc04_services: Fix two checkpatch warnings Daniela Mormocea
2019-03-05 22:52 ` [PATCH v5 1/2] Fix multiple line dereference Daniela Mormocea
2019-03-05 22:52 ` [PATCH v5 2/2] Fix logical continuations warnings Daniela Mormocea
2019-03-06  6:35   ` [Outreachy kernel] " Julia Lawall
2019-03-06  6:39 ` [Outreachy kernel] [PATCH v5 0/2] staging: vc04_services: Fix two checkpatch warnings Julia Lawall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.