[LTP] mem/hugetlb: use SAFE_SHMGET() in hugeshmget setup function.
linuxtestproject.agent@gmail.com
linuxtestproject.agent@gmail.com
Wed May 6 17:58:39 CEST 2026
Hi Samir,
On Sun, 12 Apr 2026, Samir wrote:
> mem/hugetlb: use SAFE_SHMGET() in hugeshmget setup function.
>
> I updated hugeshmget02.c and hugeshmget05.c to use SAFE_SHMGET() and
> configured the setup paths so that shared memory allocation succeeds
> as expected.
>
> In hugeshmget03.c, I also simplified the tst_brk() message by removing
> the unnecessary __func__ usage and keeping a straightforward shmget()
> error message.
The commit body describes what changed but not why. Add a sentence with
the motivation, e.g. "Replace the manual shmget()/tst_brk() pattern with
SAFE_SHMGET() to align with LTP conventions."
The SAFE_SHMGET() conversion (hugeshmget02, hugeshmget05) and the
tst_brk() message cleanup (hugeshmget03) are two independent logical
changes. Please split them into separate commits.
Remove the trailing period from the commit subject.
> - shm_id_1 = shmget(shmkey, shm_size,
> - SHM_HUGETLB | IPC_CREAT | IPC_EXCL | SHM_RW);
> - if (shm_id_1 == -1)
> - tst_brk(TBROK | TERRNO, "shmget #setup");
> + shm_id_1 = SAFE_SHMGET(shmkey, shm_size,
> + SHM_HUGETLB | IPC_CREAT | IPC_EXCL | SHM_RW);
The continuation line is not aligned under the opening parenthesis of
SAFE_SHMGET(); fix the indentation (use tabs+spaces to land at column 33).
---
Note:
Our agent completed the review of the patch.
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
More information about the ltp
mailing list