[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6D1CB2F5E7@AcuExch.aculab.com>
Date: Thu, 7 May 2015 13:49:27 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Willem de Bruijn' <willemb@...gle.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
CC: "davem@...emloft.net" <davem@...emloft.net>
Subject: RE: [PATCH net-next 3/7] packet: rollover prepare: single return in
packet_rcv_has_room
From: Willem de Bruijn
> Sent: 06 May 2015 19:27
> Convert
>
> if (x) {
> A;
> return y;
> }
> B;
> return y;
>
> Into
>
> if (x) {
> A;
> } else {
> B;
> }
>
> return y;
>
> No other changes.
...
IMHO there is little benefit in the 'single return from function' style.
In general it just makes scan-reading of code more difficult (once you
see a 'return' you know then is no more relevant code) and hits the RH margin.
David
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists