Skip to content

[5.75/10] libs/libc/machine/arm: Fix the nxstyle errors in arch_elf.c. - #20026

Open
casaroli wants to merge 1 commit into
apache:masterfrom
casaroli:fdpic-arch-elf-style
Open

[5.75/10] libs/libc/machine/arm: Fix the nxstyle errors in arch_elf.c.#20026
casaroli wants to merge 1 commit into
apache:masterfrom
casaroli:fdpic-arch-elf-style

Conversation

@casaroli

Copy link
Copy Markdown
Contributor

Summary

Part 5.75 of the split of #19673, and only formatting.

libs/libc/machine/arm/armv7-m/arch_elf.c and its armv8-m twin put the body of the relocation switch at the same indent as the switch braces. nxstyle reports forty-four errors in each:

$ tools/nxstyle libs/libc/machine/arm/armv7-m/arch_elf.c | wc -l
44

CI feeds nxstyle the diff hunks with three lines of context, so any patch whose hunks land near them fails the check job through no fault of its own. [6/10] adds the R_ARM_FUNCDESC cases to those switches, so its hunks land throughout. This clears the way rather than making that PR carry the reformat.

Giving the switch body its level takes the bit diagrams in the comments one column past the line limit. Three things follow from that:

  • the bit rulers say Instr rather than Instructions, which is enough and is what the same rulers further down the file already do
  • one annotation that had no code on its line becomes a sentence of its own, since nxstyle wants a blank line before a standalone comment
  • two comments that were a column out of line before are put right

Impact

None. Whitespace and comments.

Testing

Both files are clean afterwards:

$ tools/nxstyle libs/libc/machine/arm/armv7-m/arch_elf.c
$ tools/nxstyle libs/libc/machine/arm/armv8-m/arch_elf.c

Compiled each file before and after, for cortex-m7 and cortex-m33, and compared the disassembly:

armv7-m: disassembly identical
armv8-m: disassembly identical

mps3-an547:picostest builds. tools/checkpatch.sh -c -u -m -g passes.

Both files put the body of the relocation switch at the same indent as the
switch braces, so nxstyle reports forty-four errors in each and any patch
whose hunks land near them fails the check job.

Giving the body its level takes the bit diagrams in the comments one column
past the line limit.  The rulers say Instr rather than Instructions, which is
enough and is what the same rulers further down already do.  A comment that
had no code on its line becomes a sentence of its own, and two that were a
column out are put right.

Whitespace and comments only.  Compiled before and after for cortex-m7 and
cortex-m33: the disassembly is identical.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
@github-actions github-actions Bot added Area: OS Components OS Components issues Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces. labels Aug 31, 2026
@casaroli
casaroli marked this pull request as ready for review August 31, 2026 20:27
@github-actions

Copy link
Copy Markdown

MemBrowse Memory Report

No memory changes detected for:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: OS Components OS Components issues Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants