Commit 2a0e6416 authored by Alice Ryhl's avatar Alice Ryhl
Browse files

FROMLIST: 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: default avatarBenno Lossin <lossin@kernel.org>
Signed-off-by: default avatarAlice Ryhl <aliceryhl@google.com>

Bug: 426545861
Link: https://lore.kernel.org/r/20250623-poll-table-null-v2-1-7561174bae7a@google.com


Change-Id: Idf965e16d699f29f7adc81710de02e4e2ec658c6
Signed-off-by: default avatarAlice Ryhl <aliceryhl@google.com>
parent 68f4f0b0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment