[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
<MW4PR12MB7165AB0B7208467C2F0B085DE6EB2@MW4PR12MB7165.namprd12.prod.outlook.com>
Date: Wed, 22 May 2024 17:31:36 +0000
From: "Klymenko, Anatoliy" <Anatoliy.Klymenko@....com>
To: Laurent Pinchart <laurent.pinchart@...asonboard.com>, Palmer Dabbelt
<palmer@...osinc.com>
CC: "tomi.valkeinen@...asonboard.com" <tomi.valkeinen@...asonboard.com>,
"maarten.lankhorst@...ux.intel.com" <maarten.lankhorst@...ux.intel.com>,
"mripard@...nel.org" <mripard@...nel.org>, "tzimmermann@...e.de"
<tzimmermann@...e.de>, "airlied@...il.com" <airlied@...il.com>,
"daniel@...ll.ch" <daniel@...ll.ch>, "Simek, Michal" <michal.simek@....com>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, kernel test robot <lkp@...el.com>
Subject: RE: [PATCH] drm: xlnx: zynqmp_disp: Fix WARN_ON build warning
Hi Laurent and Palmer,
> -----Original Message-----
> From: Laurent Pinchart <laurent.pinchart@...asonboard.com>
> Sent: Wednesday, May 22, 2024 7:44 AM
> To: Palmer Dabbelt <palmer@...osinc.com>
> Cc: tomi.valkeinen@...asonboard.com;
> maarten.lankhorst@...ux.intel.com; mripard@...nel.org;
> tzimmermann@...e.de; airlied@...il.com; daniel@...ll.ch; Simek,
> Michal <michal.simek@....com>; dri-devel@...ts.freedesktop.org;
> linux-arm-kernel@...ts.infradead.org; linux-kernel@...r.kernel.org;
> kernel test robot <lkp@...el.com>; Klymenko, Anatoliy
> <Anatoliy.Klymenko@....com>
> Subject: Re: [PATCH] drm: xlnx: zynqmp_disp: Fix WARN_ON build
> warning
>
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
>
>
> Hi Palmer,
>
> (CC'ing Anatoliy)
>
> Thank you for the patch.
>
> On Tue, May 21, 2024 at 07:28:15AM -0700, Palmer Dabbelt wrote:
> > From: Palmer Dabbelt <palmer@...osinc.com>
> >
> > Without this I get warnings along the lines of
> >
> > drivers/gpu/drm/xlnx/zynqmp_disp.c:949:14: error: logical not is
> only applied to the left hand side of this comparison [-Werror,-Wlogical-
> not-parentheses]
> > 949 | if (WARN_ON(!layer->mode ==
> ZYNQMP_DPSUB_LAYER_NONLIVE)) {
> > | ^ ~~
> > arch/s390/include/asm/bug.h:54:25: note: expanded from macro
> 'WARN_ON'
> > 54 | int __ret_warn_on = !!(x); \
> > | ^
> > drivers/gpu/drm/xlnx/zynqmp_disp.c:949:14: note: add parentheses
> after the '!' to evaluate the comparison first
> > drivers/gpu/drm/xlnx/zynqmp_disp.c:949:14: note: add parentheses
> around left hand side expression to silence this warning
> >
> > which get promoted to errors in my test builds. Adding the suggested
> > parens elides those warnings.
>
> I think this should have
>
> Fixes: b0f0469ab662 ("drm: xlnx: zynqmp_dpsub: Anounce supported
> input formats")
>
> > Reported-by: kernel test robot <lkp@...el.com>
> > Closes: https://lore.kernel.org/oe-kbuild-all/202405080553.tfH9EmS8-
> lkp@...el.com/
> > Signed-off-by: Palmer Dabbelt <palmer@...osinc.com>
> > ---
> > I couldn't find a patch for this in Linus' tree or on the lists, sorry
> > if someone's already fixed it. No rush on my end, I'll just stash this
> > in a local branch for the tester.
> > ---
> > drivers/gpu/drm/xlnx/zynqmp_disp.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.c
> b/drivers/gpu/drm/xlnx/zynqmp_disp.c
> > index 13157da0089e..d37b4a9c99ea 100644
> > --- a/drivers/gpu/drm/xlnx/zynqmp_disp.c
> > +++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c
> > @@ -981,7 +981,7 @@ u32 *zynqmp_disp_layer_drm_formats(struct
> zynqmp_disp_layer *layer,
> > unsigned int i;
> > u32 *formats;
> >
> > - if (WARN_ON(!layer->mode == ZYNQMP_DPSUB_LAYER_NONLIVE)) {
> > + if (WARN_ON((!layer->mode) == ZYNQMP_DPSUB_LAYER_NONLIVE))
> {
>
> That doesn't seem right. layer->mode isn't a boolean, it's an enum. The
> right fix seems to be
>
> if (WARN_ON(layer->mode != ZYNQMP_DPSUB_LAYER_NONLIVE)) {
>
Yes, this is how it should be.
> Anatoliy, could you check this ? Palmer, do you plan to submit a new
> version of the patch, or should I send the right fix separately ?
>
Actually, this has been fixed here:
https://cgit.freedesktop.org/drm/drm-misc/commit/?id=c72211751870ffa2cff5d91834059456cfa7cbd5.
Looks like the fix just missed the merge window.
> > *num_formats = 0;
> > return NULL;
> > }
>
> --
> Regards,
>
> Laurent Pinchart
--
Thank you,
Anatoliy
Powered by blists - more mailing lists