Thread (3 messages) flat view 3 messages, 3 authors, 2016-02-13

Re: [PATCH] af_unix: Don't set err in unix_stream_read_generic unless there was an error

From: Ben Hutchings <hidden>
Date: 2016-02-13 00:19:28
Also in: lkml, stable

Possibly related (same subject, not in this thread)

On Fri, 2016-02-05 at 22:30 +0000, Rainer Weikusat wrote:
The present unix_stream_read_generic contains various code sequences of
the form

err = -EDISASTER;
if ()
	goto out;
[...]

I wish people would stop writing code like this.  At one time it may
have been a useful micro-optimisation, avoiding an extra branch in the
successful case, but gcc now appears to do that itself.  So it makes
the code less clear and runs the risk of introducing this sort of bug,
for no obvious benefit.

Ben.

-- 
Ben Hutchings
Sturgeon's Law: Ninety percent of everything is crap.

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help