diff --git a/mm/shm/shmat.c b/mm/shm/shmat.c index befd39a92d..2733da96f2 100644 --- a/mm/shm/shmat.c +++ b/mm/shm/shmat.c @@ -153,7 +153,7 @@ FAR void *shmat(int shmid, FAR const void *shmaddr, int shmflg) /* Convert the region size to pages */ - npages = MM_PGALIGNUP(region->sr_ds.shm_segsz); + npages = MM_NPAGES(region->sr_ds.shm_segsz); /* Attach, i.e, map, on shared memory region to the user virtual address. */ diff --git a/mm/shm/shmdt.c b/mm/shm/shmdt.c index f51f719509..979315c797 100644 --- a/mm/shm/shmdt.c +++ b/mm/shm/shmdt.c @@ -132,7 +132,7 @@ int shmdt(FAR const void *shmaddr) /* Convert the region size to pages */ - npages = MM_PGALIGNUP(region->sr_ds.shm_segsz); + npages = MM_NPAGES(region->sr_ds.shm_segsz); /* Detach, i.e, unmap, on shared memory region from a user virtual * address. diff --git a/mm/shm/shmget.c b/mm/shm/shmget.c index c7701cbfc8..892aac5bf3 100644 --- a/mm/shm/shmget.c +++ b/mm/shm/shmget.c @@ -173,11 +173,11 @@ static int shm_extend(int shmid, size_t size) /* This is the number of pages that are needed to satisfy the allocation */ - pgneeded = MM_PGALIGNUP(size); + pgneeded = MM_NPAGES(size); /* This is the number of pages that have already been allocated */ - pgalloc = MM_PGALIGNUP(region->sr_ds.shm_segsz); + pgalloc = MM_NPAGES(region->sr_ds.shm_segsz); /* Loop until all pages have been allocated (or something bad happens) */ @@ -192,7 +192,7 @@ static int shm_extend(int shmid, size_t size) break; } - /* Increment the number of pages successully allocated */ + /* Increment the number of pages successfully allocated */ pgalloc++; }