Move the `!` inside the likely and negate it to unlikely.
The previous version should not have caused issues, because it is converted
to a boolean / integral value before being passed to __builtin_expect(), but
it's certainly unusual.
[wt: this was not a bug but purposely written like this to improve code
generation on older compilers but not needed anymore as described here:
https://www.mail-archive.com/haproxy@formilux.org/msg36392.html ]
struct conn_stream *cs;
cs = pool_alloc(pool_head_connstream);
- if (!likely(cs))
+ if (unlikely(!cs))
return NULL;
if (!conn) {
conn = conn_new();
- if (!likely(conn)) {
+ if (unlikely(!conn)) {
cs_free(cs);
return NULL;
}