Re: [net-next v1 08/16] memory-provider: dmabuf devmem memory provider

From
Jason Gunthorpe <jgg@nvidia.com>
Date
2023-12-12 12:25:45
Also in
bpf, dri-devel, linux-arch, linux-doc, linux-kselftest, linux-media, lkml
Reply to
Mina Almasry, 2023-12-08
On Thu, Dec 07, 2023 at 04:52:39PM -0800, Mina Almasry wrote:
quoted hunk ↗ jump to hunk
+static inline struct page_pool_iov *page_to_page_pool_iov(struct page *page)
+{
+	if (page_is_page_pool_iov(page))
+		return (struct page_pool_iov *)((unsigned long)page & ~PP_IOV);
+
+	DEBUG_NET_WARN_ON_ONCE(true);
+	return NULL;
+}
We already asked not to do this, please do not allocate weird things
can call them 'struct page' when they are not. It undermines the
maintainability of the mm to have things mis-typed like
this. Introduce a new type for your thing so the compiler can check it
properly.

Jason
Thread (75 messages) 75 messages, 14 authors, last reply 2024-03-05
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help