This is an automated email from the ASF dual-hosted git repository. Donny9 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 26a25c1318d9c65c6ea07402c4e2a86a6fb4d00a Author: yukangzhi <[email protected]> AuthorDate: Wed Nov 5 19:46:22 2025 +0800 mm/mempool: Fix MISRA C-2012 Rule 10.4 in get_dict/free/read MISRA C-2012 Basic Type Model. (MISRA C-2012 Rule 10.4) In mempool_multiple_free: Common arithmetic conversions performed on the two operands of an operator should have the same basic type class. MISRA C-2012 Basic Type Model. (MISRA C-2012 Rule 10.4) In mempool_multiple_get_dict: Common arithmetic conversions performed on the two operands of an operator should have the same basic type class. MISRA C-2012 Basic Type Model. (MISRA C-2012 Rule 10.4) In mempool_read: Common arithmetic conversions performed on the two operands of an operator should have the same basic type class. Signed-off-by: yukangzhi <[email protected]> --- mm/mempool/mempool_multiple.c | 6 +++--- mm/mempool/mempool_procfs.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/mempool/mempool_multiple.c b/mm/mempool/mempool_multiple.c index e3691b32dc1..bab3993af5f 100644 --- a/mm/mempool/mempool_multiple.c +++ b/mm/mempool/mempool_multiple.c @@ -331,8 +331,8 @@ mempool_multiple_get_dict(FAR struct mempool_multiple_s *mpool, addr = kasan_clear_tag(addr); if (kasan_clear_tag(mpool->dict[row]) == NULL || kasan_clear_tag(mpool->dict[row][col].addr) != addr || - ((FAR char *)kasan_clear_tag(blk) - - (FAR char *)addr >= mpool->dict[row][col].size)) + ((size_t)((FAR char *)kasan_clear_tag(blk) - + (FAR char *)addr) >= mpool->dict[row][col].size)) { return NULL; } @@ -638,7 +638,7 @@ int mempool_multiple_free(FAR struct mempool_multiple_s *mpool, return -EINVAL; } - blk = (FAR char *)blk - (((FAR char *)kasan_clear_tag(blk) - + blk = (FAR char *)blk - ((size_t)((FAR char *)kasan_clear_tag(blk) - ((FAR char *)kasan_clear_tag(dict->addr) + mpool->minpoolsize)) % MEMPOOL_REALBLOCKSIZE(dict->pool->blocksize)); diff --git a/mm/mempool/mempool_procfs.c b/mm/mempool/mempool_procfs.c index 42ebb02727a..d7e6e9855f8 100644 --- a/mm/mempool/mempool_procfs.c +++ b/mm/mempool/mempool_procfs.c @@ -174,7 +174,7 @@ static ssize_t mempool_read(FAR struct file *filep, FAR char *buffer, } } - filep->f_pos += totalsize; + filep->f_pos += (off_t)totalsize; return totalsize; }
