2022-06-09 21:08:36

by Alejandro Tafalla

[permalink] [raw]
Subject: [PATCH] arm64/sysreg: Fix typo in Enum element regex

In the awk script, there was a typo with the comparison operator when
checking if the matched pattern is inside an Enum block.
This prevented the generation of the whole sysreg-defs.h header.

Fixes: 66847e0618d7 ("arm64: Add sysreg header generation scripting")
Signed-off-by: Alejandro Tafalla <[email protected]>
---
arch/arm64/tools/gen-sysreg.awk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/tools/gen-sysreg.awk b/arch/arm64/tools/gen-sysreg.awk
index 89bfb74e28de..5c55509eb43f 100755
--- a/arch/arm64/tools/gen-sysreg.awk
+++ b/arch/arm64/tools/gen-sysreg.awk
@@ -253,7 +253,7 @@ END {
next
}

-/0b[01]+/ && block = "Enum" {
+/0b[01]+/ && block == "Enum" {
expect_fields(2)
val = $1
name = $2
--
2.36.1


2022-06-10 10:09:01

by Catalin Marinas

[permalink] [raw]
Subject: Re: [PATCH] arm64/sysreg: Fix typo in Enum element regex

On Thu, Jun 09, 2022 at 10:42:18PM +0200, Alejandro Tafalla wrote:
> In the awk script, there was a typo with the comparison operator when
> checking if the matched pattern is inside an Enum block.
> This prevented the generation of the whole sysreg-defs.h header.
>
> Fixes: 66847e0618d7 ("arm64: Add sysreg header generation scripting")
> Signed-off-by: Alejandro Tafalla <[email protected]>
> ---
> arch/arm64/tools/gen-sysreg.awk | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/tools/gen-sysreg.awk b/arch/arm64/tools/gen-sysreg.awk
> index 89bfb74e28de..5c55509eb43f 100755
> --- a/arch/arm64/tools/gen-sysreg.awk
> +++ b/arch/arm64/tools/gen-sysreg.awk
> @@ -253,7 +253,7 @@ END {
> next
> }
>
> -/0b[01]+/ && block = "Enum" {
> +/0b[01]+/ && block == "Enum" {

This makes sense but I'm surprised that we haven't noticed it until now
(maybe some awk versions treat it as a relational operator).

--
Catalin

2022-06-10 11:55:55

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH] arm64/sysreg: Fix typo in Enum element regex

On Fri, Jun 10, 2022 at 10:15:04AM +0100, Catalin Marinas wrote:
> On Thu, Jun 09, 2022 at 10:42:18PM +0200, Alejandro Tafalla wrote:

> > In the awk script, there was a typo with the comparison operator when
> > checking if the matched pattern is inside an Enum block.
> > This prevented the generation of the whole sysreg-defs.h header.

> > -/0b[01]+/ && block = "Enum" {
> > +/0b[01]+/ && block == "Enum" {

> This makes sense but I'm surprised that we haven't noticed it until now
> (maybe some awk versions treat it as a relational operator).

What Catlain said - if we weren't generating the full header contents
I'd expect things to fail to build normally, but it's entirely possible
this is just happening to work with some implementations and the patch
is clearly correct.

Reviewed-by: Mark Brown <[email protected]>


Attachments:
(No filename) (848.00 B)
signature.asc (499.00 B)
Download all attachments

2022-06-10 13:08:56

by Alejandro Tafalla

[permalink] [raw]
Subject: Re: [PATCH] arm64/sysreg: Fix typo in Enum element regex

On viernes, 10 de junio de 2022 13:19:50 (CEST) Mark Brown wrote:
> On Fri, Jun 10, 2022 at 10:15:04AM +0100, Catalin Marinas wrote:
> > On Thu, Jun 09, 2022 at 10:42:18PM +0200, Alejandro Tafalla wrote:
> > > In the awk script, there was a typo with the comparison operator when
> > > checking if the matched pattern is inside an Enum block.
> > > This prevented the generation of the whole sysreg-defs.h header.
> > >
> > > -/0b[01]+/ && block = "Enum" {
> > > +/0b[01]+/ && block == "Enum" {
> >
> > This makes sense but I'm surprised that we haven't noticed it until now
> > (maybe some awk versions treat it as a relational operator).
>
> What Catlain said - if we weren't generating the full header contents
> I'd expect things to fail to build normally, but it's entirely possible
> this is just happening to work with some implementations and the patch
> is clearly correct.
>
> Reviewed-by: Mark Brown <[email protected]>

Hi Mark, thanks for your review.

Indeed, I'm building the kernel in Alpine, which uses Busybox instead of gawk.



2022-06-10 16:47:08

by Catalin Marinas

[permalink] [raw]
Subject: Re: [PATCH] arm64/sysreg: Fix typo in Enum element regex

On Thu, 9 Jun 2022 22:42:18 +0200, Alejandro Tafalla wrote:
> In the awk script, there was a typo with the comparison operator when
> checking if the matched pattern is inside an Enum block.
> This prevented the generation of the whole sysreg-defs.h header.
>
>

Applied to arm64 (for-next/fixes), thanks!

[1/1] arm64/sysreg: Fix typo in Enum element regex
https://git.kernel.org/arm64/c/ce253b8573ce

--
Catalin