* [PATCH] media: rockchip/vpu: remove an unnecessary NULL check
@ 2019-06-07 13:56 Dan Carpenter
2019-06-07 14:26 ` Boris Brezillon
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2019-06-07 13:56 UTC (permalink / raw)
To: Mauro Carvalho Chehab, Boris Brezillon
Cc: Heiko Stuebner, kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Hans Verkuil,
Ezequiel Garcia, linux-media-u79uwXL29TY76Z2rM5mHXA
Thus the address of "&ctx->dev->variant->codec_ops[codec_mode]"
can't possibly be NULL.
Signed-off-by: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
---
drivers/staging/media/rockchip/vpu/rockchip_vpu_v4l2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/media/rockchip/vpu/rockchip_vpu_v4l2.c b/drivers/staging/media/rockchip/vpu/rockchip_vpu_v4l2.c
index 1b80a45df8fe..42f4eb0abc8a 100644
--- a/drivers/staging/media/rockchip/vpu/rockchip_vpu_v4l2.c
+++ b/drivers/staging/media/rockchip/vpu/rockchip_vpu_v4l2.c
@@ -619,7 +619,7 @@ static int rockchip_vpu_start_streaming(struct vb2_queue *q,
vpu_debug(4, "Codec mode = %d\n", codec_mode);
ctx->codec_ops = &ctx->dev->variant->codec_ops[codec_mode];
- if (ctx->codec_ops && ctx->codec_ops->init)
+ if (ctx->codec_ops->init)
ret = ctx->codec_ops->init(ctx);
}
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] media: rockchip/vpu: remove an unnecessary NULL check
2019-06-07 13:56 [PATCH] media: rockchip/vpu: remove an unnecessary NULL check Dan Carpenter
@ 2019-06-07 14:26 ` Boris Brezillon
0 siblings, 0 replies; 2+ messages in thread
From: Boris Brezillon @ 2019-06-07 14:26 UTC (permalink / raw)
To: Dan Carpenter
Cc: Heiko Stuebner, kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Hans Verkuil,
Mauro Carvalho Chehab, Ezequiel Garcia,
linux-media-u79uwXL29TY76Z2rM5mHXA
On Fri, 7 Jun 2019 16:56:09 +0300
Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> wrote:
> Thus the address of "&ctx->dev->variant->codec_ops[codec_mode]"
> can't possibly be NULL.
>
> Signed-off-by: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Reviewed-by: Boris Brezillon <boris.brezillon-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
> ---
> drivers/staging/media/rockchip/vpu/rockchip_vpu_v4l2.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/media/rockchip/vpu/rockchip_vpu_v4l2.c b/drivers/staging/media/rockchip/vpu/rockchip_vpu_v4l2.c
> index 1b80a45df8fe..42f4eb0abc8a 100644
> --- a/drivers/staging/media/rockchip/vpu/rockchip_vpu_v4l2.c
> +++ b/drivers/staging/media/rockchip/vpu/rockchip_vpu_v4l2.c
> @@ -619,7 +619,7 @@ static int rockchip_vpu_start_streaming(struct vb2_queue *q,
>
> vpu_debug(4, "Codec mode = %d\n", codec_mode);
> ctx->codec_ops = &ctx->dev->variant->codec_ops[codec_mode];
> - if (ctx->codec_ops && ctx->codec_ops->init)
> + if (ctx->codec_ops->init)
> ret = ctx->codec_ops->init(ctx);
> }
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-06-07 14:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-07 13:56 [PATCH] media: rockchip/vpu: remove an unnecessary NULL check Dan Carpenter
2019-06-07 14:26 ` Boris Brezillon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).