From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D7C00366073; Mon, 23 Feb 2026 15:01:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771858882; cv=none; b=MOqA2rFbzl7rRw/wblHE5t7rP7gQ/fwOUpm6gFrzgwM28drGXX5xeY1AfTGHT0F9Lh482H+eB73/UooGhVDLZo/UtzvCa+wgzjNJPhhSAjeYkkyrCdlVK1EF+SuGfFus8lLYvBXSMlEjvnr+ooqPvPEwH8AJRzy1q1HhBEzoDRU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771858882; c=relaxed/simple; bh=e5c5b74M3vTmffrZkxVqf33SIGqWmbbti+5cabgqU30=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=Gz8/753a2iz7qFu0d/omKoqsYaK06rOR8TLZyh+7KhDoAHolPozHU/XnMq9FwIwXtkscrw9nsxkIdRUyBHm/3rEIZFAE6Ol2W28eD+2jokog2lTzggVFUF0rfMMjLKNTjDxArZC8PowuOtOP2pJVayO0OaT7aWW/pQHhHMI95e4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OaigYStr; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OaigYStr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 40292C2BCB2; Mon, 23 Feb 2026 15:01:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771858882; bh=e5c5b74M3vTmffrZkxVqf33SIGqWmbbti+5cabgqU30=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=OaigYStrS0H58RnK9jYWZCcHDiqSEdAX7xgm52ZiTIH2hOr6lFz0pfIeHqnXSx22c fPLAmdIje8wpwT3qgmVJaXPsnkaS7NB7FwbUnfh6uL4pw4ZkNksgkgpQj1U9soOJP3 I8zQ06tXZJNH9bmYxdwifxd2hS8ZyCjhPsUEDM0WvensrAB7wgg+ERxBdKJP20LcBg JyDzx8ODMtCb6QkuTBbIFDF1X1wLOYFev6Eyzhc0eMwdUu/PVzCaS4BJW214un6Gfw oem2r/xcNVnvVt1I21kKCGINo2ZynGSWPrRf7980RO65Ev+qkS2YfdT/tsiM9Vv5jR s31T8kd8QKH0w== From: Andreas Hindborg To: Miguel Ojeda , Tamir Duberstein , Benno Lossin Cc: Miguel Ojeda , Gary Guo , =?utf-8?Q?Bj=C3=B6rn?= Roy Baron , Alice Ryhl , Trevor Gross , Danilo Krummrich , Greg Kroah-Hartman , Dave Ertman , Ira Weiny , Leon Romanovsky , Paul Moore , Serge Hallyn , "Rafael J. Wysocki" , David Airlie , Simona Vetter , Alexander Viro , Christian Brauner , Jan Kara , Igor Korotin , Daniel Almeida , Lorenzo Stoakes , "Liam R. Howlett" , Viresh Kumar , Nishanth Menon , Stephen Boyd , Bjorn Helgaas , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Boqun Feng , linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-block@vger.kernel.org, linux-security-module@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-pm@vger.kernel.org, linux-pci@vger.kernel.org Subject: Re: [PATCH v15 9/9] rust: page: add `from_raw()` In-Reply-To: References: <20260220-unique-ref-v15-0-893ed86b06cc@kernel.org> <20260220-unique-ref-v15-9-893ed86b06cc@kernel.org> Date: Mon, 23 Feb 2026 16:00:02 +0100 Message-ID: <87sear33pp.fsf@t14s.mail-host-address-is-not-set> Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Miguel Ojeda writes: > On Fri, Feb 20, 2026 at 10:52=E2=80=AFAM Andreas Hindborg wrote: >> >> + /// Create a `&Page` from a raw `struct page` pointer > > Please end sentences with a period. Ok. > >> + // SAFETY: By function safety requirements, ptr is not null and= is > > Please use Markdown in comments: `ptr`. Ok. > >> + /// `ptr` must be valid for use as a reference for the duration of = `'a`. > > Since we will likely try to starting introducing at least a subset of > the Safety Standard soon, we should try to use standard terms. > > So I think this "valid for use as a reference" is not an established > one, no? Isn't "convertible to a shared reference" the official term? > > https://doc.rust-lang.org/std/ptr/index.html#pointer-to-reference-conve= rsion > > In fact, I see `as_ref_unchecked()` and `as_mut_unchecked()` just got > stabilized for 1.95.0, so we should probably starting using those were > applicable as we bump the minimum, but we should probably use already > a similar wording as the standard library for the safety section and > the comment: > > "`ptr` must be [convertible to a reference](...)." I'll change the wording to the "convertible" one. Best regards, Andreas Hindborg