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 344AE1DFCE; Mon, 30 Jun 2025 12:23:26 +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=1751286207; cv=none; b=Zll6GPMEfcJu82yoH3o4kSt0UwX5qICKsLCRzC6NEza732G68QOQqLROzkEaPmBcBsPReM6SgaGuVE6xl4IShU5K17552q7KCjS2WxA72nhAkHQxfo02DxT31a4FL4eYtSswaPNP62cobxbHnZHBb4zNSPwbs2gJRCPb3gNzTuo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751286207; c=relaxed/simple; bh=PS22i7SSq5dvjKK9kqPLGugkmvSLjA3uIWk/TfpI6+s=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=DrEvEXvA8m8V7tzfLLsY0SDZYYDzHH0fQ5mtvJTxWyVzhvgwwSwH+OTeCOGt9bzyD7+gWB89NOAjs6KvaGGNumz5PUHxwC+mGMJ/xvLEQJtPYVH/qq2Hg5dmN8b8n6F062wSnjfreFP8TMSYNrqvL3R4GzIcFhIi6I6sqopJpTg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PC2Q2JTa; 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="PC2Q2JTa" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1B48C4CEF0; Mon, 30 Jun 2025 12:23:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1751286206; bh=PS22i7SSq5dvjKK9kqPLGugkmvSLjA3uIWk/TfpI6+s=; h=Date:Subject:From:To:Cc:References:In-Reply-To:From; b=PC2Q2JTaWrwuwnEZc5zvBipv7uLyiQ8W20zWwiaXI38LGaEBDhLSGdmIv2pkY519t jr9Cr0rF368Vx4ybcxGZ5EkXr4o40AuCeGqvBm2PF9eAZuu/5QAqS6jS/seBi+EIPq DDZ6oweF25cigi2mmS8iZXS3gHC6/NXIQT85B/FflTmQjz33M59DlwqA/vksGRNC+H pGar6U0mZYGOI6bepenKp+pkgyMrRTOZ26Qx3ZYyZv4LxnWt2CAozIyc5fzm5TN8L+ 4Gi+84LOrN+ZP/YcyFE5UAz3Dl4znpK+xt9WPJbbAg+aYz5fxo1PS5ztkWMbfDqRE9 MPgEPnQkfj/Xw== Message-ID: Date: Mon, 30 Jun 2025 14:23:20 +0200 Precedence: bulk X-Mailing-List: linux-modules@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v13 5/6] rust: samples: add a module parameter to the rust_minimal sample From: Danilo Krummrich To: Andreas Hindborg 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 , Benno Lossin , Nicolas Schier , Trevor Gross , Adam Bratschi-Kaye , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, Petr Pavlu , Sami Tolvanen , Daniel Gomez , Simona Vetter , Greg KH , Fiona Behrens , Daniel Almeida , linux-modules@vger.kernel.org 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> Content-Language: en-US In-Reply-To: <211a3491-7082-488a-b744-fa7416db18c3@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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: >>>>    struct RustMinimal { >>>> @@ -20,6 +26,10 @@ impl kernel::Module for RustMinimal { >>>>        fn init(_module: &'static ThisModule) -> Result { >>>>            pr_info!("Rust minimal sample (init)\n"); >>>>            pr_info!("Am I built-in? {}\n", !cfg!(MODULE)); >>>> +        pr_info!( >>>> +            "test_parameter: {}\n", >>>> +            *module_parameters::test_parameter.get() >>> >>> Can we please call it something else than get(), maybe obtain(), access() 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`? > > Guess that works as well. > > 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 this will apparently require some lock guard? Then maybe access() describes it best?