diff mbox series

[2/3] lib: reuse page_ext_data() to obtain codetag_ref

Message ID 20240711220457.1751071-2-surenb@google.com (mailing list archive)
State New
Headers show
Series [1/3] lib: add missing newline character in the warning message | expand

Commit Message

Suren Baghdasaryan July 11, 2024, 10:04 p.m. UTC
codetag_ref_from_page_ext() reimplements the same calculation as
page_ext_data(). Reuse existing function instead.

Fixes: dcfe378c81f7 ("lib: introduce support for page allocation tagging")
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
---
 include/linux/pgalloc_tag.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/include/linux/pgalloc_tag.h b/include/linux/pgalloc_tag.h
index 9cacadbd61f8..acb1e9ce7981 100644
--- a/include/linux/pgalloc_tag.h
+++ b/include/linux/pgalloc_tag.h
@@ -15,7 +15,7 @@  extern struct page_ext_operations page_alloc_tagging_ops;
 
 static inline union codetag_ref *codetag_ref_from_page_ext(struct page_ext *page_ext)
 {
-	return (void *)page_ext + page_alloc_tagging_ops.offset;
+	return (union codetag_ref *)page_ext_data(page_ext, &page_alloc_tagging_ops);
 }
 
 static inline struct page_ext *page_ext_from_codetag_ref(union codetag_ref *ref)