Skip to content

Commit 1cf4a18

Browse files
committed
Improved wording of my safety notes
1 parent 27f1341 commit 1cf4a18

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

src/proto/console/gop.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,10 @@ pub enum PixelFormat {
305305
/// This means you will have to use the `blt` function which will
306306
/// convert the graphics data to the device's internal pixel format.
307307
BltOnly,
308-
// NOTE: UEFI also defines a PixelFormatMax variant, and states that all
309-
// valid enum values are guaranteed to be smaller. Since that is the
310-
// case, adding a new enum variant would be a breaking change, so it
311-
// is safe to model this C enum as a Rust enum.
308+
// SAFETY: UEFI also defines a PixelFormatMax variant, and states that all
309+
// valid enum values are guaranteed to be smaller. Since that is the
310+
// case, adding a new enum variant would be a breaking change, so it
311+
// is safe to model this C enum as a Rust enum.
312312
}
313313

314314
/// Bitmask used to indicate which bits of a pixel represent a given color.

src/proto/console/serial.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,9 @@ pub enum Parity {
210210
Mark,
211211
/// Space parity
212212
Space,
213-
// NOTE: The serial protocol is very old, and new parity modes are very
214-
// unlikely to be added at this point in time. Therefore, modeling
215-
// this C enum as a Rust enum seems safe.
213+
// SAFETY: The serial protocol is very old, and new parity modes are very
214+
// unlikely to be added at this point in time. Therefore, modeling
215+
// this C enum as a Rust enum seems safe.
216216
}
217217

218218
/// Number of stop bits per character.
@@ -227,7 +227,7 @@ pub enum StopBits {
227227
OneFive,
228228
/// 2 stop bits
229229
Two,
230-
// NOTE: The serial protocol is very old, and new stop bit modes are very
231-
// unlikely to be added at this point in time. Therefore, modeling
232-
// this C enum as a Rust enum seems safe.
230+
// SAFETY: The serial protocol is very old, and new stop bit modes are very
231+
// unlikely to be added at this point in time. Therefore, modeling
232+
// this C enum as a Rust enum seems safe.
233233
}

src/table/boot.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -390,10 +390,10 @@ pub enum Tpl {
390390
///
391391
/// Even processor interrupts are disable at this level.
392392
HighLevel = 31,
393-
// NOTE: The UEFI specification repeatedly states that only the these
394-
// priority levels may be used, the rest being reserved for internal
395-
// firmware use. So only these priority levels should be exposed to
396-
// the application, and modeling them as a Rust enum seems safe.
393+
// SAFETY: The UEFI specification repeatedly states that only the these
394+
// priority levels may be used, the rest being reserved for internal
395+
// firmware use. So only these priority levels should be exposed to
396+
// the application, and modeling them as a Rust enum seems safe.
397397
}
398398

399399
/// Type of allocation to perform.
@@ -447,9 +447,9 @@ pub enum MemoryType {
447447
PalCode,
448448
/// Memory region which is usable and is also non-volatile.
449449
PersistentMemory,
450-
// NOTE: UEFI defines a MaxMemoryType, therefore adding new memory types
451-
// would be a breaking change, so exposing them as a Rust enum seems
452-
// to be safe.
450+
// SAFETY: UEFI defines a MaxMemoryType, therefore adding new memory types
451+
// would be a breaking change, and exposing them as a Rust enum
452+
// seems to be safe.
453453
}
454454

455455
/// A structure describing a region of memory.

src/table/runtime.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub enum ResetType {
4949
/// The additional data must be a pointer to
5050
/// a null-terminated string followed by an UUID.
5151
PlatformSpecific,
52-
// NOTE: This enum is never exposed to the user, but only fed as input to
53-
// the firmware. Therefore, unexpected values can never come from the
54-
// firmware, and modeling this as a Rust enum seems safe.
52+
// SAFETY: This enum is never exposed to the user, but only fed as input to
53+
// the firmware. Therefore, unexpected values can never come from
54+
// the firmware, and modeling this as a Rust enum seems safe.
5555
}

0 commit comments

Comments
 (0)