Re: [PATCH 2/3] mm: add bytes_to_page_end() helper

From: Yury Norov

Date: Sun May 17 2026 - 11:28:20 EST


On Sun, May 17, 2026 at 02:34:30PM +0200, Thorsten Blum wrote:
> Add bytes_to_page_end() for the common PAGE_SIZE - offset_in_page()
> calculation.
>
> Suggested-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
> Signed-off-by: Thorsten Blum <thorsten.blum@xxxxxxxxx>
> ---
> include/linux/page_helpers.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/linux/page_helpers.h b/include/linux/page_helpers.h
> index 102a4f3c3868..981731faa1fc 100644
> --- a/include/linux/page_helpers.h
> +++ b/include/linux/page_helpers.h
> @@ -6,5 +6,6 @@
> #include <asm/page.h>
>
> #define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK)
> +#define bytes_to_page_end(p) (PAGE_SIZE - offset_in_page(p))
>
> #endif /* _LINUX_PAGE_HELPERS_H */

I've got a series for this

https://lore.kernel.org/all/20260303182845.250bb2de@xxxxxxxxxx/

The feedback is surprisingly negative. Please add people from that
thread. Maybe you'll be more successful convincing them.

Thanks,
Yury