Hi
On 12.02.25 11:14, Roger Pau Monné wrote:
On Tue, Feb 11, 2025 at 02:33:08PM -0800, Stefano Stabellini wrote:
Hi Oleksandr,
This morning, we had a discussion among maintainers, and the suggested
approach moving forward is as follows:
- First, it would be helpful to see a sample of the proposed changes
applied to a single source file as an example. If you could provide
such a patch, it would help advance the discussion.
- If the changes are acceptable, we need to properly document the new
coding style in xen.git. If not, we will need to iterate again. We may
also need to add a "xen" template to clang-format.
- Once finalized, we will proceed by making changes to the Xen source
code piece by piece, as you suggested, rather than applying a single
large patch.
No objections, just wandering myself whether it was considered to
initially only apply the new style to new chunks of code? Using
`git-clang-format` or similar as suggested by Anthony.
Is the adjusted style expected to be too different from the current
one as such approach would lead to hard to read code due to the mixed
styles?
Sorry for may be dumb question, but wouldn't it be reasonable to consider
adding just .clang-format specification to the Xen code base without
automation features?
For example, I've downloaded .clang-format from [1] and using it with my editor
which supports clang-format integration. So, I can just select chunk of code and
do auto-format on it. It speed ups my work very much and results make me happy
more
than 90% of the times.
So, it would be nice to have it out of the box while cloning Xen code instead
of searching for it, even if it's not perfect for now.
Unhappy: it's probably "known" things - identification of complex defines and
static struct/arrays declarations.
For example original code:
DT_DEVICE_START(ipmmu, "Renesas IPMMU-VMSA", DEVICE_IOMMU)
.dt_match = ipmmu_dt_match,
.init = ipmmu_init,
DT_DEVICE_END
And after auto format (me, personally, unhappy):
DT_DEVICE_START(ipmmu, "Renesas IPMMU-VMSA", DEVICE_IOMMU)
.dt_match = ipmmu_dt_match, .init = ipmmu_init,
DT_DEVICE_END
Best regards,
-grygorii