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 81FEBC83F1B for ; Wed, 16 Jul 2025 22:58:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C76E610E2EC; Wed, 16 Jul 2025 22:58:03 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="DcoD2fcN"; dkim-atps=neutral Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5CCA710E697 for ; Wed, 16 Jul 2025 22:58:03 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 16240448D7; Wed, 16 Jul 2025 22:58:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80F6AC4CEE7; Wed, 16 Jul 2025 22:57:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1752706683; bh=feyZUWnRLhI1C4HTdJ3yKYnq0VO/UBF9lovva/LkJx0=; h=Date:Subject:Cc:To:From:References:In-Reply-To:From; b=DcoD2fcNUtdPrjQw90CoOSe4Dwwm2GyYFGYFHUQzSlRaZ2BnYS/u6XKoe1tvumfNO Ipb6Hphd6iiy4FuSrYLnaaTJQFlkLsf0JwPWmpJPATeV5L1JsI6fzJL9AJfA6I0t+k 6E/6apYDZWLdtyoS6Q6DdMAVjWzB0Zg30b8cmyC396IoK3eFRfibOZcNjgKhRRY+ie zOU3A6QjLGZ/wtwQ1q/8iPoVaw2HqAByy+gmNq7q8CenPBLYxH3+ZGBPuptULx44qX JQ4RzWYxyxTr+TUkJXita5jK6kLtdOY8mzMPYBKv9vJdwd7iBoC1mnOf3mFTZFiqE9 QZg4ji8xpMWLQ== Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 17 Jul 2025 00:57:55 +0200 Message-Id: Subject: Re: [PATCH v2 1/2] device: 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: <20250711-device-as-ref-v2-0-1b16ab6402d7@google.com> <20250711-device-as-ref-v2-1-1b16ab6402d7@google.com> In-Reply-To: <20250711-device-as-ref-v2-1-1b16ab6402d7@google.com> 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Fri Jul 11, 2025 at 10:04 AM 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/aCd8D5IA0RXZvtcv@pollux > Signed-off-by: Alice Ryhl Applied to driver-core-testing, thanks!