summaryrefslogtreecommitdiff
path: root/osi
diff options
context:
space:
mode:
authorPavlin Radoslavov <pavlin@google.com>2016-02-04 18:20:06 -0800
committerAndre Eisenbach <eisenbach@google.com>2016-02-18 10:36:47 -0800
commitca57b25df827286c4996e17aefc251ecd79b33fc (patch)
tree835d11a0ce328caecfc28a4d1979d1d45a0b055a /osi
parent74c3783d729292ed6111688d02cf2af4fd2867e0 (diff)
downloadandroid-system-bt-ca57b25df827286c4996e17aefc251ecd79b33fc.tar.gz
android-system-bt-ca57b25df827286c4996e17aefc251ecd79b33fc.tar.xz
Removed function osi_get_buf_size()
Refactored code that uses function osi_get_buf_size(), and removed the need for that function. Bug: 24914560 Change-Id: I0d002635024a9703acb78f47735aafc957a2b761
Diffstat (limited to 'osi')
-rw-r--r--osi/include/allocator.h6
-rw-r--r--osi/src/allocator.c7
2 files changed, 1 insertions, 12 deletions
diff --git a/osi/include/allocator.h b/osi/include/allocator.h
index 97b700d..43909e0 100644
--- a/osi/include/allocator.h
+++ b/osi/include/allocator.h
@@ -48,8 +48,7 @@ void osi_free(void *ptr);
void osi_free_and_reset(void **p_ptr);
//
-// TODO: Function osi_get_buf_size() should be removed.
-// The rest of the functions below should be removed and replaced with the
+// TODO: The functions below should be removed and replaced with the
// corresponding functions above.
//
@@ -66,6 +65,3 @@ void osi_freebuf(void *ptr);
// |p_ptr| is a pointer to the buffer pointer to be reset.
// |p_ptr| cannot be NULL.
void osi_freebuf_and_reset(void **p_ptr);
-
-// Get the size of the buffer previously allocated with function |osi_getbuf|
-uint16_t osi_get_buf_size(void *ptr);
diff --git a/osi/src/allocator.c b/osi/src/allocator.c
index ed29f9c..662ae09 100644
--- a/osi/src/allocator.c
+++ b/osi/src/allocator.c
@@ -131,10 +131,3 @@ void osi_freebuf_and_reset(void **p_ptr)
osi_freebuf(*p_ptr);
*p_ptr = NULL;
}
-
-uint16_t osi_get_buf_size(void *p_buf)
-{
- BUFFER_HDR_T *header = (BUFFER_HDR_T *)p_buf - 1;
- assert(header->magic_number == MAGIC_NUMBER);
- return header->size;
-}