mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Almeida <daniel.almeida@collabora.com>
To: Andreas Hindborg <a.hindborg@kernel.org>
Cc: "Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Andreas Hindborg" <a.hindborg@kernel.org>
Subject: Re: [PATCH] rust: impl_flags: add method to return underlying integer
Date: Thu, 12 Feb 2026 13:53:05 -0300	[thread overview]
Message-ID: <C6A3F9D2-1FA1-42DB-9587-206A092ACF84@collabora.com> (raw)
In-Reply-To: <20260212-impl-flags-inner-v1-1-1e2edc96e470@kernel.org>




> On 12 Feb 2026, at 13:03, Andreas Hindborg <a.hindborg@kernel.org> wrote:
> 
> Add a method to return the underlying integer used for flags. This is
> useful when using the flags with C APIs.
> 
> Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org>
> ---
> rust/kernel/impl_flags.rs | 6 ++++++
> 1 file changed, 6 insertions(+)
> 
> diff --git a/rust/kernel/impl_flags.rs b/rust/kernel/impl_flags.rs
> index e2bd7639da12e..951598497de1d 100644
> --- a/rust/kernel/impl_flags.rs
> +++ b/rust/kernel/impl_flags.rs
> @@ -267,6 +267,12 @@ pub fn contains_any(self, flags: $flags) -> bool {
>             pub fn contains_all(self, flags: $flags) -> bool {
>                 (self.0 & flags.0) == flags.0
>             }
> +
> +            /// Return a copy of the inner representation of the flags.
> +            #[inline]
> +            pub fn into_inner(self) -> $ty {
> +                self.0
> +            }
>         }
>     };
> }
> 
> ---
> base-commit: b8d687c7eeb52d0353ac27c4f71594a2e6aa365f
> change-id: 20260212-impl-flags-inner-c61974b27b18
> 
> Best regards,
> --
> Andreas Hindborg <a.hindborg@kernel.org>
> 
> 
> 

Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>

  reply	other threads:[~2026-02-12 16:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-12 16:02 Andreas Hindborg
2026-02-12 16:53 ` Daniel Almeida [this message]
2026-02-14  0:13 ` Gary Guo
2026-02-14  8:02   ` Andreas Hindborg
2026-02-14  9:36     ` Gary Guo
2026-02-14 11:24       ` Andreas Hindborg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C6A3F9D2-1FA1-42DB-9587-206A092ACF84@collabora.com \
    --to=daniel.almeida@collabora.com \
    --cc=a.hindborg@kernel.org \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®