@@ -55,13 +55,13 @@ impl<P: Plic> PLIC<P> {
5555
5656 /// Returns `true` if a machine external interrupt is pending.
5757 #[ inline]
58- pub fn is_interrupting ( & self ) -> bool {
58+ pub fn is_interrupting ( self ) -> bool {
5959 mip:: read ( ) . mext ( )
6060 }
6161
6262 /// Returns true if machine external interrupts are enabled.
6363 #[ inline]
64- pub fn is_enabled ( & self ) -> bool {
64+ pub fn is_enabled ( self ) -> bool {
6565 mie:: read ( ) . mext ( )
6666 }
6767
@@ -71,13 +71,13 @@ impl<P: Plic> PLIC<P> {
7171 ///
7272 /// Enabling the `PLIC` may break mask-based critical sections.
7373 #[ inline]
74- pub unsafe fn enable ( & self ) {
74+ pub unsafe fn enable ( self ) {
7575 mie:: set_mext ( ) ;
7676 }
7777
7878 /// Disables machine external interrupts to prevent the PLIC from triggering interrupts.
7979 #[ inline]
80- pub fn disable ( & self ) {
80+ pub fn disable ( self ) {
8181 // SAFETY: it is safe to disable interrupts
8282 unsafe { mie:: clear_mext ( ) } ;
8383 }
@@ -87,7 +87,7 @@ impl<P: Plic> PLIC<P> {
8787 /// This register allows to set the priority level of each interrupt source.
8888 /// The priority level of each interrupt source is shared among all the contexts.
8989 #[ inline]
90- pub const fn priorities ( & self ) -> priorities:: PRIORITIES {
90+ pub const fn priorities ( self ) -> priorities:: PRIORITIES {
9191 // SAFETY: valid address
9292 unsafe { priorities:: PRIORITIES :: new ( P :: BASE + Self :: PRIORITIES_OFFSET ) }
9393 }
@@ -96,14 +96,14 @@ impl<P: Plic> PLIC<P> {
9696 ///
9797 /// This register allows to check if a particular interrupt source is pending.
9898 #[ inline]
99- pub const fn pendings ( & self ) -> pendings:: PENDINGS {
99+ pub const fn pendings ( self ) -> pendings:: PENDINGS {
100100 // SAFETY: valid address
101101 unsafe { pendings:: PENDINGS :: new ( P :: BASE + Self :: PENDINGS_OFFSET ) }
102102 }
103103
104104 /// Returns a proxy to access to all the PLIC registers of a given HART context.
105105 #[ inline]
106- pub fn ctx < H : HartIdNumber > ( & self , hart_id : H ) -> CTX < P > {
106+ pub fn ctx < H : HartIdNumber > ( self , hart_id : H ) -> CTX < P > {
107107 // SAFETY: valid context number
108108 unsafe { CTX :: new ( hart_id. number ( ) as _ ) }
109109 }
@@ -115,7 +115,7 @@ impl<P: Plic> PLIC<P> {
115115 /// This function determines the current HART ID by reading the [`mhartid`] CSR.
116116 /// Thus, it can only be used in M-mode. For S-mode, use [`PLIC::ctx`] instead.
117117 #[ inline]
118- pub fn ctx_mhartid ( & self ) -> CTX < P > {
118+ pub fn ctx_mhartid ( self ) -> CTX < P > {
119119 let hart_id = mhartid:: read ( ) ;
120120 // SAFETY: `hart_id` is valid for the target and is the current hart
121121 unsafe { CTX :: new ( hart_id as _ ) }
0 commit comments