[PATCH v13 2/5] rust: support formatting of foreign types
Miguel Ojeda
miguel.ojeda.sandonis at gmail.com
Fri Jul 4 08:40:43 UTC 2025
On Fri, Jul 4, 2025 at 12:46 AM Tamir Duberstein <tamird at gmail.com> wrote:
>
> There's also a tactical question about splitting by subsystem: are
> there any tools that would assist in doing this, or is it a matter of
> manually consulting MAINTAINERS to figure out file groupings?
As Andrew mentioned, you can use that script, though I recommend not
fully/blindly trusting it.
Sometimes you will want to adjust things, e.g. sometimes things may be
related even if in a couple different `MAINTAINERS` entries, or you
may want to adjust the flags the script provides to filter, or you may
want to check `git log --no-merges` to see who is recently applying
patches related to that area, etc.
It is essentially the same process as when you send patches.
For instance, taking the diffstat above, and ignoring contents (i.e.
assuming all lines could just be freely split and without considering
other splits discussed to make the patches smaller first and reducing
the flag day changes), I could have done something like this:
drivers/block/rnull.rs | 2 +-
rust/kernel/block/mq.rs | 2 +-
drivers/gpu/nova-core/gpu.rs | 4 +-
rust/kernel/device.rs | 2 +-
rust/kernel/kunit.rs | 6 +--
rust/kernel/seq_file.rs | 2 +-
rust/kernel/fmt.rs | 89 +++++++++++++++++++++++++++++++++++++++
rust/kernel/lib.rs | 1 +
rust/kernel/prelude.rs | 3 +-
rust/kernel/print.rs | 4 +-
rust/kernel/str.rs | 22 ++++------
rust/macros/fmt.rs | 99
++++++++++++++++++++++++++++++++++++++++++++
rust/macros/lib.rs | 19 +++++++++
rust/macros/quote.rs | 7 ++++
scripts/rustdoc_test_gen.rs | 2 +-
And then those long lines may hint that it may make sense to split the
smaller tweaks in the last group into their own patch, so that it
mirrors what is done for the other smaller groups. Thus possibly
leaving the feature being added into its own patch, which would be the
biggest and the one that would take some discussion. And the others
would be the small ones that are easy to Acked-by or Reviewed-by or
simply take (if independently possible) by other maintainers.
And so on -- again, this is speaking generally, and it is just a dummy
example, not intended to say anything about the current patch. And
sometimes things may not make sense to split too far, and it can be
more annoying than it is worth for everyone involved, e.g. when we are
talking about trivial conversions that could take 50+ patches that
could be automated instead and then applied by a single maintainer.
So it is a balance.
Cheers,
Miguel
More information about the dri-devel
mailing list