Skip to content

Commit

Permalink
style: fix a pile of "dumb but fair" clippy lints
Browse files Browse the repository at this point in the history
basically all of these are related to doc comments in various ways. to
which i generally say: "who cares?"
  • Loading branch information
hawkw committed Jan 17, 2024
1 parent 3534ed7 commit 788b80e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 21 deletions.
4 changes: 2 additions & 2 deletions platforms/allwinner-d1/d1-core/src/clint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ pub struct Clint {
}

impl Clint {
/// Create a new `Clint` from the [`CLINT`](d1_pac::CLINT) peripheral
/// Create a new `Clint` from the [`CLINT`] peripheral
#[must_use]
pub fn new(clint: CLINT) -> Self {
Self { clint }
}

/// Release the underlying [`CLINT`](d1_pac::CLINT) peripheral
/// Release the underlying [`CLINT`] peripheral
#[must_use]
pub fn release(self) -> CLINT {
self.clint
Expand Down
3 changes: 1 addition & 2 deletions platforms/allwinner-d1/d1-core/src/drivers/sharp_display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
//!
//! This is an early attempt at a "frame buffer" style display driver. It provides a
//! [emb_display service][kernel::services::emb_display] server, and uses the
//! d1-core specific [SpiSender][crate::drivers::spim::SpiSender] service as an SPI
//! "backend" for rendering.
//! d1-core specific [SpiSender] service as an SPI "backend" for rendering.
//!
//! This implementation is sort of a work in progress, it isn't really a *great*
//! long-term solution, but rather "okay for now".
Expand Down
2 changes: 1 addition & 1 deletion platforms/allwinner-d1/d1-core/src/plic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub struct Plic {
}

impl Plic {
/// Create a new `Plic` from the [`PLIC`](d1_pac::PLIC) peripheral
/// Create a new `Plic` from the [`PLIC`] peripheral
pub fn new(plic: PLIC) -> Self {
// TODO any initial setup we should be doing for the PLIC at startup?
Self { plic }
Expand Down
32 changes: 16 additions & 16 deletions source/abi/src/bbqueue_ipc/bbbuffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,32 +118,32 @@ impl BBBuffer {

buf_len: AtomicUsize::new(0),

/// Owned by the writer
// Owned by the writer
write: AtomicUsize::new(0),

/// Owned by the reader
// Owned by the reader
read: AtomicUsize::new(0),

/// Cooperatively owned
///
/// NOTE: This should generally be initialized as size_of::<self.buf>(), however
/// this would prevent the structure from being entirely zero-initialized,
/// and can cause the .data section to be much larger than necessary. By
/// forcing the `last` pointer to be zero initially, we place the structure
/// in an "inverted" condition, which will be resolved on the first commited
/// bytes that are written to the structure.
///
/// When read == last == write, no bytes will be allowed to be read (good), but
/// write grants can be given out (also good).
// Cooperatively owned
//
// NOTE: This should generally be initialized as size_of::<self.buf>(), however
// this would prevent the structure from being entirely zero-initialized,
// and can cause the .data section to be much larger than necessary. By
// forcing the `last` pointer to be zero initially, we place the structure
// in an "inverted" condition, which will be resolved on the first commited
// bytes that are written to the structure.
//
// When read == last == write, no bytes will be allowed to be read (good), but
// write grants can be given out (also good).
last: AtomicUsize::new(0),

/// Owned by the Writer, "private"
// Owned by the Writer, "private"
reserve: AtomicUsize::new(0),

/// Owned by the Reader, "private"
// Owned by the Reader, "private"
read_in_progress: AtomicBool::new(false),

/// Owned by the Writer, "private"
// Owned by the Writer, "private"
write_in_progress: AtomicBool::new(false),
}
}
Expand Down

0 comments on commit 788b80e

Please sign in to comment.