Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1265069rwr; Wed, 3 May 2023 12:30:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4/MJ7rJPZKMUouT5BxCdP6ou4J/cPs2yVyRl/TBr3uq7Y2v2xwvq/G+PWe7TkIOIq+g7L5 X-Received: by 2002:a17:90b:1645:b0:247:26da:5de2 with SMTP id il5-20020a17090b164500b0024726da5de2mr23243810pjb.20.1683142203826; Wed, 03 May 2023 12:30:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683142203; cv=none; d=google.com; s=arc-20160816; b=iIiDfx7W/ccbegVWAIEgf/aNO11N4Y3T84d4u3qqr7W396NTXpATP/1laODfgcAfxc tGpgrguyi5V+Wo3YrIiSwEcdSHzu08CcsOUpKhYCcjsXGxlYxFP5cC63dYga16Ce7JTz OpvL9zIajl4+5ZPXTapHOOF1mEEW1a5pekjlB+C/q4PCqX49IY3fJ1iMANJgalzkP658 Fz6QOQsok8evTfy0xuSTjZPGBwG1O3TF4Z5Tt+rzIX1sYZMTISmOrUySbgTYwRrPyNPV tnG5f30C65nl/HRlT3YGinqAFU4QaF9TdVTl6pgnaE3ZlVe19O47pDhuAvxNuMDWxMX6 X4Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=54FcX7m56ayBWjcvud1Kf/5sZaGwEHaWh+uspYclntQ=; b=jbYpw6cHGEMhpf/Z1p0sH+NUaBYCLRFpBkM4m27IBVMeEl/huc0OLg42jMUFctzH7e zhky6HFUBh6VVq5qXTlMg0boD+PvwZnVbqj7Sg11yVuHeMhjcG22EndgYBYyrC0dcdPb Cz7W/xHebu6IPZmIZpBVa+0emXCv4Yk8DgPOx1swXhTi9SUd6dbQxIRLY+yu2CbPH0u5 Uu4ZDdqp4efwrU5gJb3EUbIF2wbC2cJLKnyBA/KGHK/pNVULJaqFoNcxjWI0Yba2QE6o 78EApJDs5cgqI+bdeqbtbmLOuNEsjYhtgAtfrXa9eIF1znAXMKPQwwE1/wxQ+LWLGCq6 aC+w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g14-20020a17090a67ce00b00244a3e7bc69si2281123pjm.38.2023.05.03.12.29.52; Wed, 03 May 2023 12:30:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229680AbjECTLt (ORCPT + 99 others); Wed, 3 May 2023 15:11:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229595AbjECTLr (ORCPT ); Wed, 3 May 2023 15:11:47 -0400 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51F2B7AA3; Wed, 3 May 2023 12:11:44 -0700 (PDT) Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-306281edf15so4858551f8f.1; Wed, 03 May 2023 12:11:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683141103; x=1685733103; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=54FcX7m56ayBWjcvud1Kf/5sZaGwEHaWh+uspYclntQ=; b=Mpz4hTf3Xp44JTzlnxjhUNRd8Hwn0unWpsdfKLEYhvCSgYWfYX7rC89PVZ/TRcErr4 76uZQy14HkwfLJZfP+LhDE9qbBDc4tF5TQncPkhYaxEhzl3qqntjSu7N1948sPbB0p7A kbOmsrPEwIdKhbZVesPMGDoP2GPBQueDREcQimlsKbFFwxBHCqgpSrQ2b9T2pT0+KVss lopUUIVea47bJCipnzRnFuEqinp9TNcuTeF/clMZyAoXNSDflvd4/JvBJ/otPttdkfO+ AD2m2r7X4UwEbusT9ochfmZ76pGwGT/D/azz3cFYqHpYzptlVjz9CkHnOXZW3pJCi0yZ Hbmw== X-Gm-Message-State: AC+VfDw1g2VTld7hDdDtDqUiAvLT+ZAUD9OnCsRhBBNLV0orOG/FhpiO pnkWPQOfex4czW9wTuPMcqY= X-Received: by 2002:a5d:6b09:0:b0:306:2eab:fb8c with SMTP id v9-20020a5d6b09000000b003062eabfb8cmr771025wrw.42.1683141102639; Wed, 03 May 2023 12:11:42 -0700 (PDT) Received: from gmail.com (fwdproxy-cln-029.fbsv.net. [2a03:2880:31ff:1d::face:b00c]) by smtp.gmail.com with ESMTPSA id k5-20020adff5c5000000b002f103ca90cdsm34480997wrp.101.2023.05.03.12.11.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 12:11:42 -0700 (PDT) Date: Wed, 3 May 2023 12:11:40 -0700 From: Breno Leitao To: Christoph Hellwig Cc: io-uring@vger.kernel.org, linux-nvme@lists.infradead.org, asml.silence@gmail.com, axboe@kernel.dk, ming.lei@redhat.com, leit@fb.com, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, sagi@grimberg.me, joshi.k@samsung.com, kbusch@kernel.org Subject: Re: [PATCH v3 4/4] block: ublk_drv: Add a helper instead of casting Message-ID: References: <20230430143532.605367-1-leitao@debian.org> <20230430143532.605367-5-leitao@debian.org> <20230501043122.GC19673@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230501043122.GC19673@lst.de> X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 01, 2023 at 06:31:22AM +0200, Christoph Hellwig wrote: > On Sun, Apr 30, 2023 at 07:35:32AM -0700, Breno Leitao wrote: > > ublk driver is using casts to get private data from uring cmd struct. > > Let's use a proper helper, as an interface that requires casts in all > > callers is one asking for bugs. > > > > Suggested-by: Christoph Hellwig > > No, I've not suggested this. > > > +static inline struct ublksrv_ctrl_cmd *ublk_uring_ctrl_cmd( > > + struct io_uring_cmd *cmd) > > +{ > > + return (struct ublksrv_ctrl_cmd *)cmd->sqe->cmd; > > +} > > I've two times explained we need a core io_uring helper to remove this > casting in the drivers, and I've explained how to do that and provided > the actual code for it. Sorry for it, somehow I misunderstood what you meant. I re-read the thread and got what you said. I am preparing a V4 with the new approach, and I will send it tomorrow.