2023-05-17 10:25:23

by Prathu Baronia

[permalink] [raw]
Subject: [PATCH] arm64/cpucaps: increase string width to properly format cpucaps.h

The lengthiest capability is `WORKAROUND_TRBE_OVERWRITE_FILL_MODE` and
its length is 35 characters so increase the width of left justified
strings to 35 and adjust the tab space for `ARM64_NCAPS` accordingly.
Now the generated cpucaps.h is properly formatted.

Signed-off-by: Prathu Baronia <[email protected]>
---
arch/arm64/tools/gen-cpucaps.awk | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/tools/gen-cpucaps.awk b/arch/arm64/tools/gen-cpucaps.awk
index 00c9e72a200a..1e6167be4052 100755
--- a/arch/arm64/tools/gen-cpucaps.awk
+++ b/arch/arm64/tools/gen-cpucaps.awk
@@ -24,12 +24,12 @@ BEGIN {
}

/^[vA-Z0-9_]+$/ {
- printf("#define ARM64_%-30s\t%d\n", $0, cap_num++)
+ printf("#define ARM64_%-35s\t%d\n", $0, cap_num++)
next
}

END {
- printf("#define ARM64_NCAPS\t\t\t\t%d\n", cap_num)
+ printf("#define ARM64_NCAPS\t\t\t\t\t%d\n", cap_num)
print ""
print "#endif /* __ASM_CPUCAPS_H */"
}
--
2.25.1



2023-05-26 09:39:00

by Catalin Marinas

[permalink] [raw]
Subject: Re: [PATCH] arm64/cpucaps: increase string width to properly format cpucaps.h

On Wed, May 17, 2023 at 03:34:50PM +0530, Prathu Baronia wrote:
> The lengthiest capability is `WORKAROUND_TRBE_OVERWRITE_FILL_MODE` and
> its length is 35 characters so increase the width of left justified
> strings to 35 and adjust the tab space for `ARM64_NCAPS` accordingly.
> Now the generated cpucaps.h is properly formatted.
>
> Signed-off-by: Prathu Baronia <[email protected]>

Why not make it larger, say 40, just in case.

--
Catalin

2023-05-27 13:00:27

by Prathu Baronia

[permalink] [raw]
Subject: Re: [PATCH] arm64/cpucaps: increase string width to properly format cpucaps.h

On Fri, May 26, 2023 at 10:28:22AM +0100, Catalin Marinas wrote:
> Why not make it larger, say 40, just in case.
Sure Catalin, will do in v2.

Prathu