diff mbox series

[RFC,v2,1/3] mm: add PG2KB/KB2PG helper macros

Message ID 20210919131248.489798-2-oleksandr@natalenko.name (mailing list archive)
State New
Headers show
Series mm: common PAGE_SIZE shift macros | expand

Commit Message

Oleksandr Natalenko Sept. 19, 2021, 1:12 p.m. UTC
Signed-off-by: Oleksandr Natalenko <oleksandr@natalenko.name>
---
 include/linux/mm.h | 3 +++
 1 file changed, 3 insertions(+)

Comments

Greg Kroah-Hartman Sept. 19, 2021, 1:21 p.m. UTC | #1
On Sun, Sep 19, 2021 at 03:12:46PM +0200, Oleksandr Natalenko wrote:
> Signed-off-by: Oleksandr Natalenko <oleksandr@natalenko.name>

I know I can not take patches without any changelog text.  Perhaps other
maintainers are more lax :(

thanks,

greg k-h
Matthew Wilcox Sept. 19, 2021, 2:21 p.m. UTC | #2
On Sun, Sep 19, 2021 at 03:12:46PM +0200, Oleksandr Natalenko wrote:
> +#define PG2KB(x)	((x) << (PAGE_SHIFT - 10))
> +#define KB2PG(x)	((x) >> (PAGE_SHIFT - 10))

This is not an improvement.
diff mbox series

Patch

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 00bb2d938df4..0a7e950ac8aa 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -98,6 +98,9 @@  extern int mmap_rnd_compat_bits __read_mostly;
 #include <asm/page.h>
 #include <asm/processor.h>
 
+#define PG2KB(x)	((x) << (PAGE_SHIFT - 10))
+#define KB2PG(x)	((x) >> (PAGE_SHIFT - 10))
+
 /*
  * Architectures that support memory tagging (assigning tags to memory regions,
  * embedding these tags into addresses that point to these memory regions, and