Re: [PATCH 3/4] soundwire: stream: Remove unnecessary gotos
From: Charles Keepax
Date: Fri Jun 02 2023 - 04:40:43 EST
On Thu, Jun 01, 2023 at 11:37:33AM -0500, Pierre-Louis Bossart wrote:
>
>
> On 6/1/23 11:16, Charles Keepax wrote:
> > There is a lot of code using gotos to skip small sections of code, this
> > is a fairly dubious use of a goto, especially when the level of
> > intentation is really low. Most of this code doesn't even breach 80
> > characters when naively shifted over.
> >
> > Simplify the code a bit, by replacing these unnecessary gotos with
> > simple ifs.
>
> it's probably ok but far from simple to review with the inverted states
> for variables. I don't have the time and energy to revisit this...
>
> I would err on the side of if it ain't broke don't fix it here.
>
The current code is pretty oddly written, as you say it does work
through. I will try splitting the patch into separate patches for
inverting the varible and dropping the goto's. That should make
review slightly easier and both changes make the code clearer in
their own right anyway.
Thanks,
Charles