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 DF63A25F979; Mon, 30 Jun 2025 12:32:03 +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=1751286724; cv=none; b=k1RImL+fIfDB4sBsjzhQ+vOEcTTczr9eGmsWgSlU50JSEDb9kAdH42HEQOY8QJJmttcYGp31nWIsiv0Ym/U/utQF98lo2xaJpYYkhMTtwqrGtYj3xjsfBppfCO8BlNCnA9hGIdVBkNJxai0Uf88r5i7tGJH5zJJUMd13d2klccI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751286724; c=relaxed/simple; bh=mYEHSHiaoqZbuDagkYLY51yAWXpjac4Sp0EZW5KOBcA=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=HDknGBOclbiD9vaniwGU0hy7UmS/lr1N+jsIc/6maLZEHPMIh7Lc22WgN/n9nN5+B1uHlmElL47pJLQ5ZbPG0Jnldefrvyp/rcP7c9s+JCni9KOv/SlZSaiEtfNYjx7kcxcDOsPSCtZ9THhN7Cq7hcGcsEnZ/qPsvt75fHkU3iM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=O0GLWnex; 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="O0GLWnex" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D49BCC4CEF0; Mon, 30 Jun 2025 12:31:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1751286723; bh=mYEHSHiaoqZbuDagkYLY51yAWXpjac4Sp0EZW5KOBcA=; h=Date:Cc:Subject:From:To:References:In-Reply-To:From; b=O0GLWnexx0I8dGAWj31cI85X4o9FIB5Czt20YKesAIa+DdIO89p65WZOxJYwoz+ea 2CgUxKd9TaFUzD7UScrQrx7X4CHTRJQAUB7aD5z7eHs/OvWu2psA9zgPiXzP1xxyDa bcI9JCq1iUtguuzRfnb1p3t7ulFC1aRgeO4H9GzQUlLuUAHU1gDLiz85Wg+85xUyDR XzB3OuUhxfBgY6ouwJbaErhusmp1VacVzKj2IKs9f6+gPiau/ZdhkP36LlhfXS0Df/ 7gX3OQz/xXeRh0fUiJ04GCItr9CsfG5pHNN6lnhEm6KHAB7+Ou87WEwMagn+iv5LDO lOy8GtaFFrIfw== Precedence: bulk X-Mailing-List: linux-modules@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: Mon, 30 Jun 2025 14:31:57 +0200 Message-Id: Cc: "Miguel Ojeda" , "Alex Gaynor" , "Boqun Feng" , "Gary Guo" , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , "Alice Ryhl" , "Masahiro Yamada" , "Nathan Chancellor" , "Luis Chamberlain" , "Nicolas Schier" , "Trevor Gross" , "Adam Bratschi-Kaye" , , , , "Petr Pavlu" , "Sami Tolvanen" , "Daniel Gomez" , "Simona Vetter" , "Greg KH" , "Fiona Behrens" , "Daniel Almeida" , Subject: Re: [PATCH v13 5/6] rust: samples: add a module parameter to the rust_minimal sample From: "Benno Lossin" To: "Danilo Krummrich" , "Andreas Hindborg" X-Mailer: aerc 0.20.1 References: <20250612-module-params-v3-v13-0-bc219cd1a3f8@kernel.org> <20250612-module-params-v3-v13-5-bc219cd1a3f8@kernel.org> <87qzz1xwdg.fsf@kernel.org> <211a3491-7082-488a-b744-fa7416db18c3@kernel.org> In-Reply-To: On Mon Jun 30, 2025 at 2:23 PM CEST, Danilo Krummrich wrote: > On 6/30/25 2:18 PM, Danilo Krummrich wrote: >> On 6/30/25 2:12 PM, Andreas Hindborg wrote: >>> "Danilo Krummrich" writes: >>> >>>> (Sorry for being late on this one, just a minor nit below.) >>>> >>>> On 6/12/25 3:40 PM, Andreas Hindborg wrote: >>>>> =C2=A0=C2=A0 struct RustMinimal { >>>>> @@ -20,6 +26,10 @@ impl kernel::Module for RustMinimal { >>>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 fn init(_module: &'static ThisMo= dule) -> Result { >>>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pr_info!= ("Rust minimal sample (init)\n"); >>>>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pr_info!= ("Am I built-in? {}\n", !cfg!(MODULE)); >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pr_info!( >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "= test_parameter: {}\n", >>>>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 *= module_parameters::test_parameter.get() >>>> >>>> Can we please call it something else than get(), maybe obtain(), acces= s() or >>>> just ref()? >>> >>> Probably `ref` is the most precise of the options you propose. I would >>> go with that one. Or, should it be `as_ref`? >>=20 >> Guess that works as well. >>=20 >> One question additional question: Can't we just impl Deref for >> ModuleParamAccess? > > Just notice that it would work for now, but not in the future, because th= is will > apparently require some lock guard? Then maybe access() describes it best= ? What about `value()`? --- Cheers, Benno