NetBSD-Bugs archive

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

Re: kern/44800: Misplaced parenthesis.



David Laight <david%l8s.co.uk@localhost> wrote:
>  On Wed, Mar 30, 2011 at 12:40:00PM +0000, 
> henning.petersen%t-online.de@localhost
> wrote:
>  > >Number:         44800
>  ...
>  > -  if ((error = vte_dma_alloc(sc) != 0))
>  > +  if ((error = vte_dma_alloc(sc)) != 0)
>  
>  I would fix all these by moving the assignment out of the if.
>  > +  error = vte_dma_alloc(sc);
>  > +  if (error != 0)
>  
>  The code is easier to read, and has shorter lines.

Yes, I prefer such style as well (it's not exactly KNF, though).

        error = vte_dma_alloc(sc);
        if (error) {
                ...
        }

-- 
Mindaugas


Home | Main Index | Thread Index | Old Index