File tree Expand file tree Collapse file tree 4 files changed +7
-4
lines changed Expand file tree Collapse file tree 4 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -15550,6 +15550,7 @@ F: drivers/infiniband/ulp/rtrs/
15550
15550
RUST
15551
15551
M: Miguel Ojeda <ojeda@kernel.org>
15552
15552
M: Alex Gaynor <alex.gaynor@gmail.com>
15553
+ M: Wedson Almeida Filho <wedsonaf@google.com>
15553
15554
L: rust-for-linux@vger.kernel.org
15554
15555
S: Maintained
15555
15556
W: https://github.com/Rust-for-Linux/linux
Original file line number Diff line number Diff line change @@ -205,7 +205,7 @@ impl KernelModule for RustExample {
205
205
{
206
206
let mut guard = data. lock ( ) ;
207
207
while * guard != 10 {
208
- cv. wait ( & mut guard) ;
208
+ let _ = cv. wait ( & mut guard) ;
209
209
}
210
210
}
211
211
cv. notify_one ( ) ;
@@ -227,7 +227,7 @@ impl KernelModule for RustExample {
227
227
{
228
228
let mut guard = data. lock ( ) ;
229
229
while * guard != 10 {
230
- cv. wait ( & mut guard) ;
230
+ let _ = cv. wait ( & mut guard) ;
231
231
}
232
232
}
233
233
cv. notify_one ( ) ;
Original file line number Diff line number Diff line change @@ -447,8 +447,9 @@ pub trait FileOpener<T: ?Sized>: FileOperations {
447
447
/// You implement this trait whenever you would create a `struct file_operations`.
448
448
///
449
449
/// 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 {
452
453
/// The methods to use to populate [`struct file_operations`].
453
454
const TO_USE : ToUse ;
454
455
Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ impl CondVar {
64
64
/// [`CondVar::notify_all`], or when the thread receives a signal.
65
65
///
66
66
/// 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" ]
67
68
pub fn wait < L : Lock > ( & self , guard : & mut Guard < L > ) -> bool {
68
69
let lock = guard. lock ;
69
70
let mut wait = MaybeUninit :: < bindings:: wait_queue_entry > :: uninit ( ) ;
You can’t perform that action at this time.
0 commit comments