From: Matthew Sakai <msakai@redhat.com>
To: dm-devel@lists.linux.dev
Cc: Mike Snitzer <snitzer@kernel.org>, Matthew Sakai <msakai@redhat.com>
Subject: [PATCH 2/2] dm vdo memory-alloc: rename vdo_do_allocation to __vdo_do_allocation
Date: Thu, 29 Feb 2024 23:32:38 -0500 [thread overview]
Message-ID: <2e2e4b079c241492d8b22cc9e75038c3dcf3305c.1709267399.git.msakai@redhat.com> (raw)
In-Reply-To: <cover.1709267399.git.msakai@redhat.com>
From: Mike Snitzer <snitzer@kernel.org>
__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 <snitzer@kernel.org>
Signed-off-by: Matthew Sakai <msakai@redhat.com>
---
drivers/md/dm-vdo/memory-alloc.h | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/drivers/md/dm-vdo/memory-alloc.h b/drivers/md/dm-vdo/memory-alloc.h
index 3f27dd722a2d..1401843db5e0 100644
--- a/drivers/md/dm-vdo/memory-alloc.h
+++ b/drivers/md/dm-vdo/memory-alloc.h
@@ -37,8 +37,8 @@ int __must_check vdo_allocate_memory(size_t size, size_t align, const char *what
*
* Return: UDS_SUCCESS or an error code
*/
-static inline int vdo_do_allocation(size_t count, size_t size, size_t extra,
- size_t align, const char *what, void *ptr)
+static inline int __vdo_do_allocation(size_t count, size_t size, size_t extra,
+ size_t align, const char *what, void *ptr)
{
size_t total_size = count * size + extra;
@@ -68,7 +68,7 @@ static inline int vdo_do_allocation(size_t count, size_t size, size_t extra,
* Return: UDS_SUCCESS or an error code
*/
#define vdo_allocate(COUNT, TYPE, WHAT, PTR) \
- vdo_do_allocation(COUNT, sizeof(TYPE), 0, __alignof__(TYPE), WHAT, PTR)
+ __vdo_do_allocation(COUNT, sizeof(TYPE), 0, __alignof__(TYPE), WHAT, PTR)
/*
* 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,
*
* Return: UDS_SUCCESS or an error code
*/
-#define vdo_allocate_extended(TYPE1, COUNT, TYPE2, WHAT, PTR) \
- __extension__({ \
- int _result; \
- TYPE1 **_ptr = (PTR); \
- BUILD_BUG_ON(__alignof__(TYPE1) < __alignof__(TYPE2)); \
- _result = vdo_do_allocation(COUNT, \
- sizeof(TYPE2), \
- sizeof(TYPE1), \
- __alignof__(TYPE1), \
- WHAT, \
- _ptr); \
- _result; \
+#define vdo_allocate_extended(TYPE1, COUNT, TYPE2, WHAT, PTR) \
+ __extension__({ \
+ int _result; \
+ TYPE1 **_ptr = (PTR); \
+ BUILD_BUG_ON(__alignof__(TYPE1) < __alignof__(TYPE2)); \
+ _result = __vdo_do_allocation(COUNT, \
+ sizeof(TYPE2), \
+ sizeof(TYPE1), \
+ __alignof__(TYPE1), \
+ WHAT, \
+ _ptr); \
+ _result; \
})
/*
--
2.42.0
prev parent reply other threads:[~2024-03-01 4:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-01 4:32 [PATCH 0/2] dm vdo memory-alloc: rename functions Matthew Sakai
2024-03-01 4:32 ` [PATCH 1/2] dm vdo memory-alloc: change from uds_ to vdo_ namespace Matthew Sakai
2024-03-01 4:32 ` Matthew Sakai [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2e2e4b079c241492d8b22cc9e75038c3dcf3305c.1709267399.git.msakai@redhat.com \
--to=msakai@redhat.com \
--cc=dm-devel@lists.linux.dev \
--cc=snitzer@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).