lkml.org 
[lkml]   [2026]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [RFC v3 13/27] lib: rspdm: Support SPDM get_capabilities
On Tue, Mar 3, 2026 at 1:09 PM Jonathan Cameron
<jonathan.cameron@huawei.com> wrote:
>
> Can we use bit_u32() or similar here?
> We've tried to move to BIT() for similar defines in the C code, so I'm
> looking for something along those lines. Provides a form of documentation
> that they are single bit fields.

We have these so far:

https://rust.docs.kernel.org/kernel/bits/

Out-of-tree long ago we had also a `bit<T>` generic const function
(https://github.com/Rust-for-Linux/linux/blob/rust/rust/kernel/types.rs#L317-L349).
I think we also discussed a `bit!` macro at some point.

> This is why I was getting bit grumpy in previous about long lines.
> Fair enough if this is only option, but it's not nice for a review process
> that relies on patches!

This should be using the kernel imports style, which should make a
case like this more readable:

https://docs.kernel.org/rust/coding-guidelines.html#imports

I hope that helps!

Cheers,
Miguel

\
 
 \ /
  Last update: 2026-03-03 19:12    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog