Re: [PATCH V2 07/10] staging: vchiq_arm: Reduce indentation of service_callback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 12, 2024 at 12:23:47AM +0300, Laurent Pinchart wrote:
> On Tue, Jun 11, 2024 at 09:04:28AM +0300, Dan Carpenter wrote:
> > On Mon, Jun 10, 2024 at 11:02:17PM +0200, Stefan Wahren wrote:
> > > The service_callback has 5 levels of indentation, which makes it
> > > hard to read. Reduce this by splitting the code in a new function
> > > service_single_message() as suggested by Laurent Pinchart.
> > > 
> > > Signed-off-by: Stefan Wahren <wahrenst@xxxxxxx>
> > 
> > To be honest, I liked the version of this patch which Laurent didn't
> > like.  Even after pulling this code into a separate function, I'd still
> > support flipping the conditions around and adding the goto...
> > 
> > Laurent, you really didn't like the goto?
> 
> I won't nack it, but I really think gotos seriously hinder readability,
> with the exception of error paths.

Hm...  I guess I only hate backwards gotos (ones that go up instead of
down).  To me this one is kind of like a goto unlock.  It's slightly
more complicated than just an unlock because we add a completion as
well...  I don't have strong feelings about it, I was just interested.

regards,
dan carpenter





[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux