* [PATCH] staging: vc04_services: bcm2835-camera: avoid multiple assignments
@ 2019-03-16 9:33 Payal Kshirsagar
2019-03-16 12:13 ` [Outreachy kernel] " Julia Lawall
2019-03-17 10:48 ` Greg KH
0 siblings, 2 replies; 3+ messages in thread
From: Payal Kshirsagar @ 2019-03-16 9:33 UTC (permalink / raw)
To: outreachy-kernel; +Cc: Payal Kshirsagar
To avoid style issues, avoid multiple assignments.
Signed-off-by: Payal Kshirsagar <payal.s.kshirsagar.98@gmail.com>
---
.../staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
index d22b928..5e5b610 100644
--- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
@@ -1011,11 +1011,15 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev,
/* Make a further decision on port based on resolution */
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];
+ camera_port =
+ &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_VIDEO];
+ port =
+ &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_VIDEO];
else
- camera_port = port =
- &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_CAPTURE];
+ camera_port =
+ &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_CAPTURE];
+ port =
+ &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_CAPTURE];
break;
case MMAL_COMPONENT_IMAGE_ENCODE:
encode_component = dev->component[MMAL_COMPONENT_IMAGE_ENCODE];
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Outreachy kernel] [PATCH] staging: vc04_services: bcm2835-camera: avoid multiple assignments
2019-03-16 9:33 [PATCH] staging: vc04_services: bcm2835-camera: avoid multiple assignments Payal Kshirsagar
@ 2019-03-16 12:13 ` Julia Lawall
2019-03-17 10:48 ` Greg KH
1 sibling, 0 replies; 3+ messages in thread
From: Julia Lawall @ 2019-03-16 12:13 UTC (permalink / raw)
To: Payal Kshirsagar; +Cc: outreachy-kernel
On Sat, 16 Mar 2019, Payal Kshirsagar wrote:
> To avoid style issues, avoid multiple assignments.
> Signed-off-by: Payal Kshirsagar <payal.s.kshirsagar.98@gmail.com>
> ---
> .../staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> index d22b928..5e5b610 100644
> --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> @@ -1011,11 +1011,15 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev,
> /* Make a further decision on port based on resolution */
> 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];
> + camera_port =
> + &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_VIDEO];
> + port =
> + &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_VIDEO];
> else
> - camera_port = port =
> - &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_CAPTURE];
> + camera_port =
> + &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_CAPTURE];
> + port =
> + &dev->component[MMAL_COMPONENT_CAMERA]->output[MMAL_CAMERA_PORT_CAPTURE];
I don't think this code compiles. Also, duplicating the huge expression
doesn't seem like an advantage.
julia
> break;
> case MMAL_COMPONENT_IMAGE_ENCODE:
> encode_component = dev->component[MMAL_COMPONENT_IMAGE_ENCODE];
> --
> 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/1552728839-7072-1-git-send-email-payal.s.kshirsagar.98%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Outreachy kernel] [PATCH] staging: vc04_services: bcm2835-camera: avoid multiple assignments
2019-03-16 9:33 [PATCH] staging: vc04_services: bcm2835-camera: avoid multiple assignments Payal Kshirsagar
2019-03-16 12:13 ` [Outreachy kernel] " Julia Lawall
@ 2019-03-17 10:48 ` Greg KH
1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2019-03-17 10:48 UTC (permalink / raw)
To: Payal Kshirsagar; +Cc: outreachy-kernel
On Sat, Mar 16, 2019 at 03:03:59PM +0530, Payal Kshirsagar wrote:
> To avoid style issues, avoid multiple assignments.
> Signed-off-by: Payal Kshirsagar <payal.s.kshirsagar.98@gmail.com>
You need a blank line before the signed-off-by line for this to work
properly.
> ---
> .../staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> index d22b928..5e5b610 100644
> --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
> @@ -1011,11 +1011,15 @@ static int mmal_setup_components(struct bm2835_mmal_dev *dev,
> /* Make a further decision on port based on resolution */
> 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];
> + camera_port =
Did you run your patch through checkpatch.pl after making it? It should
have complained about this line.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-03-17 10:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-16 9:33 [PATCH] staging: vc04_services: bcm2835-camera: avoid multiple assignments Payal Kshirsagar
2019-03-16 12:13 ` [Outreachy kernel] " Julia Lawall
2019-03-17 10:48 ` Greg KH
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.