Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5024933rwr; Sun, 30 Apr 2023 21:33:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4R0na2ddAxIyyli+QOI64LkXXbxFPLTUnYqdlGFT6VNeQjb2GTb3VdC/P/Ff/hJguGCS/+ X-Received: by 2002:a17:902:e543:b0:1a9:5dfb:11c5 with SMTP id n3-20020a170902e54300b001a95dfb11c5mr14440989plf.35.1682915596058; Sun, 30 Apr 2023 21:33:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682915596; cv=none; d=google.com; s=arc-20160816; b=Pkw8xY7IXBSc48jy1YCJTYt47c/isM4wETlzsUNgWFgzZ/xxGwfj35YYyiPftQzXYg ZKnAakxpic0cDgi683uornWmPfVBKaaLnVvki4OlicxXDWh4Sqt5mGKtt7Qwbbu7rnDP 6fjOkcxpESaXxaa4/e/mF5l3QNnHil6yTxnpbyQMCPD+QyWVhVPdRk1VRL/SzJDXYKeh t1cadQIUUYIvgkGoqTQo7OWmV3DASHN0VFVts5/+JC/T196vBEg0z/etl6V3SRANlvE2 gjop4paepuQryYcddt3JYm8CpMpwmE2hT6xWyxJuLpNLN6J3ju6bu2wU/lT6WNCKelns s2Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=5cz2+0p4eQcn4y1bOt2oQ7Xu0gnBM4y2AV3SN6I2FRQ=; b=p4dmCAqaM4R+U8ksllS1fg4SNl9zgtgxEaC0KQPEbdhkgnOfNzcnEecJAulJWdX9IV 1InFYDroyquL/Q1/cxzJ7zoMRBHvY0mqSjJGsDwZVjWEDpalgJXUbSjHAaoit1rj9utQ gZpQJpn37JQq5ecpDTTXTr8Oqqlq9pkF8e3Qv1K5M/avfA0H8rG6dQiKDPuP75tx+Y71 yphiA0IsTLaP/e9hmzAWoaUbcn+p2Av0tynfVWI3m//arelH/un5X2RWZ2mD6uhZr92h mZXvRf9VfMzQnTfYpU+3nyEtF+/nR8LcM6Y73oPZUHMdDV+7vAdnup5r1PND/tOKvAqH WCFg== 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 e15-20020a17090301cf00b001a6d4ec7c89si29220328plh.222.2023.04.30.21.33.05; Sun, 30 Apr 2023 21:33:16 -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 S229531AbjEAEb3 (ORCPT + 99 others); Mon, 1 May 2023 00:31:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232186AbjEAEb0 (ORCPT ); Mon, 1 May 2023 00:31:26 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5EA410C3; Sun, 30 Apr 2023 21:31:25 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id F3A6668B05; Mon, 1 May 2023 06:31:22 +0200 (CEST) Date: Mon, 1 May 2023 06:31:22 +0200 From: Christoph Hellwig To: Breno Leitao 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, hch@lst.de, kbusch@kernel.org Subject: Re: [PATCH v3 4/4] block: ublk_drv: Add a helper instead of casting Message-ID: <20230501043122.GC19673@lst.de> References: <20230430143532.605367-1-leitao@debian.org> <20230430143532.605367-5-leitao@debian.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230430143532.605367-5-leitao@debian.org> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 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.