Message ID | 20190607135609.GA16718@mwanda (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | media: rockchip/vpu: remove an unnecessary NULL check | expand |
On Fri, 7 Jun 2019 16:56:09 +0300 Dan Carpenter <dan.carpenter@oracle.com> wrote: > Thus the address of "&ctx->dev->variant->codec_ops[codec_mode]" > can't possibly be NULL. > > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> > --- > 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); > } >
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); }
Thus the address of "&ctx->dev->variant->codec_ops[codec_mode]" can't possibly be NULL. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> --- drivers/staging/media/rockchip/vpu/rockchip_vpu_v4l2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)