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 AC5CF2E8DFE; Wed, 9 Jul 2025 14:07:37 +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=1752070057; cv=none; b=PsEimlzD1Sp+D65zYyh5ZH/QXHw3cjbHX3ldz35EJTSvZzf13j2VUbSKMF57QvmloHGa4YSvhibnmbzK5yz/oCFW6d1FktAzJzVxQ1Z18xcT0AFQd40+F3DaiDukGUA6Aae19GfrpamNoxvSgT0UY12sMcu5CTEuOJ9yo3Aoj4Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752070057; c=relaxed/simple; bh=Hm0bvF4DG4aG9LPmmsB2p15ILEZrzXfJImhqafJXnvY=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:Cc:To:From: References:In-Reply-To; b=NxQ8yoNnHC+lNFr/+iicWk0iFPY1cK8p07GmLHPjU+WtabTLK9DvMn7P5v/WSvb73MGtnplO3Flivf61GXENk6MgtzHPK1oYUvBToLYb4djpSDHFs3tW9cCnakdiwwDF3crGZvyVCLKt6aqvOAGEtuD0j/gkYk3+/JKoMcodN/U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iWAUgoEq; 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="iWAUgoEq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58832C4CEEF; Wed, 9 Jul 2025 14:07:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1752070057; bh=Hm0bvF4DG4aG9LPmmsB2p15ILEZrzXfJImhqafJXnvY=; h=Date:Subject:Cc:To:From:References:In-Reply-To:From; b=iWAUgoEqjEQTQxZ36FcfbNFyFBVPNRA0D0JV+LccBOTVsCmu7JPvn/T8KCAllMK3m yxju8s4XhSpqboQ/ABUZU+sab5Sb9ZxwKjOPw0rMfPYjtgjoZYqhGJD7h7xPmOCk9F Q1eYDiHJ2Ck79lP1kalRvdLJAKjet2cN6wCrPYIG/feNTDBTuE9gBM7vk5Cl2+1ozD RSTRZGDDzDNMvJQdq++DOftuR0Ogn7QN5mmLbialUbGcKiRkAlsaVr66mYquIiKFAi pwcJA55gOMdV0+k/FI3k35OSsx2Vja23RzsrNV4BcLKC0bvdRt1UliBpANh/pnyf5I oTE0RvvJbcFzg== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 09 Jul 2025 16:07:30 +0200 Message-Id: Subject: Re: [PATCH] drm: rust: rename Device::as_ref() to Device::from_raw() Cc: "Greg Kroah-Hartman" , "Dave Ertman" , "Ira Weiny" , "Leon Romanovsky" , "Miguel Ojeda" , "Boqun Feng" , "Gary Guo" , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , "Benno Lossin" , "Andreas Hindborg" , "Trevor Gross" , "Thomas Gleixner" , "Peter Zijlstra" , "Rafael J. Wysocki" , "David Airlie" , "Simona Vetter" , "Maarten Lankhorst" , "Maxime Ripard" , "Thomas Zimmermann" , "FUJITA Tomonori" , "Bjorn Helgaas" , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , , , , , To: "Alice Ryhl" From: "Danilo Krummrich" References: <20250709-device-as-ref-v1-1-ebf7059ffa9c@google.com> In-Reply-To: <20250709-device-as-ref-v1-1-ebf7059ffa9c@google.com> On Wed Jul 9, 2025 at 3:53 PM CEST, Alice Ryhl wrote: > The prefix as_* should not be used for a constructor. Constructors > usually use the prefix from_* instead. > > Some prior art in the stdlib: Box::from_raw, CString::from_raw, > Rc::from_raw, Arc::from_raw, Waker::from_raw, File::from_raw_fd. > > There is also prior art in the kernel crate: cpufreq::Policy::from_raw, > fs::File::from_raw_file, Kuid::from_raw, ARef::from_raw, > SeqFile::from_raw, VmaNew::from_raw, Io::from_raw. > > Link: https://lore.kernel.org/r/aCZYcs6Aj-cz81qs@pollux I think the link you actually wanted to refer to is probably [1]. :) [1] https://lore.kernel.org/all/aCd8D5IA0RXZvtcv@pollux/ > Signed-off-by: Alice Ryhl Can you please split this patch up in one for the DRM renames, i.e. drm::De= vice, gem::Object and drm::File, and one for device::Device?