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=-6.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY 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 1AF5AC282DD for ; Wed, 8 Jan 2020 15:08:39 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EEE8A20692 for ; Wed, 8 Jan 2020 15:08:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EEE8A20692 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id D0F388763E; Wed, 8 Jan 2020 15:08:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VZtCFlo7TBXz; Wed, 8 Jan 2020 15:08:38 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 65EF187CC4; Wed, 8 Jan 2020 15:08:38 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 2C7DB1BF332 for ; Wed, 8 Jan 2020 15:08:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 2970687CB5 for ; Wed, 8 Jan 2020 15:08:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KFCz0S9un+l1 for ; Wed, 8 Jan 2020 15:08:35 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by hemlock.osuosl.org (Postfix) with ESMTPS id 8B5988763E for ; Wed, 8 Jan 2020 15:08:35 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: ezequiel) with ESMTPSA id DBC04292E56 Message-ID: <1118f946572b3da0562fa1c0347fceaeda93f38f.camel@collabora.com> Subject: Re: [PATCH] media: hantro: remove a pointless NULL check From: Ezequiel Garcia To: Dan Carpenter Date: Wed, 08 Jan 2020 12:08:21 -0300 In-Reply-To: <20200108053534.6rwxk2httwoflbgv@kili.mountain> References: <20200108053534.6rwxk2httwoflbgv@kili.mountain> Organization: Collabora User-Agent: Evolution 3.34.1-2 MIME-Version: 1.0 X-BeenThere: driverdev-devel@linuxdriverproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, Greg Kroah-Hartman , Mauro Carvalho Chehab , kernel-janitors@vger.kernel.org, linux-media@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" Hi Dan, Thanks for the patch. On Wed, 2020-01-08 at 08:35 +0300, Dan Carpenter wrote: > This can't be NULL and we've already dereferenced it so let's remove > the check. > > Signed-off-by: Dan Carpenter > --- > drivers/staging/media/hantro/hantro_v4l2.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/media/hantro/hantro_v4l2.c b/drivers/staging/media/hantro/hantro_v4l2.c > index 85af1b96fd34..0198bcda26b7 100644 > --- a/drivers/staging/media/hantro/hantro_v4l2.c > +++ b/drivers/staging/media/hantro/hantro_v4l2.c > @@ -688,7 +688,7 @@ static int hantro_start_streaming(struct vb2_queue *q, unsigned int count) > return ret; > > err_codec_exit: > - if (ctx->codec_ops && ctx->codec_ops->exit) > + if (ctx->codec_ops->exit) Since you are here, can you remove the other unneeded checks in the driver? We are assuming ctx->codec_op is non-NULL, so perhaps a check in .probe, to check it explicitly would be better. Thanks, Ezequiel _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel