diff --git a/include/common/buffer.h b/include/common/buffer.h index 18ced917b..2d657d1f9 100644 --- a/include/common/buffer.h +++ b/include/common/buffer.h @@ -228,29 +228,6 @@ static inline int buffer_contig_space(const struct buffer *buf) return right - left; } -/* Return the amount of bytes that can be written into the buffer at once, - * excluding the amount of reserved space passed in , which is - * preserved. - */ -static inline int buffer_contig_space_with_res(const struct buffer *buf, int res) -{ - /* Proceed differently if the buffer is full, partially used or empty. - * The hard situation is when it's partially used and either data or - * reserved space wraps at the end. - */ - int spare = buf->size - res; - - if (buffer_len(buf) >= spare) - spare = 0; - else if (buffer_len(buf)) { - spare = buffer_contig_space(buf) - res; - if (spare < 0) - spare = 0; - } - return spare; -} - - /* Normalizes a pointer which is supposed to be relative to the beginning of a * buffer, so that wrapping is correctly handled. The intent is to use this * when increasing a pointer. Note that the wrapping test is only performed diff --git a/include/proto/channel.h b/include/proto/channel.h index 36633c643..e323d340d 100644 --- a/include/proto/channel.h +++ b/include/proto/channel.h @@ -280,14 +280,6 @@ static inline int buffer_max_len(const struct channel *chn) return chn->buf->size - buffer_reserved(chn); } -/* Return the amount of bytes that can be written into the buffer at once, - * excluding reserved space, which is preserved. - */ -static inline int buffer_contig_space_res(const struct channel *chn) -{ - return buffer_contig_space_with_res(chn->buf, buffer_reserved(chn)); -} - /* Returns the amount of space available at the input of the buffer, taking the * reserved space into account if ->to_forward indicates that an end of transfer * is close to happen. The test is optimized to avoid as many operations as