From ef26d4303ed776578e6522fb9fc4ff7817d40dc1 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Wed, 24 Feb 2016 11:28:54 +0100 Subject: lib: further cleanup of du_buff du_buff.c : removed unnecessary variable for return values removed unnecessary functions --- src/lib/du_buff.c | 35 ++--------------------------------- 1 file changed, 2 insertions(+), 33 deletions(-) (limited to 'src/lib') diff --git a/src/lib/du_buff.c b/src/lib/du_buff.c index eace2d02..e530fcb7 100644 --- a/src/lib/du_buff.c +++ b/src/lib/du_buff.c @@ -263,8 +263,6 @@ int du_buff_init(du_buff_t * dub, uint8_t * data, size_t len) { - int ret = -EINVAL; - if (dub == NULL || data == NULL) { LOG_DBG("Bogus input, bugging out."); return -EINVAL; @@ -278,37 +276,7 @@ int du_buff_init(du_buff_t * dub, dub->du_start = start; dub->du_end = start + len; - ret = buffer_copy_data(dub->buffer, start, data, len); - - return ret; -} - -uint8_t * du_buff_data_ptr_start(du_buff_t * dub) -{ - uint8_t * ret = NULL; - - if (dub == NULL) { - LOG_DBGF("Bogus input, bugging out."); - return NULL; - } - - ret = buffer_seek_pos(dub->buffer, dub->du_start); - - return ret; -} - -uint8_t * du_buff_data_ptr_end(du_buff_t * dub) -{ - uint8_t * ret = NULL; - - if (dub == NULL) { - LOG_DBG("Bogus input, bugging out."); - return NULL; - } - - ret = buffer_seek_pos(dub->buffer, dub->du_end); - - return ret; + return buffer_copy_data(dub->buffer, start, data, len); } int du_buff_head_alloc(du_buff_t * dub, size_t size) @@ -327,6 +295,7 @@ int du_buff_head_alloc(du_buff_t * dub, size_t size) return 0; } + int du_buff_tail_alloc(du_buff_t * dub, size_t size) { if (dub == NULL) { -- cgit v1.2.3