diff --git a/include/common/buffer.h b/include/common/buffer.h index dde0fcc63..6f3ab26a1 100644 --- a/include/common/buffer.h +++ b/include/common/buffer.h @@ -61,14 +61,6 @@ void buffer_dump(FILE *o, struct buffer *b, int from, int to); /***** FIXME: OLD API BELOW *****/ -/* Normalizes a pointer after a subtract */ -static inline char *buffer_wrap_sub(const struct buffer *buf, char *ptr) -{ - if (ptr < buf->data) - ptr += buf->size; - return ptr; -} - /* Normalizes a pointer after an addition */ static inline char *buffer_wrap_add(const struct buffer *buf, char *ptr) { diff --git a/include/proto/channel.h b/include/proto/channel.h index 2cbbf9686..b84ccc9e8 100644 --- a/include/proto/channel.h +++ b/include/proto/channel.h @@ -823,7 +823,7 @@ static inline int co_getchr(struct channel *chn) return -2; return -1; } - return *buffer_wrap_sub(chn->buf, chn->buf->p - chn->buf->o); + return *co_head(chn); }