aboutsummaryrefslogtreecommitdiffstats
path: root/rust/helpers/helpers.c
diff options
context:
space:
mode:
authorAlice Ryhl <[email protected]>2025-06-23 13:57:27 +0000
committerChristian Brauner <[email protected]>2025-07-14 12:12:24 +0000
commitde747bd023c09b5b7f3bf5c952d7b1da77a9caaa (patch)
tree821cb9111e8e85008ab87e8b551ffc0cafde1662 /rust/helpers/helpers.c
parentLinux 6.16-rc1 (diff)
downloadkernel-de747bd023c09b5b7f3bf5c952d7b1da77a9caaa.tar.gz
kernel-de747bd023c09b5b7f3bf5c952d7b1da77a9caaa.zip
poll: rust: allow poll_table ptrs to be null
It's possible for a poll_table to be null. This can happen if an end-user just wants to know if a resource has events right now without registering a waiter for when events become available. Furthermore, these null pointers should be handled transparently by the API, so we should not change `from_ptr` to return an `Option`. Thus, change `PollTable` to wrap a raw pointer rather than use a reference so that you can pass null. Comments mentioning `struct poll_table` are changed to just `poll_table` since `poll_table` is a typedef. (It's a typedef because it's supposed to be opaque.) Reviewed-by: Benno Lossin <[email protected]> Signed-off-by: Alice Ryhl <[email protected]>
Diffstat (limited to 'rust/helpers/helpers.c')
-rw-r--r--rust/helpers/helpers.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/rust/helpers/helpers.c b/rust/helpers/helpers.c
index 0f1b5d115985..ff65073fe3a5 100644
--- a/rust/helpers/helpers.c
+++ b/rust/helpers/helpers.c
@@ -30,6 +30,7 @@
#include "platform.c"
#include "pci.c"
#include "pid_namespace.c"
+#include "poll.c"
#include "rbtree.c"
#include "rcu.c"
#include "refcount.c"