Skip to content

Commit

Permalink
Merge branch 'rust' into file-open
Browse files Browse the repository at this point in the history
  • Loading branch information
wedsonaf authored Mar 30, 2021
2 parents 3bbd43f + 56df8a7 commit 5b9195a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -15550,6 +15550,7 @@ F: drivers/infiniband/ulp/rtrs/
RUST
M: Miguel Ojeda <[email protected]>
M: Alex Gaynor <[email protected]>
M: Wedson Almeida Filho <[email protected]>
L: [email protected]
S: Maintained
W: https://github.com/Rust-for-Linux/linux
Expand Down
4 changes: 2 additions & 2 deletions drivers/char/rust_example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ impl KernelModule for RustExample {
{
let mut guard = data.lock();
while *guard != 10 {
cv.wait(&mut guard);
let _ = cv.wait(&mut guard);
}
}
cv.notify_one();
Expand All @@ -227,7 +227,7 @@ impl KernelModule for RustExample {
{
let mut guard = data.lock();
while *guard != 10 {
cv.wait(&mut guard);
let _ = cv.wait(&mut guard);
}
}
cv.notify_one();
Expand Down
5 changes: 3 additions & 2 deletions rust/kernel/file_operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,9 @@ pub trait FileOpener<T: ?Sized>: FileOperations {
/// You implement this trait whenever you would create a `struct file_operations`.
///
/// File descriptors may be used from multiple threads/processes concurrently, so your type must be
/// [`Sync`].
pub trait FileOperations: Sync + Sized {
/// [`Sync`]. It must also be [`Send`] because [`FileOperations::release`] will be called from the
/// thread that decrements that associated file's refcount to zero.
pub trait FileOperations: Send + Sync + Sized {
/// The methods to use to populate [`struct file_operations`].
const TO_USE: ToUse;

Expand Down
1 change: 1 addition & 0 deletions rust/kernel/sync/condvar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ impl CondVar {
/// [`CondVar::notify_all`], or when the thread receives a signal.
///
/// Returns whether there is a signal pending.
#[must_use = "wait returns if a signal is pending, so the caller must check the return value"]
pub fn wait<L: Lock>(&self, guard: &mut Guard<L>) -> bool {
let lock = guard.lock;
let mut wait = MaybeUninit::<bindings::wait_queue_entry>::uninit();
Expand Down

0 comments on commit 5b9195a

Please sign in to comment.