1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #16781 from benpicco/flashpage_page-const

drivers/flashpage: flashpage_page() takes a const argument
This commit is contained in:
benpicco 2021-08-31 10:22:46 +02:00 committed by GitHub
commit 9294a31856
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -329,7 +329,7 @@ size_t flashpage_size(unsigned page)
}
}
unsigned flashpage_page(void *addr)
unsigned flashpage_page(const void *addr)
{
/* Calculates the flashpage number based on the address for the
* non-homogeneous flashpage stm32 series.

View File

@ -190,7 +190,7 @@ static inline void *flashpage_addr(unsigned page)
*
* @return page containing the given address
*/
static inline unsigned flashpage_page(void *addr)
static inline unsigned flashpage_page(const void *addr)
{
return (((intptr_t)addr - CPU_FLASH_BASE) / FLASHPAGE_SIZE);
}
@ -200,7 +200,7 @@ static inline unsigned flashpage_page(void *addr)
/* Bare prototypes for the above functions. See above for the documentation */
size_t flashpage_size(unsigned page);
void *flashpage_addr(unsigned page);
unsigned flashpage_page(void *addr);
unsigned flashpage_page(const void *addr);
#endif
@ -319,7 +319,7 @@ static inline void *flashpage_rwwee_addr(unsigned page)
*
* @return RWWEE page containing the given address
*/
static inline int flashpage_rwwee_page(void *addr)
static inline int flashpage_rwwee_page(const void *addr)
{
return (int)(((int)addr - CPU_FLASH_RWWEE_BASE) / FLASHPAGE_SIZE);
}

View File

@ -118,7 +118,7 @@ void *flashpage_addr(unsigned page)
#endif /* PERIPH_FLASHPAGE_NEEDS_FLASHPAGE_ADDR */
#ifdef PERIPH_FLASHPAGE_NEEDS_FLASHPAGE_PAGE
unsigned flashpage_page(void *addr)
unsigned flashpage_page(const void *addr)
{
unsigned page = 0;