From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,NO_DNS_FOR_FROM, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from [192.168.88.254] (unknown [36.81.65.188]) by gnuweeb.org (Postfix) with ESMTPSA id C5FA2801D5; Mon, 4 Jul 2022 18:23:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1656959026; bh=LkVyQH9eAvRi0CHInjMIg746Huz2+OY1ZBApgtfs8T8=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=kAWfWk4Kh66GN9UvRWQFeLoOQgV/R+SY60v2857nhsOsgy+cWVRKj4VB25vnvNEbq 2kG0X7mK5+RMNplZk7f9pIRCVLDzN6mRkvyWZPTTsID3YzSbLw/MdERjLUy8FKWAVv YU/CgjApgwtBYQUicJqpTseiro509m5GD8nTSP+oY6X2m3BoUCM54r+OrV1RrV7XD0 LRJfLYP3vanKIgmH/kUCtwV1QUT9tnigCTIl19M+lNbN6jsgTYcr3N55Eygywpiv69 g7M+Cd7xNXsD6WRMK95jr00g074/zKK9olTN6zaxyH8j2/YQQnwX+LC3OFujzs5OTi 6kEQ9x2r7GCTw== Message-ID: <3b8da014-41f9-6640-589e-63795ac0ed67@gnuweeb.org> Date: Tue, 5 Jul 2022 01:23:30 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH liburing v3 05/10] arch/aarch64: lib: Add `get_page_size()` function Content-Language: en-US To: Alviro Iskandar Setiawan Cc: Jens Axboe , Fernanda Ma'rouf , Hao Xu , Pavel Begunkov , io-uring Mailing List , GNU/Weeb Mailing List References: <20220704174858.329326-1-ammar.faizi@intel.com> <20220704174858.329326-6-ammar.faizi@intel.com> From: Ammar Faizi In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: 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 Thanks! -- Ammar Faizi