@@ -174,7 +174,7 @@ impl Descriptor {
174174 ///
175175 /// # Invariant
176176 ///
177- /// The caller must ensure that `base ` is valid for writes of Descriptor
177+ /// The caller must ensure that `addr ` is valid for writes of Descriptor
178178 pub fn write_release < M : MemOps > ( & self , mem : & M , addr : u64 ) -> Result < ( ) , M :: Error > {
179179 mem. write_val ( addr + Self :: ADDR_OFFSET as u64 , self . addr ) ?;
180180 mem. write_val ( addr + Self :: LEN_OFFSET as u64 , self . len ) ?;
@@ -189,7 +189,7 @@ impl Descriptor {
189189#[ derive( Debug , Clone , Copy ) ]
190190pub struct DescTable {
191191 base_addr : u64 ,
192- size : usize ,
192+ len : usize ,
193193}
194194
195195impl DescTable {
@@ -199,20 +199,20 @@ impl DescTable {
199199 ///
200200 /// # Safety
201201 ///
202- /// - `base ` must be valid for reads and writes of `size ` descriptors
203- /// - `base ` must be properly aligned for `Descriptor`
204- /// - `size ` must not exceed `u16::MAX`
202+ /// - `base_addr ` must be valid for reads and writes of `len ` descriptors
203+ /// - `base_addr ` must be properly aligned for `Descriptor`
204+ /// - `len ` must not exceed `u16::MAX`
205205 /// - memory must remain valid for the lifetime of this table
206- pub unsafe fn from_raw_parts ( base_addr : u64 , size : usize ) -> Self {
206+ pub unsafe fn from_raw_parts ( base_addr : u64 , len : usize ) -> Self {
207207 assert ! ( base_addr. is_multiple_of( Descriptor :: ALIGN as u64 ) ) ;
208- assert ! ( size <= u16 :: MAX as usize ) ;
208+ assert ! ( len <= u16 :: MAX as usize ) ;
209209
210- Self { base_addr, size }
210+ Self { base_addr, len }
211211 }
212212
213213 /// Get view into descriptor at index or None if idx is out of bounds
214214 pub fn desc_addr ( & self , idx : u16 ) -> Option < u64 > {
215- if idx >= self . size as u16 {
215+ if idx >= self . len as u16 {
216216 return None ;
217217 }
218218
@@ -221,12 +221,12 @@ impl DescTable {
221221
222222 /// Get number of descriptors in table
223223 pub fn len ( & self ) -> usize {
224- self . size
224+ self . len
225225 }
226226
227227 /// Is the descriptor table empty?
228228 pub fn is_empty ( & self ) -> bool {
229- self . size == 0
229+ self . len == 0
230230 }
231231
232232 pub const fn default_len ( ) -> usize {
0 commit comments