All of lore.kernel.org
 help / color / mirror / Atom feed
* [XEN PATCH] xen: fix header guard generation for asm-generic headers
@ 2025-06-21  9:58 Nicola Vetrini
  2025-06-21 17:55 ` Stefano Stabellini
  2025-06-23  7:51 ` Jan Beulich
  0 siblings, 2 replies; 5+ messages in thread
From: Nicola Vetrini @ 2025-06-21  9:58 UTC (permalink / raw)
  To: xen-devel
  Cc: sstabellini, michal.orzel, xenia.ragiadakou, ayan.kumar.halder,
	consulting, Nicola Vetrini, Andrew Cooper, Anthony PERARD,
	Jan Beulich, Julien Grall, Roger Pau Monné

Dashes were wrongly not translated into underscores, thus generating
an unexpected guard identifier.

Fixes: ee79f378311b ("xen: add header guards to generated asm generic headers")
Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 xen/scripts/Makefile.asm-generic | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/scripts/Makefile.asm-generic b/xen/scripts/Makefile.asm-generic
index b0828018080d..f6850758c54b 100644
--- a/xen/scripts/Makefile.asm-generic
+++ b/xen/scripts/Makefile.asm-generic
@@ -34,7 +34,7 @@ unwanted    := $(filter-out $(generic-y) $(generated-y),$(old-headers))
 quiet_cmd_wrap = WRAP    $@
       cmd_wrap = \
 	arch=$$(echo $@ | sed -n 's:.*arch/\([^/]*\)/.*:\1:p' | tr a-z A-Z); \
-	upper=$$(echo $*.h | tr a-z A-Z | tr '/.' '__'); \
+	upper=$$(echo $*.h | tr a-z A-Z | tr '/.-' '__'); \
 	echo "\#ifndef $${arch}_GENERIC_$${upper}" > $@.new; \
 	echo "\#define $${arch}_GENERIC_$${upper}" >> $@.new; \
 	echo "\#include <asm-generic/$*.h>" >> $@.new; \
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [XEN PATCH] xen: fix header guard generation for asm-generic headers
  2025-06-21  9:58 [XEN PATCH] xen: fix header guard generation for asm-generic headers Nicola Vetrini
@ 2025-06-21 17:55 ` Stefano Stabellini
  2025-06-23  7:51 ` Jan Beulich
  1 sibling, 0 replies; 5+ messages in thread
From: Stefano Stabellini @ 2025-06-21 17:55 UTC (permalink / raw)
  To: Nicola Vetrini
  Cc: xen-devel, sstabellini, michal.orzel, xenia.ragiadakou,
	ayan.kumar.halder, consulting, Andrew Cooper, Anthony PERARD,
	Jan Beulich, Julien Grall, Roger Pau Monné

On Sat, 21 Jun 2025, Nicola Vetrini wrote:
> Dashes were wrongly not translated into underscores, thus generating
> an unexpected guard identifier.
> 
> Fixes: ee79f378311b ("xen: add header guards to generated asm generic headers")
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>


Thank you so much for the quick fix!!

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>



