Skip to content

Commit 8f89115

Browse files
author
Mike Snitzer
committed
dm vdo memory-alloc: rename vdo_do_allocation to __vdo_do_allocation
__vdo_do_allocation shouldn't be used outside of memory-alloc.h, so add hidden prefix. Also, tabify the vdo_allocate_extended macro. Signed-off-by: Mike Snitzer <[email protected]> Signed-off-by: Matthew Sakai <[email protected]>
1 parent 0eea6b6 commit 8f89115

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

drivers/md/dm-vdo/memory-alloc.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ int __must_check vdo_allocate_memory(size_t size, size_t align, const char *what
3737
*
3838
* Return: UDS_SUCCESS or an error code
3939
*/
40-
static inline int vdo_do_allocation(size_t count, size_t size, size_t extra,
41-
size_t align, const char *what, void *ptr)
40+
static inline int __vdo_do_allocation(size_t count, size_t size, size_t extra,
41+
size_t align, const char *what, void *ptr)
4242
{
4343
size_t total_size = count * size + extra;
4444

@@ -68,7 +68,7 @@ static inline int vdo_do_allocation(size_t count, size_t size, size_t extra,
6868
* Return: UDS_SUCCESS or an error code
6969
*/
7070
#define vdo_allocate(COUNT, TYPE, WHAT, PTR) \
71-
vdo_do_allocation(COUNT, sizeof(TYPE), 0, __alignof__(TYPE), WHAT, PTR)
71+
__vdo_do_allocation(COUNT, sizeof(TYPE), 0, __alignof__(TYPE), WHAT, PTR)
7272

7373
/*
7474
* Allocate one object of an indicated type, followed by one or more elements of a second type,
@@ -83,18 +83,18 @@ static inline int vdo_do_allocation(size_t count, size_t size, size_t extra,
8383
*
8484
* Return: UDS_SUCCESS or an error code
8585
*/
86-
#define vdo_allocate_extended(TYPE1, COUNT, TYPE2, WHAT, PTR) \
87-
__extension__({ \
88-
int _result; \
89-
TYPE1 **_ptr = (PTR); \
90-
BUILD_BUG_ON(__alignof__(TYPE1) < __alignof__(TYPE2)); \
91-
_result = vdo_do_allocation(COUNT, \
92-
sizeof(TYPE2), \
93-
sizeof(TYPE1), \
94-
__alignof__(TYPE1), \
95-
WHAT, \
96-
_ptr); \
97-
_result; \
86+
#define vdo_allocate_extended(TYPE1, COUNT, TYPE2, WHAT, PTR) \
87+
__extension__({ \
88+
int _result; \
89+
TYPE1 **_ptr = (PTR); \
90+
BUILD_BUG_ON(__alignof__(TYPE1) < __alignof__(TYPE2)); \
91+
_result = __vdo_do_allocation(COUNT, \
92+
sizeof(TYPE2), \
93+
sizeof(TYPE1), \
94+
__alignof__(TYPE1), \
95+
WHAT, \
96+
_ptr); \
97+
_result; \
9898
})
9999

100100
/*

0 commit comments

Comments
 (0)