2019-06-12 18:03:33

by Colin King

[permalink] [raw]
Subject: [PATCH][next] staging: media: meson: remove redundant initialization of mpeg12

From: Colin Ian King <[email protected]>

The pointer mpeg12 is being initialized however that value is never
read and mpeg12 is being re-assigned almost immediately afterwards.
Remove the redundant initialization.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <[email protected]>
---
drivers/staging/media/meson/vdec/codec_mpeg12.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/meson/vdec/codec_mpeg12.c b/drivers/staging/media/meson/vdec/codec_mpeg12.c
index 5398fbf7ce20..48869cc3d973 100644
--- a/drivers/staging/media/meson/vdec/codec_mpeg12.c
+++ b/drivers/staging/media/meson/vdec/codec_mpeg12.c
@@ -63,7 +63,7 @@ static void codec_mpeg12_recycle(struct amvdec_core *core, u32 buf_idx)
static int codec_mpeg12_start(struct amvdec_session *sess)
{
struct amvdec_core *core = sess->core;
- struct codec_mpeg12 *mpeg12 = sess->priv;
+ struct codec_mpeg12 *mpeg12;
int ret;

mpeg12 = kzalloc(sizeof(*mpeg12), GFP_KERNEL);
--
2.20.1


2019-06-13 15:49:38

by Maxime Jourdan

[permalink] [raw]
Subject: Re: [PATCH][next] staging: media: meson: remove redundant initialization of mpeg12

Hi Colin,
On Wed, Jun 12, 2019 at 4:42 PM Colin King <[email protected]> wrote:
>
> From: Colin Ian King <[email protected]>
>
> The pointer mpeg12 is being initialized however that value is never
> read and mpeg12 is being re-assigned almost immediately afterwards.
> Remove the redundant initialization.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <[email protected]>
> ---
> drivers/staging/media/meson/vdec/codec_mpeg12.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/media/meson/vdec/codec_mpeg12.c b/drivers/staging/media/meson/vdec/codec_mpeg12.c
> index 5398fbf7ce20..48869cc3d973 100644
> --- a/drivers/staging/media/meson/vdec/codec_mpeg12.c
> +++ b/drivers/staging/media/meson/vdec/codec_mpeg12.c
> @@ -63,7 +63,7 @@ static void codec_mpeg12_recycle(struct amvdec_core *core, u32 buf_idx)
> static int codec_mpeg12_start(struct amvdec_session *sess)
> {
> struct amvdec_core *core = sess->core;
> - struct codec_mpeg12 *mpeg12 = sess->priv;
> + struct codec_mpeg12 *mpeg12;
> int ret;
>
> mpeg12 = kzalloc(sizeof(*mpeg12), GFP_KERNEL);
> --
> 2.20.1
>

Thank you for the patch.

Acked-by: Maxime Jourdan <[email protected]>