> ---
>  xen/scripts/Makefile.asm-generic | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/scripts/Makefile.asm-generic b/xen/scripts/Makefile.asm-generic
> index b0828018080d..f6850758c54b 100644
> --- a/xen/scripts/Makefile.asm-generic
> +++ b/xen/scripts/Makefile.asm-generic
> @@ -34,7 +34,7 @@ unwanted    := $(filter-out $(generic-y) $(generated-y),$(old-headers))
>  quiet_cmd_wrap = WRAP    $@
>        cmd_wrap = \
>  	arch=$$(echo $@ | sed -n 's:.*arch/\([^/]*\)/.*:\1:p' | tr a-z A-Z); \
> -	upper=$$(echo $*.h | tr a-z A-Z | tr '/.' '__'); \
> +	upper=$$(echo $*.h | tr a-z A-Z | tr '/.-' '__'); \
>  	echo "\#ifndef $${arch}_GENERIC_$${upper}" > $@.new; \
>  	echo "\#define $${arch}_GENERIC_$${upper}" >> $@.new; \
>  	echo "\#include <asm-generic/$*.h>" >> $@.new; \
> -- 
> 2.43.0
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [XEN PATCH] xen: fix header guard generation for asm-generic headers
  2025-06-21  9:58 [XEN PATCH] xen: fix header guard generation for asm-generic headers Nicola Vetrini
  2025-06-21 17:55 ` Stefano Stabellini
@ 2025-06-23  7:51 ` Jan Beulich
  2025-06-23  8:20   ` Jan Beulich
  1 sibling, 1 reply; 5+ messages in thread
From: Jan Beulich @ 2025-06-23  7:51 UTC (permalink / raw)
  To: Nicola Vetrini
  Cc: sstabellini, michal.orzel, xenia.ragiadakou, ayan.kumar.halder,
	consulting, Andrew Cooper, Anthony PERARD, Julien Grall,
	Roger Pau Monné, xen-devel

On 21.06.2025 11:58, Nicola Vetrini wrote:
> Dashes were wrongly not translated into underscores, thus generating
> an unexpected guard identifier.
> 
> Fixes: ee79f378311b ("xen: add header guards to generated asm generic headers")
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> ---
>  xen/scripts/Makefile.asm-generic | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/scripts/Makefile.asm-generic b/xen/scripts/Makefile.asm-generic
> index b0828018080d..f6850758c54b 100644
> --- a/xen/scripts/Makefile.asm-generic
> +++ b/xen/scripts/Makefile.asm-generic
> @@ -34,7 +34,7 @@ unwanted    := $(filter-out $(generic-y) $(generated-y),$(old-headers))
>  quiet_cmd_wrap = WRAP    $@
>        cmd_wrap = \
>  	arch=$$(echo $@ | sed -n 's:.*arch/\([^/]*\)/.*:\1:p' | tr a-z A-Z); \
> -	upper=$$(echo $*.h | tr a-z A-Z | tr '/.' '__'); \
> +	upper=$$(echo $*.h | tr a-z A-Z | tr '/.-' '__'); \

Aiui the other argument also needs to change, to '___'. While some tr implementations
may cope, the spec is quite clear:

"When the -d option is not specified:

    Each input character found in the array specified by string1 shall be replaced by the character in the same relative position in the array specified by string2. When the array specified by string2 is shorter that the one specified by string1, the results are unspecified."

Easy enough to adjust while committing, I suppose.

Jan


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [XEN PATCH] xen: fix header guard generation for asm-generic headers
  2025-06-23  7:51 ` Jan Beulich
@ 2025-06-23  8:20   ` Jan Beulich
  2025-06-23  8:41     ` Nicola Vetrini
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Beulich @ 2025-06-23  8:20 UTC (permalink / raw)
  To: Nicola Vetrini, sstabellini
  Cc: michal.orzel, xenia.ragiadakou, ayan.kumar.halder, consulting,
	Andrew Cooper, Anthony PERARD, Julien Grall, Roger Pau Monné,
	xen-devel

On 23.06.2025 09:51, Jan Beulich wrote:
> On 21.06.2025 11:58, Nicola Vetrini wrote:
>> Dashes were wrongly not translated into underscores, thus generating
>> an unexpected guard identifier.
>>
>> Fixes: ee79f378311b ("xen: add header guards to generated asm generic headers")
>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>> ---
>>  xen/scripts/Makefile.asm-generic | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/xen/scripts/Makefile.asm-generic b/xen/scripts/Makefile.asm-generic
>> index b0828018080d..f6850758c54b 100644
>> --- a/xen/scripts/Makefile.asm-generic
>> +++ b/xen/scripts/Makefile.asm-generic
>> @@ -34,7 +34,7 @@ unwanted    := $(filter-out $(generic-y) $(generated-y),$(old-headers))
>>  quiet_cmd_wrap = WRAP    $@
>>        cmd_wrap = \
>>  	arch=$$(echo $@ | sed -n 's:.*arch/\([^/]*\)/.*:\1:p' | tr a-z A-Z); \
>> -	upper=$$(echo $*.h | tr a-z A-Z | tr '/.' '__'); \
>> +	upper=$$(echo $*.h | tr a-z A-Z | tr '/.-' '__'); \
> 
> Aiui the other argument also needs to change, to '___'. While some tr implementations
> may cope, the spec is quite clear:
> 
> "When the -d option is not specified:
> 
>     Each input character found in the array specified by string1 shall be replaced by the character in the same relative position in the array specified by string2. When the array specified by string2 is shorter that the one specified by string1, the results are unspecified."
> 
> Easy enough to adjust while committing, I suppose.

