Skip to content

Commit

Permalink
Make port fns const
Browse files Browse the repository at this point in the history
  • Loading branch information
ChocolateLoverRaj committed Feb 26, 2025
1 parent 94fe27e commit cb281d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/port.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pub struct PortAccessedRegister {
}

impl PortAccessedRegister {
unsafe fn new(port: u16) -> Self {
const unsafe fn new(port: u16) -> Self {
Self { port }
}
}
Expand All @@ -29,7 +29,7 @@ impl Uart16550Register for PortAccessedRegister {
/// This function is unsafe because the caller must ensure that the given base address
/// really points to a serial port device and that the caller has the necessary rights
/// to perform the I/O operation.
pub unsafe fn new(base: u16) -> Uart16550Registers<PortAccessedRegister> {
pub const unsafe fn new(base: u16) -> Uart16550Registers<PortAccessedRegister> {
Uart16550Registers {
data: PortAccessedRegister::new(base),
int_en: PortAccessedRegister::new(base + 1),
Expand Down

0 comments on commit cb281d3

Please sign in to comment.