Chris Johns started a new discussion: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1280#note_151629


The does not look correct to me and the existing code looks OK.

The macro `RTEMS_FLASHDEV_BITALLOC_LENGTH` has 
`RTEMS_FLASHDEV_REGION_BITALLOC_LENGTH` bits per word defined as:

```
#define RTEMS_FLASHDEV_REGION_BITALLOC_LENGTH 32
```

so the length of memory in words is:

```
#define RTEMS_FLASHDEV_BITALLOC_LENGTH( t ) \
  ( t->max_regions / RTEMS_FLASHDEV_REGION_BITALLOC_LENGTH )
```

and the memory clear is:

```
  alloc_array_len = RTEMS_FLASHDEV_BITALLOC_LENGTH( table ) +
                    ( ( RTEMS_FLASHDEV_BITALLOC_FINAL_BITS( table ) ) != 0 );

  memset( table->bit_allocator, 0, alloc_array_len );
```

-- 
View it on GitLab: 
https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1280#note_151629
You're receiving this email because of your account on gitlab.rtems.org.


_______________________________________________
bugs mailing list
[email protected]
http://lists.rtems.org/mailman/listinfo/bugs

Reply via email to