[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AM6PR04MB634128ED70894F35B629C69AE7759@AM6PR04MB6341.eurprd04.prod.outlook.com>
Date: Fri, 26 Aug 2022 07:47:47 +0000
From: Ming Qian <ming.qian@....com>
To: Tommaso Merciai <tommaso.merciai@...rulasolutions.com>
CC: "mchehab@...nel.org" <mchehab@...nel.org>,
"hverkuil-cisco@...all.nl" <hverkuil-cisco@...all.nl>,
"shawnguo@...nel.org" <shawnguo@...nel.org>,
"robh+dt@...nel.org" <robh+dt@...nel.org>,
"s.hauer@...gutronix.de" <s.hauer@...gutronix.de>,
"kernel@...gutronix.de" <kernel@...gutronix.de>,
"festevam@...il.com" <festevam@...il.com>,
dl-linux-imx <linux-imx@....com>,
"X.H. Bao" <xiahong.bao@....com>,
"linux-media@...r.kernel.org" <linux-media@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>
Subject: RE: [EXT] Re: [PATCH v5 2/4] media: amphion: tell and handle
contiguous and non contiguous format
[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.
Powered by blists - more mailing lists