diff mbox series

[16/57] media: atomisp: Remove unnecessary memset(foo, 0, sizeof(foo)) calls

Message ID 20230123125205.622152-17-hdegoede@redhat.com (mailing list archive)
State New, archived
Headers show
Series media: atomisp: Big power-management changes + lots of fixes | expand

Commit Message

Hans de Goede Jan. 23, 2023, 12:51 p.m. UTC
The memory for all of struct atomisp_video_pipe is kzalloc()-ed in
atomisp_subdev_init() so there is no need to memset parts of
struct atomisp_video_pipe to 0.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/staging/media/atomisp/pci/atomisp_subdev.c | 5 -----
 1 file changed, 5 deletions(-)

Comments

Andy Shevchenko Jan. 23, 2023, 5:41 p.m. UTC | #1
On Mon, Jan 23, 2023 at 01:51:24PM +0100, Hans de Goede wrote:
> The memory for all of struct atomisp_video_pipe is kzalloc()-ed in
> atomisp_subdev_init() so there is no need to memset parts of
> struct atomisp_video_pipe to 0.

Reviewed-by: Andy Shevchenko <andy@kernel.org>

> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  drivers/staging/media/atomisp/pci/atomisp_subdev.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/drivers/staging/media/atomisp/pci/atomisp_subdev.c b/drivers/staging/media/atomisp/pci/atomisp_subdev.c
> index c32db4ffb778..eb8f319fca5c 100644
> --- a/drivers/staging/media/atomisp/pci/atomisp_subdev.c
> +++ b/drivers/staging/media/atomisp/pci/atomisp_subdev.c
> @@ -1054,11 +1054,6 @@ static int atomisp_init_subdev_pipe(struct atomisp_sub_device *asd,
>  	INIT_LIST_HEAD(&pipe->activeq);
>  	INIT_LIST_HEAD(&pipe->buffers_waiting_for_param);
>  	INIT_LIST_HEAD(&pipe->per_frame_params);
> -	memset(pipe->frame_request_config_id,
> -	       0, VIDEO_MAX_FRAME * sizeof(unsigned int));
> -	memset(pipe->frame_params,
> -	       0, VIDEO_MAX_FRAME *
> -	       sizeof(struct atomisp_css_params_with_list *));
>  
>  	return 0;
>  }
> -- 
> 2.39.0
>
diff mbox series

Patch

diff --git a/drivers/staging/media/atomisp/pci/atomisp_subdev.c b/drivers/staging/media/atomisp/pci/atomisp_subdev.c
index c32db4ffb778..eb8f319fca5c 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_subdev.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_subdev.c
@@ -1054,11 +1054,6 @@  static int atomisp_init_subdev_pipe(struct atomisp_sub_device *asd,
 	INIT_LIST_HEAD(&pipe->activeq);
 	INIT_LIST_HEAD(&pipe->buffers_waiting_for_param);
 	INIT_LIST_HEAD(&pipe->per_frame_params);
-	memset(pipe->frame_request_config_id,
-	       0, VIDEO_MAX_FRAME * sizeof(unsigned int));
-	memset(pipe->frame_params,
-	       0, VIDEO_MAX_FRAME *
-	       sizeof(struct atomisp_css_params_with_list *));
 
 	return 0;
 }