Re: [PATCH liburing v3 05/10] arch/aarch64: lib: Add `get_page_size()` function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/5/22 1:18 AM, Alviro Iskandar Setiawan wrote:
fallback_ret var is not needed, just do this, simpler:

static inline long __get_page_size(void)
{
         Elf64_Off buf[2];
         long ret = 4096;
         int fd;

         fd = __sys_open("/proc/self/auxv", O_RDONLY, 0);
         if (fd < 0)
                 return ret;

         while (1) {
                 ssize_t x;

                 x = __sys_read(fd, buf, sizeof(buf));
                 if (x < sizeof(buf))
                         break;

                 if (buf[0] == AT_PAGESZ) {
                         ret = buf[1];
                         break;
                 }
         }

         __sys_close(fd);
         return ret;
}

Agree with that, will fold this in for v4.

with that simplification:

Reviewed-by: Alviro Iskandar Setiawan <alviro.iskandar@xxxxxxxxxxx>

Thanks!

--
Ammar Faizi



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux