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=-8.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 3AFA8C76195 for ; Thu, 18 Jul 2019 07:48:15 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 074A2205C9 for ; Thu, 18 Jul 2019 07:48:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qe7ZoT8V" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 074A2205C9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jmNckf/fcEhzSYqlQBB3jiJMvrLaccTYh4SQ8s5zb1I=; b=qe7ZoT8VJ8BVr+ 7mRJMzEJ0Nx61B3Vqo/7Qkwmaq1849KenWd1NcmRVcQjCyLI+ArGMzSQACa83OmWOGbSQ+kNjfZfU s4IjsPG0/8HZ6BoAYPFyfgbzGNmJ/bsYoUlOu8w9dxC4v/IsJwqNfLn7XkspQU4zRo1vJgwqdvG7F /jXkP7L9761tuVNQdFZMrSDY1621SVbXTJXaZ2DvqvdE6CwaIyZaON+5BhxTMuLDp3iDbXLtEcSdW dX53aSDtPXE2TeUApYAqK1cN5VUotjgtDSPc5AY2zEvF/i1eLVIrwLPSsxwDvAe+svlfaRDYa8itR r760WqhzFTpx6+cSlBCQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1ho19C-0003PO-EZ; Thu, 18 Jul 2019 07:48:14 +0000 Received: from relay7-d.mail.gandi.net ([217.70.183.200]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1ho198-0003OH-H3 for linux-arm-kernel@lists.infradead.org; Thu, 18 Jul 2019 07:48:12 +0000 X-Originating-IP: 86.250.200.211 Received: from aptenodytes (lfbn-1-17395-211.w86-250.abo.wanadoo.fr [86.250.200.211]) (Authenticated sender: paul.kocialkowski@bootlin.com) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id E97D820007; Thu, 18 Jul 2019 07:47:58 +0000 (UTC) Date: Thu, 18 Jul 2019 09:47:58 +0200 From: Paul Kocialkowski To: Nishka Dasgupta Subject: Re: [PATCH] staging: media: sunxi: Add bool cast to value Message-ID: <20190718074758.GD26951@aptenodytes> References: <20190717142315.3119-1-nishkadg.linux@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190717142315.3119-1-nishkadg.linux@gmail.com> User-Agent: Mutt/1.12.1 (2019-06-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190718_004810_725634_C3128BA6 X-CRM114-Status: GOOD ( 13.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, maxime.ripard@bootlin.com, gregkh@linuxfoundation.org, wens@csie.org, mchehab@kernel.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, On Wed 17 Jul 19, 19:53, Nishka Dasgupta wrote: > Typecast as bool the return value of cedrus_find_format in > cedrus_check_format as the return value of cedrus_check_format is always > treated like a boolean value. Thanks for the patch! Could we also add !! to the returned pointer so that we are sure that the function returns either false or true, but never a non-zero value that is not true? Cheers, Paul > Signed-off-by: Nishka Dasgupta > --- > drivers/staging/media/sunxi/cedrus/cedrus_video.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_video.c b/drivers/staging/media/sunxi/cedrus/cedrus_video.c > index e2b530b1a956..f00a048a0a01 100644 > --- a/drivers/staging/media/sunxi/cedrus/cedrus_video.c > +++ b/drivers/staging/media/sunxi/cedrus/cedrus_video.c > @@ -86,7 +86,7 @@ static struct cedrus_format *cedrus_find_format(u32 pixelformat, u32 directions, > static bool cedrus_check_format(u32 pixelformat, u32 directions, > unsigned int capabilities) > { > - return cedrus_find_format(pixelformat, directions, capabilities); > + return (bool)cedrus_find_format(pixelformat, directions, capabilities); > } > > static void cedrus_prepare_format(struct v4l2_pix_format *pix_fmt) > -- > 2.19.1 > -- Paul Kocialkowski, Bootlin Embedded Linux and kernel engineering https://bootlin.com _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel