All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: camss: camss-video: Don't zero subdev format again after initialization
@ 2023-05-03  7:53 Yassine Oudjana
  2023-05-03  9:39 ` Bryan O'Donoghue
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Yassine Oudjana @ 2023-05-03  7:53 UTC (permalink / raw)
  To: Robert Foss, Todor Tomov, Bryan O'Donoghue, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Mauro Carvalho Chehab,
	Tomi Valkeinen, Sakari Ailus, Shuah Khan, Lad Prabhakar,
	Laurent Pinchart
  Cc: Yassine Oudjana, Yassine Oudjana, linux-media, linux-arm-msm,
	linux-kernel

From: Yassine Oudjana <y.oudjana@protonmail.com>

In an earlier commit, setting the which field of the subdev format struct
in video_get_subdev_format was moved to a designated initializer that also
zeroes all other fields. However, the memset call that was zeroing the
fields earlier was left in place, causing the which field to be cleared
after being set in the initializer.

Remove the memset call from video_get_subdev_format to avoid clearing the
initialized which field.

Fixes: ecefa105cc44 ("media: Zero-initialize all structures passed to subdev pad operations")
Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com>
---
 drivers/media/platform/qcom/camss/camss-video.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/platform/qcom/camss/camss-video.c b/drivers/media/platform/qcom/camss/camss-video.c
index 898f32177b12..8640db306026 100644
--- a/drivers/media/platform/qcom/camss/camss-video.c
+++ b/drivers/media/platform/qcom/camss/camss-video.c
@@ -353,7 +353,6 @@ static int video_get_subdev_format(struct camss_video *video,
 	if (subdev == NULL)
 		return -EPIPE;
 
-	memset(&fmt, 0, sizeof(fmt));
 	fmt.pad = pad;
 
 	ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, &fmt);
-- 
2.40.0


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

* Re: [PATCH] media: camss: camss-video: Don't zero subdev format again after initialization
  2023-05-03  7:53 [PATCH] media: camss: camss-video: Don't zero subdev format again after initialization Yassine Oudjana
@ 2023-05-03  9:39 ` Bryan O'Donoghue
  2023-05-22 13:51 ` Andrey Konovalov
  2023-05-30 17:42 ` Laurent Pinchart
  2 siblings, 0 replies; 5+ messages in thread
From: Bryan O'Donoghue @ 2023-05-03  9:39 UTC (permalink / raw)
  To: Yassine Oudjana, Robert Foss, Todor Tomov, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Mauro Carvalho Chehab,
	Tomi Valkeinen, Sakari Ailus, Shuah Khan, Lad Prabhakar,
	Laurent Pinchart
  Cc: Yassine Oudjana, linux-media, linux-arm-msm, linux-kernel

On 03/05/2023 08:53, Yassine Oudjana wrote:
> From: Yassine Oudjana <y.oudjana@protonmail.com>
> 
> In an earlier commit, setting the which field of the subdev format struct
> in video_get_subdev_format was moved to a designated initializer that also
> zeroes all other fields. However, the memset call that was zeroing the
> fields earlier was left in place, causing the which field to be cleared
> after being set in the initializer.
> 
> Remove the memset call from video_get_subdev_format to avoid clearing the
> initialized which field.
> 
> Fixes: ecefa105cc44 ("media: Zero-initialize all structures passed to subdev pad operations")
> Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com>
> ---
>   drivers/media/platform/qcom/camss/camss-video.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/media/platform/qcom/camss/camss-video.c b/drivers/media/platform/qcom/camss/camss-video.c
> index 898f32177b12..8640db306026 100644
> --- a/drivers/media/platform/qcom/camss/camss-video.c
> +++ b/drivers/media/platform/qcom/camss/camss-video.c
> @@ -353,7 +353,6 @@ static int video_get_subdev_format(struct camss_video *video,
>   	if (subdev == NULL)
>   		return -EPIPE;
>   
> -	memset(&fmt, 0, sizeof(fmt));
>   	fmt.pad = pad;
>   
>   	ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, &fmt);

Acked-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>

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

* Re: [PATCH] media: camss: camss-video: Don't zero subdev format again after initialization
  2023-05-03  7:53 [PATCH] media: camss: camss-video: Don't zero subdev format again after initialization Yassine Oudjana
  2023-05-03  9:39 ` Bryan O'Donoghue
@ 2023-05-22 13:51 ` Andrey Konovalov
  2023-05-30 17:42 ` Laurent Pinchart
  2 siblings, 0 replies; 5+ messages in thread
From: Andrey Konovalov @ 2023-05-22 13:51 UTC (permalink / raw)
  To: Yassine Oudjana, Robert Foss, Todor Tomov, Bryan O'Donoghue,
	Andy Gross, Bjorn Andersson, Konrad Dybcio,
	Mauro Carvalho Chehab, Tomi Valkeinen, Sakari Ailus, Shuah Khan,
	Lad Prabhakar, Laurent Pinchart
  Cc: Yassine Oudjana, linux-media, linux-arm-msm, linux-kernel


On 03.05.2023 10:53, Yassine Oudjana wrote:
> From: Yassine Oudjana <y.oudjana@protonmail.com>
> 
> In an earlier commit, setting the which field of the subdev format struct
> in video_get_subdev_format was moved to a designated initializer that also
> zeroes all other fields. However, the memset call that was zeroing the
> fields earlier was left in place, causing the which field to be cleared
> after being set in the initializer.
> 
> Remove the memset call from video_get_subdev_format to avoid clearing the
> initialized which field.
> 
> Fixes: ecefa105cc44 ("media: Zero-initialize all structures passed to subdev pad operations")
> Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com>
> ---
>   drivers/media/platform/qcom/camss/camss-video.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/media/platform/qcom/camss/camss-video.c b/drivers/media/platform/qcom/camss/camss-video.c
> index 898f32177b12..8640db306026 100644
> --- a/drivers/media/platform/qcom/camss/camss-video.c
> +++ b/drivers/media/platform/qcom/camss/camss-video.c
> @@ -353,7 +353,6 @@ static int video_get_subdev_format(struct camss_video *video,
>   	if (subdev == NULL)
>   		return -EPIPE;
>   
> -	memset(&fmt, 0, sizeof(fmt));
>   	fmt.pad = pad;
>   
>   	ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, &fmt);

Have verified that this fix does work on RB3 and RB5 boards and is 
necessary for the capture to work.

Thanks!

Tested-by: Andrey Konovalov <andrey.konovalov@linaro.org>

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

* Re: [PATCH] media: camss: camss-video: Don't zero subdev format again after initialization
  2023-05-03  7:53 [PATCH] media: camss: camss-video: Don't zero subdev format again after initialization Yassine Oudjana
  2023-05-03  9:39 ` Bryan O'Donoghue
  2023-05-22 13:51 ` Andrey Konovalov
@ 2023-05-30 17:42 ` Laurent Pinchart
  2023-05-30 17:45   ` Laurent Pinchart
  2 siblings, 1 reply; 5+ messages in thread
From: Laurent Pinchart @ 2023-05-30 17:42 UTC (permalink / raw)
  To: Yassine Oudjana
  Cc: Robert Foss, Todor Tomov, Bryan O'Donoghue, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Mauro Carvalho Chehab,
	Tomi Valkeinen, Sakari Ailus, Shuah Khan, Lad Prabhakar,
	Yassine Oudjana, linux-media, linux-arm-msm, linux-kernel

Hi Yassine,

Thank you for the patch.

On Wed, May 03, 2023 at 10:53:40AM +0300, Yassine Oudjana wrote:
> From: Yassine Oudjana <y.oudjana@protonmail.com>
> 
> In an earlier commit, setting the which field of the subdev format struct
> in video_get_subdev_format was moved to a designated initializer that also
> zeroes all other fields. However, the memset call that was zeroing the
> fields earlier was left in place, causing the which field to be cleared
> after being set in the initializer.
> 
> Remove the memset call from video_get_subdev_format to avoid clearing the
> initialized which field.
> 
> Fixes: ecefa105cc44 ("media: Zero-initialize all structures passed to subdev pad operations")
> Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

This is a regression fix, I'll send a pull request right away.

> ---
>  drivers/media/platform/qcom/camss/camss-video.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/media/platform/qcom/camss/camss-video.c b/drivers/media/platform/qcom/camss/camss-video.c
> index 898f32177b12..8640db306026 100644
> --- a/drivers/media/platform/qcom/camss/camss-video.c
> +++ b/drivers/media/platform/qcom/camss/camss-video.c
> @@ -353,7 +353,6 @@ static int video_get_subdev_format(struct camss_video *video,
>  	if (subdev == NULL)
>  		return -EPIPE;
>  
> -	memset(&fmt, 0, sizeof(fmt));
>  	fmt.pad = pad;
>  
>  	ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, &fmt);

-- 
Regards,

Laurent Pinchart

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

* Re: [PATCH] media: camss: camss-video: Don't zero subdev format again after initialization
  2023-05-30 17:42 ` Laurent Pinchart
@ 2023-05-30 17:45   ` Laurent Pinchart
  0 siblings, 0 replies; 5+ messages in thread
From: Laurent Pinchart @ 2023-05-30 17:45 UTC (permalink / raw)
  To: Yassine Oudjana
  Cc: Robert Foss, Todor Tomov, Bryan O'Donoghue, Andy Gross,
	Bjorn Andersson, Konrad Dybcio, Mauro Carvalho Chehab,
	Tomi Valkeinen, Sakari Ailus, Shuah Khan, Lad Prabhakar,
	Yassine Oudjana, linux-media, linux-arm-msm, linux-kernel

On Tue, May 30, 2023 at 08:42:30PM +0300, Laurent Pinchart wrote:
> Hi Yassine,
> 
> Thank you for the patch.
> 
> On Wed, May 03, 2023 at 10:53:40AM +0300, Yassine Oudjana wrote:
> > From: Yassine Oudjana <y.oudjana@protonmail.com>
> > 
> > In an earlier commit, setting the which field of the subdev format struct
> > in video_get_subdev_format was moved to a designated initializer that also
> > zeroes all other fields. However, the memset call that was zeroing the
> > fields earlier was left in place, causing the which field to be cleared
> > after being set in the initializer.
> > 
> > Remove the memset call from video_get_subdev_format to avoid clearing the
> > initialized which field.
> > 
> > Fixes: ecefa105cc44 ("media: Zero-initialize all structures passed to subdev pad operations")
> > Signed-off-by: Yassine Oudjana <y.oudjana@protonmail.com>
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> This is a regression fix, I'll send a pull request right away.

The patch has actually been applied to the media fixes branch already
:-)

> > ---
> >  drivers/media/platform/qcom/camss/camss-video.c | 1 -
> >  1 file changed, 1 deletion(-)
> > 
> > diff --git a/drivers/media/platform/qcom/camss/camss-video.c b/drivers/media/platform/qcom/camss/camss-video.c
> > index 898f32177b12..8640db306026 100644
> > --- a/drivers/media/platform/qcom/camss/camss-video.c
> > +++ b/drivers/media/platform/qcom/camss/camss-video.c
> > @@ -353,7 +353,6 @@ static int video_get_subdev_format(struct camss_video *video,
> >  	if (subdev == NULL)
> >  		return -EPIPE;
> >  
> > -	memset(&fmt, 0, sizeof(fmt));
> >  	fmt.pad = pad;
> >  
> >  	ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, &fmt);

-- 
Regards,

Laurent Pinchart

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

end of thread, other threads:[~2023-05-30 17:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-03  7:53 [PATCH] media: camss: camss-video: Don't zero subdev format again after initialization Yassine Oudjana
2023-05-03  9:39 ` Bryan O'Donoghue
2023-05-22 13:51 ` Andrey Konovalov
2023-05-30 17:42 ` Laurent Pinchart
2023-05-30 17:45   ` Laurent Pinchart

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.