• Muhammad Usama Anjum's avatar
    selftests: mm: fix build errors on armhf · b808f629
    Muhammad Usama Anjum authored
    The __NR_mmap isn't found on armhf.  The mmap() is commonly available
    system call and its wrapper is present on all architectures.  So it should
    be used directly.  It solves problem for armhf and doesn't create problem
    for other architectures.
    
    Remove sys_mmap() functions as they aren't doing anything else other than
    calling mmap().  There is no need to set errno = 0 manually as glibc
    always resets it.
    
    For reference errors are as following:
    
      CC       seal_elf
    seal_elf.c: In function 'sys_mmap':
    seal_elf.c:39:33: error: '__NR_mmap' undeclared (first use in this function)
       39 |         sret = (void *) syscall(__NR_mmap, addr, len, prot,
          |                                 ^~~~~~~~~
    
    mseal_test.c: In function 'sys_mmap':
    mseal_test.c:90:33: error: '__NR_mmap' undeclared (first use in this function)
       90 |         sret = (void *) syscall(__NR_mmap, addr, len, prot,
          |                                 ^~~~~~~~~
    
    Link: https://lkml.kernel.org/r/20240809082511.497266-1-usama.anjum@collabora.com
    Fixes: 4926c7a5 ("selftest mm/mseal memory sealing")
    Signed-off-by: default avatarMuhammad Usama Anjum <usama.anjum@collabora.com>
    Cc: Jeff Xu <jeffxu@chromium.org>
    Cc: Kees Cook <kees@kernel.org>
    Cc: Liam R. Howlett <Liam.Howlett@oracle.com>
    Cc: Shuah Khan <shuah@kernel.org>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    b808f629
mseal_test.c 41.2 KB