From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Kieran Bingham <kieran.bingham@ideasonboard.com>
Cc: Hans Verkuil <hverkuil-cisco@xs4all.nl>,
linux-media@vger.kernel.org, sakari.ailus@linux.intel.com
Subject: Re: [PATCH 4/6] vsp1: fix smatch warning
Date: Tue, 12 Feb 2019 18:31:22 +0200 [thread overview]
Message-ID: <20190212163122.GS6279@pendragon.ideasonboard.com> (raw)
In-Reply-To: <853728f6-e4b2-5324-47b2-9a5b99224ad0@ideasonboard.com>
On Tue, Feb 12, 2019 at 01:48:00PM +0000, Kieran Bingham wrote:
> On 07/02/2019 09:13, Hans Verkuil wrote:
> > drivers/media/platform/vsp1/vsp1_drm.c: drivers/media/platform/vsp1/vsp1_drm.c:336 vsp1_du_pipeline_setup_brx() error: we previously assumed 'pipe->brx' could be null (see line 244)
> >
> > smatch missed that if pipe->brx was NULL, then later on it will be
> > set with a non-NULL value. But it is easier to just use the brx pointer
> > so smatch doesn't get confused.
> >
>
> Aha, my initial reaction to this was "Oh - but we've already looked at
> this and it was a false positive ..." And then I looked at your patch ...
>
> So my initial reaction was completely wrong - and you have indeed got a
> good patch :)
>
> As this function is to 'setup the brx' I think it's very reasonable to
> use the chosen BRX pointer to do the configuration. (once all the
> dancing has gone on to swap as necessary)
>
> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
>
> And for sanity, I've tested this with our VSP Tests on both:
>
> Salvator-XS-H3 ES2.0 : 164 tests: 148 passed, 0 failed, 3 skipped
> and
> Salvator-XS-M3N : 164 tests: 148 passed, 0 failed, 3 skipped
>
>
> Tested-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
> Tested-on: Salvator-XS-ES2.0, Salvator-XS-M3N
Taken in my tree with all these tags and my
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
> > ---
> > drivers/media/platform/vsp1/vsp1_drm.c | 6 +++---
> > 1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/media/platform/vsp1/vsp1_drm.c b/drivers/media/platform/vsp1/vsp1_drm.c
> > index 8d86f618ec77..84895385d2e5 100644
> > --- a/drivers/media/platform/vsp1/vsp1_drm.c
> > +++ b/drivers/media/platform/vsp1/vsp1_drm.c
> > @@ -333,19 +333,19 @@ static int vsp1_du_pipeline_setup_brx(struct vsp1_device *vsp1,
> > * on the BRx sink pad 0 and propagated inside the entity, not on the
> > * source pad.
> > */
> > - format.pad = pipe->brx->source_pad;
> > + format.pad = brx->source_pad;
> > format.format.width = drm_pipe->width;
> > format.format.height = drm_pipe->height;
> > format.format.field = V4L2_FIELD_NONE;
> >
> > - ret = v4l2_subdev_call(&pipe->brx->subdev, pad, set_fmt, NULL,
> > + ret = v4l2_subdev_call(&brx->subdev, pad, set_fmt, NULL,
> > &format);
> > if (ret < 0)
> > return ret;
> >
> > dev_dbg(vsp1->dev, "%s: set format %ux%u (%x) on %s pad %u\n",
> > __func__, format.format.width, format.format.height,
> > - format.format.code, BRX_NAME(pipe->brx), pipe->brx->source_pad);
> > + format.format.code, BRX_NAME(brx), brx->source_pad);
> >
> > if (format.format.width != drm_pipe->width ||
> > format.format.height != drm_pipe->height) {
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2019-02-12 16:31 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-07 9:13 [PATCH 0/6] sparse/smatch fixes Hans Verkuil
2019-02-07 9:13 ` [PATCH 1/6] hdpvr: fix smatch warning Hans Verkuil
2019-02-07 9:13 ` [PATCH 2/6] vim2m: " Hans Verkuil
2019-02-07 9:13 ` [PATCH 3/6] uvc: " Hans Verkuil
2019-02-07 14:57 ` Kieran Bingham
2019-02-07 15:41 ` Laurent Pinchart
2019-02-07 16:35 ` Hans Verkuil
2019-02-07 9:13 ` [PATCH 4/6] vsp1: " Hans Verkuil
2019-02-12 13:48 ` Kieran Bingham
2019-02-12 16:31 ` Laurent Pinchart [this message]
2019-02-07 9:13 ` [PATCH 5/6] omap3isp: fix sparse warning Hans Verkuil
2019-02-07 9:18 ` Hans Verkuil
2019-02-07 14:23 ` Sakari Ailus
2019-02-07 15:45 ` Laurent Pinchart
2019-02-07 9:13 ` [PATCH 6/6] pxa_camera: fix smatch warning Hans Verkuil
2019-02-07 14:11 ` Sakari Ailus
2019-02-07 14:38 ` [PATCH 7/6] omap4iss: fix sparse warning Hans Verkuil
2019-02-07 14:51 ` Sakari Ailus
2019-02-07 15:47 ` Laurent Pinchart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190212163122.GS6279@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=hverkuil-cisco@xs4all.nl \
--cc=kieran.bingham@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=sakari.ailus@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).