]> www.infradead.org Git - users/jedix/linux-maple.git/commit
netmem: use _Generic to cover const casting for page_to_netmem()
authorByungchul Park <byungchul@sk.com>
Wed, 2 Jul 2025 05:32:55 +0000 (14:32 +0900)
committerJakub Kicinski <kuba@kernel.org>
Tue, 8 Jul 2025 01:40:10 +0000 (18:40 -0700)
commit4369d40da2f28ae1d3caadd4eb5d7b7f49a3776f
treef0609367a09735739522c10ef2a349684ee97140
parentb56ce86846225d6bc96ca9428ad945b4d86b96d5
netmem: use _Generic to cover const casting for page_to_netmem()

The current page_to_netmem() doesn't cover const casting resulting in
trying to cast const struct page * to const netmem_ref fails.

To cover the case, change page_to_netmem() to use macro and _Generic.

Signed-off-by: Byungchul Park <byungchul@sk.com>
Reviewed-by: Mina Almasry <almasrymina@google.com>
Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com>
Reviewed-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://patch.msgid.link/20250702053256.4594-5-byungchul@sk.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/netmem.h