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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C29C9ECAAA3 for ; Fri, 26 Aug 2022 08:35:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=yuIiR142iPKDhbGvKvPB1Z1wwtbo0Q2aisqNiHUs3Lg=; b=CqRd7UnBWIl6nx 1ulFBivo1yDDQufnkl+ACxjEIPVbRnJ2cOmkTuA9sOwOA7Cyfzy5lKSM6U/8US5EsOimEVjbXN2Wd lw8TeUxdgjZ6itlTc1OIpx9IvoKAMK79o7nlrPQMQLg61Qu3Y/IzkvDe6OjdALZ59ei34l4aT2Jbw Mv7YkUO9uur08GIjO0COvCP4P89yxhscmv7xBQVJTWByl/b9snqwgjOHSUM8faQHaDejaxWY85GfB xg5xctcyBdGzJ9AvHNXo3IFdAdiXNeb4FOlCvdep+RObG5TSHyp7gJ+vDPMNHFEuOKs7MqlO2h030 NIsN0QnbXa8QiG8Htnhw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oRUnC-00H8fG-BN; Fri, 26 Aug 2022 08:34:18 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oRUn9-00H8Uv-Mp for linux-arm-kernel@lists.infradead.org; Fri, 26 Aug 2022 08:34:17 +0000 Received: by mail-wm1-x334.google.com with SMTP id d5so478769wms.5 for ; Fri, 26 Aug 2022 01:34:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc; bh=qQYhF9Tm4lqCbd2L4pV2F+K+GFROrI4ntq7bX+5OTak=; b=Ol1GmYh7Vrd7PozWRW05PvKd2zYLkHfHcZZI+LjPyHk66q4uTrqkGfLsU8mlYRPJ+b SFG6yqUMTW8A0CYFqMZT4LIYU8SMxQxeifiq/Ko2r/DZ1h36PwzktVkWIMmX3C5R/Fa8 4i+Bg3dHWS9MAAqlJ6a+a0mX4Xb1oD0vY50IA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc; bh=qQYhF9Tm4lqCbd2L4pV2F+K+GFROrI4ntq7bX+5OTak=; b=NSIlhR07M/crtQfLIiZoi+sU3IlDYTE4KJ4z/+U4XD/F2FsLt1eqJ9AbjB6RFkMzvY 77LjHNX5iGHvJicr1MCh88dn+BRS75B1qgyxcIt81kmpgSur3tmhxFp6BZVIXO/TBUtR l83vqSfZcH8PS1SFz8+M0U+rDPtqwb1VxXHOG8Yj6z8nGnXmQhClAB2MxTs9E9qSsyTb u7agGE3SqEwxAgdlRh7w64zapJyXzjO2rekXwrfUDPqVNsq4BOukJ3WJrHb8eKc0M3ru fB8GTRemfv+VkYh5+PC5NeNBTIW9UPqC3ruFv9UVFLngPxMeSnqmxFaFOxim+t0R0yyg h7Ag== X-Gm-Message-State: ACgBeo3MH3DXm8lGapjICOF6Eozvbse72lMgAodUns4CuDB3bDMaxswo jvbbyhks0ZfaBZ3v/3COgT/O9Q== X-Google-Smtp-Source: AA6agR4dmpmWH/4wWhB3Ip/1u/6xX+Ad0VGHS09lrBQgi5HKAdDipFcpTBkO5crU4fj7ZBBiycr1MA== X-Received: by 2002:a05:600c:a0a:b0:3a6:71e5:fb70 with SMTP id z10-20020a05600c0a0a00b003a671e5fb70mr4460241wmp.141.1661502851310; Fri, 26 Aug 2022 01:34:11 -0700 (PDT) Received: from tom-ThinkPad-T14s-Gen-2i (net-188-217-49-118.cust.vodafonedsl.it. [188.217.49.118]) by smtp.gmail.com with ESMTPSA id a17-20020adffb91000000b002252e5a6841sm1294323wrr.57.2022.08.26.01.34.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Aug 2022 01:34:11 -0700 (PDT) Date: Fri, 26 Aug 2022 10:34:08 +0200 From: Tommaso Merciai To: Ming Qian Cc: "mchehab@kernel.org" , "hverkuil-cisco@xs4all.nl" , "shawnguo@kernel.org" , "robh+dt@kernel.org" , "s.hauer@pengutronix.de" , "kernel@pengutronix.de" , "festevam@gmail.com" , dl-linux-imx , "X.H. Bao" , "linux-media@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [EXT] Re: [PATCH v5 2/4] media: amphion: tell and handle contiguous and non contiguous format Message-ID: <20220826083408.GC3151@tom-ThinkPad-T14s-Gen-2i> References: <7e6a945b898254679bd93e7e001e7c24b5aea0ef.1661390673.git.ming.qian@nxp.com> <20220826072047.GA3151@tom-ThinkPad-T14s-Gen-2i> <20220826082717.GB3151@tom-ThinkPad-T14s-Gen-2i> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220826082717.GB3151@tom-ThinkPad-T14s-Gen-2i> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220826_013415_756870_8C5E3E32 X-CRM114-Status: GOOD ( 26.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Aug 26, 2022 at 10:27:17AM +0200, Tommaso Merciai wrote: > Hi Ming, > > On Fri, Aug 26, 2022 at 07:47:47AM +0000, Ming Qian wrote: > > [snip] > > > > >> diff --git a/drivers/media/platform/amphion/vpu_helpers.c > > >> b/drivers/media/platform/amphion/vpu_helpers.c > > >> index e9aeb3453dfc..019c77e84514 100644 > > >> --- a/drivers/media/platform/amphion/vpu_helpers.c > > >> +++ b/drivers/media/platform/amphion/vpu_helpers.c > > >> @@ -59,6 +59,36 @@ const struct vpu_format > > >*vpu_helper_find_format(struct vpu_inst *inst, u32 type, > > >> return NULL; > > >> } > > >> > > >> +const struct vpu_format *vpu_helper_find_sibling(struct vpu_inst > > >> +*inst, u32 type, u32 pixelfmt) { > > >> + const struct vpu_format *fmt; > > >> + const struct vpu_format *sibling; > > >> + > > >> + fmt = vpu_helper_find_format(inst, type, pixelfmt); > > >> + if (!fmt || !fmt->sibling) > > >> + return NULL; > > >> + > > >> + sibling = vpu_helper_find_format(inst, type, fmt->sibling); > > >> + if (!sibling || sibling->sibling != fmt->pixfmt || > > >> + sibling->comp_planes != fmt->comp_planes) > > >> + return NULL; > > > > > >I think to preserve code style you need the following solutions on this if > > >statement: > > > > > >if (!sibling || (sibling->sibling != fmt->pixfmt) || > > > (sibling->comp_planes != fmt->comp_planes)) > > > return NULL; > > > > > >I think I have suggested to you this solution on the v4. But never mind we > > >need this :) > > > > > >Thanks > > > > > > > Hi Tommaso, > > The parentheses are unnecessary, the checkpatch.pl will report the following style problems if I add the parentheses: > > > > CHECK: Unnecessary parentheses around 'sibling->sibling != fmt->pixfmt' > > #11: FILE: drivers/media/platform/amphion/vpu_helpers.c:72: > > + if (!sibling || (sibling->sibling != fmt->pixfmt) || > > + (sibling->comp_planes != fmt->comp_planes)) > > > > CHECK: Unnecessary parentheses around 'sibling->comp_planes != fmt->comp_planes' > > #11: FILE: drivers/media/platform/amphion/vpu_helpers.c:72: > > + if (!sibling || (sibling->sibling != fmt->pixfmt) || > > + (sibling->comp_planes != fmt->comp_planes)) > > > > total: 0 errors, 0 warnings, 2 checks, 10 lines checked > > > > NOTE: For some of the reported defects, checkpatch may be able to > > mechanically convert to the typical style using --fix or --fix-inplace. > > > > 1.patch has style problems, please review. > > > > NOTE: If any of the errors are false positives, please report > > them to the maintainer, see CHECKPATCH in MAINTAINERS. > > Sorry, my bad. I don't check this using checkpatch.pl, but checking the > others driver code, you are right. Thanks for clarify this. > > Then, Looks good to me. > > Regards, > Tommaso Forgot the tag: Reviewed-by: Tommaso Merciai > > -- > Tommaso Merciai > Embedded Linux Engineer > tommaso.merciai@amarulasolutions.com > __________________________________ > > Amarula Solutions SRL > Via Le Canevare 30, 31100 Treviso, Veneto, IT > T. +39 042 243 5310 > info@amarulasolutions.com > www.amarulasolutions.com -- Tommaso Merciai Embedded Linux Engineer tommaso.merciai@amarulasolutions.com __________________________________ Amarula Solutions SRL Via Le Canevare 30, 31100 Treviso, Veneto, IT T. +39 042 243 5310 info@amarulasolutions.com www.amarulasolutions.com _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel