From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6E79C433EF for ; Mon, 4 Jul 2022 18:23:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231365AbiGDSXr (ORCPT ); Mon, 4 Jul 2022 14:23:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229584AbiGDSXr (ORCPT ); Mon, 4 Jul 2022 14:23:47 -0400 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C38B1B36 for ; Mon, 4 Jul 2022 11:23:46 -0700 (PDT) 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 Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org 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