Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5134204rwr; Sun, 23 Apr 2023 22:20:02 -0700 (PDT) X-Google-Smtp-Source: AKy350ZwV2E2xOWq9HYk2BNDKNlmtzXa/kFKrC0a2IlctEoYmRAceFwV60cWLLMF1HQ7xxWnwG29 X-Received: by 2002:a05:6a00:2d86:b0:63b:19e5:a96e with SMTP id fb6-20020a056a002d8600b0063b19e5a96emr14758861pfb.9.1682313601916; Sun, 23 Apr 2023 22:20:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682313601; cv=none; d=google.com; s=arc-20160816; b=P/q7k0OOVj7J0DqZtmtj9y7son4/qdDSaPNB0IDi4vXIkkVnZm0qX2gjfYU8L1nF6c 7kAy2UPZNeRYtod15CKx062UAgbxz/SwvVVnIHu/usSRZ8r5numUMHDl4EV6zpaFnBLh i/S1hcqviz6Br0baXaKSMdYAA9hO7a2zZIfq0QzDrSyxvRk2/J1aYEjUwVvwBxr2N+MQ 0xkBli7zRDNeN1V6DgXnLOBO4FVw/fNxwv/Dq+Ep4v5Na17en6Pa8OWDpVsqr6DNwOJD ygHi8GP+fUM0kkfuJPsoqiOn6vvJWKyt3V2xli+AiweG2y8zTqdyxVTZGki6VOxS/a5K gyMw== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=P4No43ZKEl1utDQ4+hUc8IIQ8EmV6YA+zJppOylJESI=; b=bqIKXiGq6RTtNITuaNbW2HXuFjVxlHLm2/h705pRocG+0/7LAHUzV5U2LCXXctaSqv CZb/BgJ4O2teAne+wwdPjwg1XNpQ5g7gHgP/V5RTGimmQnt67vaKrKb/esqwhI4oxSo6 BUFcbGfGX3xqf+MYljUlaPfuuxQYFLM8EiwRdqSPgp0Zrn+GndZ2XIW9YD8pKt8/JXLo FA/t3yMKgsNzhtlMPwLjAmOF7gst7gfjnC/Yhbw28fNjxi2YE5NcqSPn6bGxlBWmXjh2 a6nwgmvt8stQN44oQwwXLvWF+7GsoY1hYniKAf+b3lkZ5TRdXJx/TBZdHKtheGY68iL+ Vf2g== 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 z26-20020aa7949a000000b0063b6f80c145si7071291pfk.29.2023.04.23.22.19.48; Sun, 23 Apr 2023 22:20:01 -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 S229659AbjDXFJA (ORCPT + 99 others); Mon, 24 Apr 2023 01:09:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229516AbjDXFI7 (ORCPT ); Mon, 24 Apr 2023 01:08:59 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F6A6210C; Sun, 23 Apr 2023 22:08:47 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id D845F67373; Mon, 24 Apr 2023 07:08:43 +0200 (CEST) Date: Mon, 24 Apr 2023 07:08:43 +0200 From: Christoph Hellwig To: Breno Leitao Cc: Christoph Hellwig , io-uring@vger.kernel.org, linux-nvme@lists.infradead.org, asml.silence@gmail.com, axboe@kernel.dk, leit@fb.com, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, sagi@grimberg.me, kbusch@kernel.org, ming.lei@redhat.com Subject: Re: [PATCH 1/2] io_uring: Pass whole sqe to commands Message-ID: <20230424050843.GA9252@lst.de> References: <20230419102930.2979231-1-leitao@debian.org> <20230419102930.2979231-2-leitao@debian.org> <20230420045712.GA4239@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 Fri, Apr 21, 2023 at 08:11:31AM -0700, Breno Leitao wrote: > On Thu, Apr 20, 2023 at 06:57:12AM +0200, Christoph Hellwig wrote: > > On Wed, Apr 19, 2023 at 03:29:29AM -0700, Breno Leitao wrote: > > > struct nvme_uring_cmd_pdu *pdu = nvme_uring_cmd_pdu(ioucmd); > > > - const struct nvme_uring_cmd *cmd = ioucmd->cmd; > > > + const struct nvme_uring_cmd *cmd = (struct nvme_uring_cmd *)ioucmd->sqe->cmd; > > > > Please don't add the pointless cast. And in general avoid the overly > > long lines. > > If I don't add this cast, the compiler complains with the follow error: > > drivers/nvme/host/ioctl.c: In function ‘nvme_uring_cmd_io’: > drivers/nvme/host/ioctl.c:555:37: error: initialization of ‘const struct nvme_uring_cmd *’ from incompatible pointer type ‘const __u8 *’ {aka ‘const unsigned char *’} [-Werror=incompatible-pointer-types] > const struct nvme_uring_cmd *cmd = ioucmd->sqe->cmd; Oh. I think then we need a helper to get the private data from the io_uring_cmd as an interface that requires casts in all callers is one asking for bugs.