Re: [PATCH RFC WIP] bitflag_options macro_rules implementation
From: Timothy Garwood
Date: Sat Jan 25 2025 - 15:52:10 EST
Hi Miguel,
> The kernel requires a "known identity" for signatures. For instance,
> the name you use to sign documents in real life.
Will do. I value anonymity, but its not hard to figure out who I am with the
info I have already given, so not really anonymous :) I'll update my name.
> The docs/examples you wrote are very nice, but typically you also want
> to showcase an actual use case within the kernel. You can do that, for
> instance, in a separate patch that does it for hrtimer or something
> else (even if it may not be intended for merge).
>
> This can also allow reviewers and potential users to give suggestions
> and to guide the design.
Ok, I already have hrtimer somewhere (or I'll remake it quickly), I'll make
another patch. which will depend on this one.
> > + /// The bitfield type, usually [u8] or [u32]
>
>
> There are some nits with formatting which are non-important at this
> stage, but please try to follow a consistent style with other files.
> For instance, we try to use intra-doc links and code spans where
> possible, avoid double blank lines, etc.
Ok. I will check the other files and be extra attentive inside any macro since
the formatter usually doesn't work there.
> I also noticed a couple typos -- I usually recommend using at least
> `--codespell` in `scripts/checkpatch.pl`.
Will do. Just fixed my codespell (did not find the dictionary), I see I indeed
misspelled a few things.
> For macros, it can be a good idea to showcase how the generated code
> for a simple case would look like. It is painful sometimes to maintain
> that over time, but it can really help others understand what the
> macro does from another perspective.
>
> This one can also help reviewers and to guide the design, similar to
> the doc suggestion above.
Makes sense. I will expand the macro in the example.
> Cheers,
> Miguel
Thank you for your feedback,
Timothy