Skip to content

Commit 5b9195a

Browse files
authored
Merge branch 'rust' into file-open
2 parents 3bbd43f + 56df8a7 commit 5b9195a

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15550,6 +15550,7 @@ F: drivers/infiniband/ulp/rtrs/
1555015550
RUST
1555115551
M: Miguel Ojeda <[email protected]>
1555215552
M: Alex Gaynor <[email protected]>
15553+
M: Wedson Almeida Filho <[email protected]>
1555315554
1555415555
S: Maintained
1555515556
W: https://github.com/Rust-for-Linux/linux

drivers/char/rust_example.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ impl KernelModule for RustExample {
205205
{
206206
let mut guard = data.lock();
207207
while *guard != 10 {
208-
cv.wait(&mut guard);
208+
let _ = cv.wait(&mut guard);
209209
}
210210
}
211211
cv.notify_one();
@@ -227,7 +227,7 @@ impl KernelModule for RustExample {
227227
{
228228
let mut guard = data.lock();
229229
while *guard != 10 {
230-
cv.wait(&mut guard);
230+
let _ = cv.wait(&mut guard);
231231
}
232232
}
233233
cv.notify_one();

rust/kernel/file_operations.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,8 +447,9 @@ pub trait FileOpener<T: ?Sized>: FileOperations {
447447
/// You implement this trait whenever you would create a `struct file_operations`.
448448
///
449449
/// File descriptors may be used from multiple threads/processes concurrently, so your type must be
450-
/// [`Sync`].
451-
pub trait FileOperations: Sync + Sized {
450+
/// [`Sync`]. It must also be [`Send`] because [`FileOperations::release`] will be called from the
451+
/// thread that decrements that associated file's refcount to zero.
452+
pub trait FileOperations: Send + Sync + Sized {
452453
/// The methods to use to populate [`struct file_operations`].
453454
const TO_USE: ToUse;
454455

rust/kernel/sync/condvar.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ impl CondVar {
6464
/// [`CondVar::notify_all`], or when the thread receives a signal.
6565
///
6666
/// Returns whether there is a signal pending.
67+
#[must_use = "wait returns if a signal is pending, so the caller must check the return value"]
6768
pub fn wait<L: Lock>(&self, guard: &mut Guard<L>) -> bool {
6869
let lock = guard.lock;
6970
let mut wait = MaybeUninit::<bindings::wait_queue_entry>::uninit();

0 commit comments

Comments
 (0)