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.
---
include/proto/connection.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/proto/connection.h b/include/proto/connection.h
index c7caeea2b..fb264d2b5 100644
--- a/include/proto/connection.h
+++ b/include/proto/connection.h
@@ -400,12 +400,12 @@ static inline struct conn_stream *cs_new(struct
connection *conn)
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;
}
--
2.25.1