mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
drivers/mtd_flashpage: fix comperror when compiling without asserts
the variable cpu_flash_base is only used in asserts. This gives errors if you compile without them.
This commit is contained in:
parent
c5710392b2
commit
02d86c2a25
@ -45,8 +45,9 @@ static int _init(mtd_dev_t *dev)
|
|||||||
assert(!(super->offset % dev->pages_per_sector));
|
assert(!(super->offset % dev->pages_per_sector));
|
||||||
|
|
||||||
/* Use separate variable to avoid '>= 0 is always true' warning */
|
/* Use separate variable to avoid '>= 0 is always true' warning */
|
||||||
|
#ifndef NDEBUG
|
||||||
static const uintptr_t cpu_flash_base = CPU_FLASH_BASE;
|
static const uintptr_t cpu_flash_base = CPU_FLASH_BASE;
|
||||||
|
#endif
|
||||||
assert((uintptr_t)flashpage_addr(super->offset / dev->pages_per_sector) >= cpu_flash_base);
|
assert((uintptr_t)flashpage_addr(super->offset / dev->pages_per_sector) >= cpu_flash_base);
|
||||||
assert((uintptr_t)flashpage_addr(super->offset / dev->pages_per_sector)
|
assert((uintptr_t)flashpage_addr(super->offset / dev->pages_per_sector)
|
||||||
+ dev->pages_per_sector * dev->page_size * dev->sector_count <= MTD_FLASHPAGE_END_ADDR);
|
+ dev->pages_per_sector * dev->page_size * dev->sector_count <= MTD_FLASHPAGE_END_ADDR);
|
||||||
|
Loading…
Reference in New Issue
Block a user