mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Boqun Feng <boqun.feng@gmail.com>
To: Wedson Almeida Filho <wedsonaf@gmail.com>
Cc: "Christina Quast" <contact@christina-quast.de>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Alex Gaynor" <alex.gaynor@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <benno.lossin@proton.me>,
	"Andreas Hindborg" <a.hindborg@samsung.com>,
	"Alice Ryhl" <aliceryhl@google.com>,
	rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rust: prelude: add bit function
Date: Tue, 30 Jan 2024 12:05:47 -0800	[thread overview]
Message-ID: <ZblWm9hklyd71aaj@boqun-archlinux> (raw)
In-Reply-To: <CANeycqror72LmGW2NVL3+Yk+GAx+i-9FdS3GxNmW8sXxSeHFig@mail.gmail.com>

On Tue, Jan 30, 2024 at 05:04:15PM -0300, Wedson Almeida Filho wrote:
> On Tue, 30 Jan 2024 at 16:48, Christina Quast
> <contact@christina-quast.de> wrote:
> >
> > In order to create masks easily, the define BIT() is used in C code.
> > This commit adds the same functionality to the rust kernel.
> 
> The `rust` branch has a generic `bit` function that allows the
> returned bit to be used with or converted to several numeric types.
> 
> https://github.com/Rust-for-Linux/linux/blob/rust/rust/kernel/types.rs#L344

Plus, I think it's better to put the implementation at somewhere like:

	kernel::type::bitops

Of course, it's OK to prelude it, but we shouldn't put implementation in
prelude.rs

Regards,
Boqun

  reply	other threads:[~2024-01-30 20:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-30 19:47 Christina Quast
2024-01-30 19:59 ` Carlos Bilbao
2024-01-30 20:04 ` Wedson Almeida Filho
2024-01-30 20:05   ` Boqun Feng [this message]
2024-01-30 20:10 ` Miguel Ojeda

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=ZblWm9hklyd71aaj@boqun-archlinux \
    --to=boqun.feng@gmail.com \
    --cc=a.hindborg@samsung.com \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=benno.lossin@proton.me \
    --cc=bjorn3_gh@protonmail.com \
    --cc=contact@christina-quast.de \
    --cc=gary@garyguo.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=wedsonaf@gmail.com \
    /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®