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 AF039C433EF for ; Mon, 25 Jul 2022 12:22:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231852AbiGYMWE (ORCPT ); Mon, 25 Jul 2022 08:22:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234722AbiGYMWA (ORCPT ); Mon, 25 Jul 2022 08:22:00 -0400 Received: from gnuweeb.org (gnuweeb.org [51.81.211.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 920421AD8E for ; Mon, 25 Jul 2022 05:21:59 -0700 (PDT) Received: from [192.168.88.254] (unknown [125.160.106.238]) by gnuweeb.org (Postfix) with ESMTPSA id 0DB537E328; Mon, 25 Jul 2022 12:21:57 +0000 (UTC) X-GW-Data: lPqxHiMPbJw1wb7CM9QUryAGzr0yq5atzVDdxTR0iA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1658751719; bh=QsDY/YPjarBuN8OjLrDcNpRwFRScV2ZunQnU3PT8iXc=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Rr1XHKmU1oI5zyD+W83cLQpJ7fyU0CAJb77GKc/7iL3AVakZNLyMbxMG+FpbawLf2 D3tW/ZusYcNPBTSU8uJxRI8Arx95jnngN4ktXVjf3h98retPZRZV6oIenNnTMMZ/Ks LVnyZ2VEk7xMz4tkuqYUfP7se1XLy4VaF3wlQasZHg19LHjrXeGsAjwOmrPwF8/ER/ Cnux5yHZVVMZ2DEQYEzYMHeiF9tQNkgsgK7erGrrS+vAwwclas0+CJURnqZCE/6aTx XS8Ipfb89qmdwAnPRiIJksRxJuvjiERe34YxoHTZzOpQG+cUvlARk2KKDA6mfrpakg YaFZbPybHO17Q== Message-ID: <66044140-0ac5-ad3d-11bf-97b2bf70ceeb@gnuweeb.org> Date: Mon, 25 Jul 2022 19:21:56 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH liburing v2 5/5] liburing: improve fallocate typecasting Content-Language: en-US To: Pavel Begunkov , io-uring Mailing List Cc: Jens Axboe References: 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/25/22 6:33 PM, Pavel Begunkov wrote: > Don't double cast int -> ptr -> int in io_uring_prep_fallocate(), assign > len directly. > > Signed-off-by: Pavel Begunkov > --- > src/include/liburing.h | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) [...] > io_uring_prep_rw(IORING_OP_FALLOCATE, sqe, fd, > - (const uintptr_t *) (unsigned long) len, > - (unsigned int) mode, (__u64) offset); > + 0, (unsigned int) mode, (__u64) offset); nit: instead of 0 it's better to use NULL. No? > + sqe->addr = (__u64) len; This one looks simpler than a double cast. Reviewed-by: Ammar Faizi -- Ammar Faizi