[PATCH] staging: vc04_services: vchiq_arm: Fix initialisation check

Kieran Bingham kieran.bingham at ideasonboard.com
Fri Jun 14 05:00:19 PDT 2024


Quoting Stefan Wahren (2024-06-14 12:52:53)
> Hi Kieran,
> 
> Am 14.06.24 um 13:36 schrieb Kieran Bingham:
> > Hi Stefan,
> >
> > Sorry, indeed I completely missed this mail.
> >
> > Quoting Stefan Wahren (2024-06-13 21:01:42)
> >> Hi Kieran,
> >>
> >> Am 13.06.24 um 21:41 schrieb Kieran Bingham:
> >>> The vchiq_state used to be obtained through an accessor
> >>> which would validate that the VCHIQ had been initialised
> >>> correctly with the remote.
> >>>
> >>> In commit 42a2f6664e18 ("staging: vc04_services: Move global g_state to
> >>> vchiq_state") the global state was moved to the vchiq_mgnt structures
> >>> stored as a vchiq instance specific context. This conversion removed the
> >>> helpers and instead replaced users of this helper with the assumption
> >>> that the state is always available and the remote connected.
> >>>
> >>> Fix this broken assumption by re-introducing the logic that was lost
> >>> during the conversion.
> >> thank you for sending this patch. Maybe it's worth to mention that this
> >> patch also drop some unnecessary NULL checks of state.
> > I don't understand this comment. Nothing is dropped is it?
> >
> > The newly added vchiq_remote_initialised() is itself a null-check too!
> the vchiq_remote_initialised() only checks the member remote, but not
> state itself. From my point of view the null-check for state is
> unnecessary, because most of the code already assumed that state is not
> null like e.g. in vchiq_open().
> 

aha, I misread my own code ;-) Of course - I see it now.

I'll send v3.

--
Kieran



More information about the linux-arm-kernel mailing list