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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 14151C43458 for ; Fri, 26 Jun 2026 14:52:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7041710E3CD; Fri, 26 Jun 2026 14:52:35 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="WiWoyCYO"; dkim-atps=neutral Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id 83F8A10E3CD for ; Fri, 26 Jun 2026 14:52:34 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id E0CBD600C8; Fri, 26 Jun 2026 14:52:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3AC7A1F000E9; Fri, 26 Jun 2026 14:52:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1782485553; bh=KC0Y/EKfoL/rayFhZcOfTRBo++E0m+tQKSgGudy3Fpo=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=WiWoyCYOs/9J9RZ5Kvv3bvHpwnal+Bjoxg3Rwjc0pIPZjiVqlAO59vo3Kq/gnSnO/ fIKWkNcLsCxmHy5tCG6n9i91t4usbj3KzLf8/UahbOB8mUps6CBi7KRsHmuvqoZBx9 aM/Exy/ICvHZzWTeCVmZUNvoA/jbr0i+IoA4c3ZHkx5CI0harOrxU/fCWe1Wcn1qh0 tmIYnULhcUGzNHPEuz3cHHp6vqHXyJLJCvBgfMphFcRX5qrJ9Ls7WqHTK3YPnIaBge VvlQX6zLaTSr1XaxQGTs8LrwAPEi1djxkVHRP87019Ayc/PaFblJ2ypx2TvLdgypLx V1y9h/hMF4Rxw== From: sashiko-bot@kernel.org Subject: Re: [PATCH v5 01/20] rust: io: add dynamically-sized `Region` type To: "Gary Guo" Cc: linux-pci@vger.kernel.org, dri-devel@lists.freedesktop.org, ojeda@kernel.org, "Alexandre Courbot" , "Danilo Krummrich" In-Reply-To: <20260626-io_projection-v5-1-d0961471ae50@garyguo.net> References: <20260626-io_projection-v5-0-d0961471ae50@garyguo.net> <20260626-io_projection-v5-1-d0961471ae50@garyguo.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 26 Jun 2026 14:52:32 +0000 Message-Id: <20260626145233.3AC7A1F000E9@smtp.kernel.org> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" > Currently many I/O related structs carry a `SIZE` parameter to denote the > minimum size of the I/O region, while they also carry a field indicating > the actual size. Proliferation of the pattern creates a lot of duplicated > code, and makes it hard to create typed views of I/O. >=20 > Introduce a `Region` type that carries the `SIZE` parameter. It is a > wrapper of `[u8]`, which makes it dynamically sized with a metadata of > `usize`. This way, pointers to `Region` naturally carry size information. > This type is required to be 4-byte aligned. >=20 > Expose the minimum size information via `MIN_SIZE` constant of the > `KnownSize` trait. Similarly, expose the minimum alignment information via > `KnownSize::MIN_ALIGN`. >=20 > With these changes, it is possible to add an associated type to `Io` trait > to represent the type of I/O region. For untyped regions, this is the new= ly > added `Region` type. Remove `IoKnownSize` as it is no longer necessary. U= se > the same mechanism to indicate minimum size of PCI config spaces. >=20 > Signed-off-by: Gary Guo Sashiko has reviewed this patch and found no issues. It looks great! --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20260626-io_project= ion-v5-0-d0961471ae50@garyguo.net?part=3D1