From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Brezillon Date: Fri, 07 Jun 2019 14:26:19 +0000 Subject: Re: [PATCH] media: rockchip/vpu: remove an unnecessary NULL check Message-Id: <20190607162619.06a3186d@collabora.com> List-Id: References: <20190607135609.GA16718@mwanda> In-Reply-To: <20190607135609.GA16718@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Dan Carpenter Cc: Mauro Carvalho Chehab , Heiko Stuebner , Hans Verkuil , Ezequiel Garcia , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, kernel-janitors@vger.kernel.org On Fri, 7 Jun 2019 16:56:09 +0300 Dan Carpenter wrote: > Thus the address of "&ctx->dev->variant->codec_ops[codec_mode]" > can't possibly be NULL. > > Signed-off-by: Dan Carpenter Reviewed-by: Boris Brezillon > --- > 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); > } > From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Brezillon Subject: Re: [PATCH] media: rockchip/vpu: remove an unnecessary NULL check Date: Fri, 7 Jun 2019 16:26:19 +0200 Message-ID: <20190607162619.06a3186d@collabora.com> References: <20190607135609.GA16718@mwanda> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20190607135609.GA16718@mwanda> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+glpar-linux-rockchip=m.gmane.org-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org To: Dan Carpenter Cc: Heiko Stuebner , kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Hans Verkuil , Mauro Carvalho Chehab , Ezequiel Garcia , linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-rockchip.vger.kernel.org On Fri, 7 Jun 2019 16:56:09 +0300 Dan Carpenter wrote: > Thus the address of "&ctx->dev->variant->codec_ops[codec_mode]" > can't possibly be NULL. > > Signed-off-by: Dan Carpenter Reviewed-by: Boris Brezillon > --- > 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); > } > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42DDBC2BCA1 for ; Fri, 7 Jun 2019 14:26:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 17B1820657 for ; Fri, 7 Jun 2019 14:26:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728919AbfFGO0Z (ORCPT ); Fri, 7 Jun 2019 10:26:25 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:38258 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728667AbfFGO0Y (ORCPT ); Fri, 7 Jun 2019 10:26:24 -0400 Received: from localhost (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 671CA2852B4; Fri, 7 Jun 2019 15:26:23 +0100 (BST) Date: Fri, 7 Jun 2019 16:26:19 +0200 From: Boris Brezillon To: Dan Carpenter Cc: Mauro Carvalho Chehab , Heiko Stuebner , Hans Verkuil , Ezequiel Garcia , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] media: rockchip/vpu: remove an unnecessary NULL check Message-ID: <20190607162619.06a3186d@collabora.com> In-Reply-To: <20190607135609.GA16718@mwanda> References: <20190607135609.GA16718@mwanda> Organization: Collabora X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org On Fri, 7 Jun 2019 16:56:09 +0300 Dan Carpenter wrote: > Thus the address of "&ctx->dev->variant->codec_ops[codec_mode]" > can't possibly be NULL. > > Signed-off-by: Dan Carpenter Reviewed-by: Boris Brezillon > --- > 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); > } >