From: Dan Carpenter <dan.carpenter@linaro.org>
To: Kieran Bingham <kieran.bingham@ideasonboard.com>
Cc: Umang Jain <umang.jain@ideasonboard.com>,
Florian Fainelli <florian.fainelli@broadcom.com>,
linux-rpi-kernel@lists.infradead.org,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@broadcom.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Stefan Wahren <wahrenst@gmx.net>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Dave Stevenson <dave.stevenson@raspberrypi.org>,
detule <ogjoneski@gmail.com>,
"moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE"
<linux-arm-kernel@lists.infradead.org>,
"open list:STAGING SUBSYSTEM" <linux-staging@lists.linux.dev>,
open list <linux-kernel@vger.kernel.org>,
Julia Lawall <Julia.Lawall@inria.fr>
Subject: Re: [PATCH] staging: vc04_services: vchiq_arm: Fix initialisation check
Date: Thu, 13 Jun 2024 22:58:40 +0300 [thread overview]
Message-ID: <a440cbf7-c6d5-4286-a69f-05e668522931@moroto.mountain> (raw)
In-Reply-To: <20240613194150.2915202-1-kieran.bingham@ideasonboard.com>
On Thu, Jun 13, 2024 at 08:41:45PM +0100, Kieran Bingham wrote:
> ---
> .../staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 4 ++--
> .../staging/vc04_services/interface/vchiq_arm/vchiq_core.h | 5 +++++
> .../staging/vc04_services/interface/vchiq_arm/vchiq_dev.c | 7 ++++++-
> 3 files changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> index 54467be8c371..67d853f5f2a0 100644
> --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
> @@ -804,7 +804,7 @@ int vchiq_initialise(struct vchiq_state *state, struct vchiq_instance **instance
> * block forever.
> */
> for (i = 0; i < VCHIQ_INIT_RETRIES; i++) {
> - if (state)
> + if (vchiq_remote_initialised(state))
> break;
> usleep_range(500, 600);
> }
:/ In the original code, this would either break on the first iteration
or fail. The diff looked like this:
for (i = 0; i < VCHIQ_INIT_RETRIES; i++) {
- state = vchiq_get_state();
if (state)
break;
I feel bad for not spotting this. A static checker which looked at
diffs could have made this work, but all of our tools look at a momement
in time instead of looking at the change over time.
regards,
dan carpenter
prev parent reply other threads:[~2024-06-13 19:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-13 19:41 [PATCH] staging: vc04_services: vchiq_arm: Fix initialisation check Kieran Bingham
2024-06-13 19:41 ` Kieran Bingham
2024-06-13 20:01 ` Stefan Wahren
[not found] ` <171836496531.2248009.11650291484570726735@ping.linuxembedded.co.uk>
2024-06-14 11:52 ` Stefan Wahren
2024-06-14 12:00 ` Kieran Bingham
2024-06-14 6:50 ` Greg Kroah-Hartman
2024-06-13 19:58 ` Dan Carpenter [this message]
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=a440cbf7-c6d5-4286-a69f-05e668522931@moroto.mountain \
--to=dan.carpenter@linaro.org \
--cc=Julia.Lawall@inria.fr \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=dave.stevenson@raspberrypi.org \
--cc=florian.fainelli@broadcom.com \
--cc=gregkh@linuxfoundation.org \
--cc=kieran.bingham@ideasonboard.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=linux-staging@lists.linux.dev \
--cc=ogjoneski@gmail.com \
--cc=umang.jain@ideasonboard.com \
--cc=wahrenst@gmx.net \
/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