Except that I notice that this was committed already. Will require another
fixup then, I expect.

Jan


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [XEN PATCH] xen: fix header guard generation for asm-generic headers
  2025-06-23  8:20   ` Jan Beulich
@ 2025-06-23  8:41     ` Nicola Vetrini
  0 siblings, 0 replies; 5+ messages in thread
From: Nicola Vetrini @ 2025-06-23  8:41 UTC (permalink / raw)
  To: Jan Beulich
  Cc: sstabellini, michal.orzel, xenia.ragiadakou, ayan.kumar.halder,
	consulting, Andrew Cooper, Anthony PERARD, Julien Grall,
	Roger Pau Monné, xen-devel

On 2025-06-23 10:20, Jan Beulich wrote:
> On 23.06.2025 09:51, Jan Beulich wrote:
>> On 21.06.2025 11:58, Nicola Vetrini wrote:
>>> Dashes were wrongly not translated into underscores, thus generating
>>> an unexpected guard identifier.
>>> 
>>> Fixes: ee79f378311b ("xen: add header guards to generated asm generic 
>>> headers")
>>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>>> ---
>>>  xen/scripts/Makefile.asm-generic | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>> 
>>> diff --git a/xen/scripts/Makefile.asm-generic 
>>> b/xen/scripts/Makefile.asm-generic
>>> index b0828018080d..f6850758c54b 100644
>>> --- a/xen/scripts/Makefile.asm-generic
>>> +++ b/xen/scripts/Makefile.asm-generic
>>> @@ -34,7 +34,7 @@ unwanted    := $(filter-out $(generic-y) 
>>> $(generated-y),$(old-headers))
>>>  quiet_cmd_wrap = WRAP    $@
>>>        cmd_wrap = \
>>>  	arch=$$(echo $@ | sed -n 's:.*arch/\([^/]*\)/.*:\1:p' | tr a-z 
>>> A-Z); \
>>> -	upper=$$(echo $*.h | tr a-z A-Z | tr '/.' '__'); \
>>> +	upper=$$(echo $*.h | tr a-z A-Z | tr '/.-' '__'); \
>> 
>> Aiui the other argument also needs to change, to '___'. While some tr 
>> implementations
>> may cope, the spec is quite clear:
>> 
>> "When the -d option is not specified:
>> 
>>     Each input character found in the array specified by string1 shall 
>> be replaced by the character in the same relative position in the 
>> array specified by string2. When the array specified by string2 is 
>> shorter that the one specified by string1, the results are 
>> unspecified."
>> 
>> Easy enough to adjust while committing, I suppose.
> 
> Except that I notice that this was committed already. Will require 
> another
> fixup then, I expect.
> 
> Jan

My bad, GNU tr seems to cope just fine (i tested running on all Xen 
headers) but another fixup is in order.

-- 
Nicola Vetrini, B.Sc.
Software Engineer
BUGSENG (https://bugseng.com)
LinkedIn: https://www.linkedin.com/in/nicola-vetrini-a42471253


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-06-23  8:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-21  9:58 [XEN PATCH] xen: fix header guard generation for asm-generic headers Nicola Vetrini
2025-06-21 17:55 ` Stefano Stabellini
2025-06-23  7:51 ` Jan Beulich
2025-06-23  8:20   ` Jan Beulich
2025-06-23  8:41     ` Nicola Vetrini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.