diff mbox series

[v2] asm-generic: Fix unistd_32.h generation format

Message ID dcdd615f77dacf8a98e18950b66fb5a675277f38.1581498987.git.michal.simek@xilinx.com
State Not Applicable
Delegated to: David Miller
Headers show
Series [v2] asm-generic: Fix unistd_32.h generation format | expand

Commit Message

Michal Simek Feb. 12, 2020, 9:16 a.m. UTC
Generated files are also checked by sparse that's why add newline
to remove sparse (C=1) warning.

The issue was found on Microblaze and reported like this:
./arch/microblaze/include/generated/uapi/asm/unistd_32.h:438:45:
warning: no newline at end of file

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Stefan Asserhall <stefan.asserhall@xilinx.com>
---

Changes in v2:
- Update also others archs not just microblaze - Arnd
- Align subject and description to match multiarch chagne

 arch/alpha/kernel/syscalls/syscallhdr.sh      | 1 +
 arch/ia64/kernel/syscalls/syscallhdr.sh       | 1 +
 arch/m68k/kernel/syscalls/syscallhdr.sh       | 1 +
 arch/microblaze/kernel/syscalls/syscallhdr.sh | 1 +
 arch/parisc/kernel/syscalls/syscallhdr.sh     | 1 +
 arch/sh/kernel/syscalls/syscallhdr.sh         | 1 +
 arch/sparc/kernel/syscalls/syscallhdr.sh      | 1 +
 arch/xtensa/kernel/syscalls/syscallhdr.sh     | 1 +
 8 files changed, 8 insertions(+)

Comments

Geert Uytterhoeven Feb. 12, 2020, 9:23 a.m. UTC | #1
Hi Michal,

On Wed, Feb 12, 2020 at 10:16 AM Michal Simek <michal.simek@xilinx.com> wrote:
> Generated files are also checked by sparse that's why add newline
> to remove sparse (C=1) warning.
>
> The issue was found on Microblaze and reported like this:
> ./arch/microblaze/include/generated/uapi/asm/unistd_32.h:438:45:
> warning: no newline at end of file
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> Reviewed-by: Stefan Asserhall <stefan.asserhall@xilinx.com>

Thanks for your patch!

>  arch/alpha/kernel/syscalls/syscallhdr.sh      | 1 +
>  arch/ia64/kernel/syscalls/syscallhdr.sh       | 1 +
>  arch/m68k/kernel/syscalls/syscallhdr.sh       | 1 +

Bummer, I had noticed that before
https://lore.kernel.org/lkml/CAMuHMdVsBwL9vcqejfc47GN793wMXdQ=SwEsSUP1fbpMt-OoWw@mail.gmail.com/
and even claimed I fixed it while applying
https://lore.kernel.org/lkml/CAMuHMdW6JiponxLiGNEXUX4xJk3hK4b8dTOCNvVBr7s2LyfhJw@mail.gmail.com/
but something must have gone wrong...

>  arch/microblaze/kernel/syscalls/syscallhdr.sh | 1 +
>  arch/parisc/kernel/syscalls/syscallhdr.sh     | 1 +
>  arch/sh/kernel/syscalls/syscallhdr.sh         | 1 +
>  arch/sparc/kernel/syscalls/syscallhdr.sh      | 1 +
>  arch/xtensa/kernel/syscalls/syscallhdr.sh     | 1 +
>  8 files changed, 8 insertions(+)
>
> diff --git a/arch/alpha/kernel/syscalls/syscallhdr.sh b/arch/alpha/kernel/syscalls/syscallhdr.sh
> index e5b99bd2e5e7..524c69fbcab7 100644
> --- a/arch/alpha/kernel/syscalls/syscallhdr.sh
> +++ b/arch/alpha/kernel/syscalls/syscallhdr.sh
> @@ -33,4 +33,5 @@ grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | (
>         printf "#endif\n"
>         printf "\n"
>         printf "#endif /* %s */" "${fileguard}"
> +       printf "\n"

Why not add the "\n" to the end of the previous line?

Anyway,
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>

Gr{oetje,eeting}s,

                        Geert
Max Filippov Feb. 12, 2020, 9:23 a.m. UTC | #2
On Wed, Feb 12, 2020 at 1:16 AM Michal Simek <michal.simek@xilinx.com> wrote:
>
> Generated files are also checked by sparse that's why add newline
> to remove sparse (C=1) warning.
>
> The issue was found on Microblaze and reported like this:
> ./arch/microblaze/include/generated/uapi/asm/unistd_32.h:438:45:
> warning: no newline at end of file
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> Reviewed-by: Stefan Asserhall <stefan.asserhall@xilinx.com>
> ---
>
> Changes in v2:
> - Update also others archs not just microblaze - Arnd
> - Align subject and description to match multiarch chagne
>
>  arch/alpha/kernel/syscalls/syscallhdr.sh      | 1 +
>  arch/ia64/kernel/syscalls/syscallhdr.sh       | 1 +
>  arch/m68k/kernel/syscalls/syscallhdr.sh       | 1 +
>  arch/microblaze/kernel/syscalls/syscallhdr.sh | 1 +
>  arch/parisc/kernel/syscalls/syscallhdr.sh     | 1 +
>  arch/sh/kernel/syscalls/syscallhdr.sh         | 1 +
>  arch/sparc/kernel/syscalls/syscallhdr.sh      | 1 +
>  arch/xtensa/kernel/syscalls/syscallhdr.sh     | 1 +
>  8 files changed, 8 insertions(+)

For xtensa:
Acked-by: Max Filippov <jcmvbkbc@gmail.com>

...

> diff --git a/arch/m68k/kernel/syscalls/syscallhdr.sh b/arch/m68k/kernel/syscalls/syscallhdr.sh
> index 6f357d68ef44..8ac15be01ac2 100644
> --- a/arch/m68k/kernel/syscalls/syscallhdr.sh
> +++ b/arch/m68k/kernel/syscalls/syscallhdr.sh
> @@ -33,4 +33,5 @@ grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | (
>         printf "#endif\n"
>         printf "\n"
>         printf "#endif /* %s */\n" "${fileguard}"

Here there's already \n at the end, so no need for another one?

> +       printf "\n"
>  ) > "$out"

...
Geert Uytterhoeven Feb. 12, 2020, 9:25 a.m. UTC | #3
Hi Max,

On Wed, Feb 12, 2020 at 10:23 AM Max Filippov <jcmvbkbc@gmail.com> wrote:
> On Wed, Feb 12, 2020 at 1:16 AM Michal Simek <michal.simek@xilinx.com> wrote:
> >
> > Generated files are also checked by sparse that's why add newline
> > to remove sparse (C=1) warning.
> >
> > The issue was found on Microblaze and reported like this:
> > ./arch/microblaze/include/generated/uapi/asm/unistd_32.h:438:45:
> > warning: no newline at end of file
> >
> > Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> > Reviewed-by: Stefan Asserhall <stefan.asserhall@xilinx.com>

> > --- a/arch/m68k/kernel/syscalls/syscallhdr.sh
> > +++ b/arch/m68k/kernel/syscalls/syscallhdr.sh
> > @@ -33,4 +33,5 @@ grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | (
> >         printf "#endif\n"
> >         printf "\n"
> >         printf "#endif /* %s */\n" "${fileguard}"
>
> Here there's already \n at the end, so no need for another one?

Thanks! I completely missed that.
So I did fix the original while applying ;-)

> > +       printf "\n"
> >  ) > "$out"

Gr{oetje,eeting}s,

                        Geert
Michal Simek Feb. 12, 2020, 9:26 a.m. UTC | #4
On 12. 02. 20 10:23, Max Filippov wrote:
> On Wed, Feb 12, 2020 at 1:16 AM Michal Simek <michal.simek@xilinx.com> wrote:
>>
>> Generated files are also checked by sparse that's why add newline
>> to remove sparse (C=1) warning.
>>
>> The issue was found on Microblaze and reported like this:
>> ./arch/microblaze/include/generated/uapi/asm/unistd_32.h:438:45:
>> warning: no newline at end of file
>>
>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>> Reviewed-by: Stefan Asserhall <stefan.asserhall@xilinx.com>
>> ---
>>
>> Changes in v2:
>> - Update also others archs not just microblaze - Arnd
>> - Align subject and description to match multiarch chagne
>>
>>  arch/alpha/kernel/syscalls/syscallhdr.sh      | 1 +
>>  arch/ia64/kernel/syscalls/syscallhdr.sh       | 1 +
>>  arch/m68k/kernel/syscalls/syscallhdr.sh       | 1 +
>>  arch/microblaze/kernel/syscalls/syscallhdr.sh | 1 +
>>  arch/parisc/kernel/syscalls/syscallhdr.sh     | 1 +
>>  arch/sh/kernel/syscalls/syscallhdr.sh         | 1 +
>>  arch/sparc/kernel/syscalls/syscallhdr.sh      | 1 +
>>  arch/xtensa/kernel/syscalls/syscallhdr.sh     | 1 +
>>  8 files changed, 8 insertions(+)
> 
> For xtensa:
> Acked-by: Max Filippov <jcmvbkbc@gmail.com>
> 
> ...
> 
>> diff --git a/arch/m68k/kernel/syscalls/syscallhdr.sh b/arch/m68k/kernel/syscalls/syscallhdr.sh
>> index 6f357d68ef44..8ac15be01ac2 100644
>> --- a/arch/m68k/kernel/syscalls/syscallhdr.sh
>> +++ b/arch/m68k/kernel/syscalls/syscallhdr.sh
>> @@ -33,4 +33,5 @@ grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | (
>>         printf "#endif\n"
>>         printf "\n"
>>         printf "#endif /* %s */\n" "${fileguard}"
> 
> Here there's already \n at the end, so no need for another one?

No it is not needed. But I think that make sense to have the same
solution in all these scripts. Above printf is adding newline that's why
I have used the same style.

M
Michal Simek Feb. 12, 2020, 9:27 a.m. UTC | #5
On 12. 02. 20 10:25, Geert Uytterhoeven wrote:
> Hi Max,
> 
> On Wed, Feb 12, 2020 at 10:23 AM Max Filippov <jcmvbkbc@gmail.com> wrote:
>> On Wed, Feb 12, 2020 at 1:16 AM Michal Simek <michal.simek@xilinx.com> wrote:
>>>
>>> Generated files are also checked by sparse that's why add newline
>>> to remove sparse (C=1) warning.
>>>
>>> The issue was found on Microblaze and reported like this:
>>> ./arch/microblaze/include/generated/uapi/asm/unistd_32.h:438:45:
>>> warning: no newline at end of file
>>>
>>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>>> Reviewed-by: Stefan Asserhall <stefan.asserhall@xilinx.com>
> 
>>> --- a/arch/m68k/kernel/syscalls/syscallhdr.sh
>>> +++ b/arch/m68k/kernel/syscalls/syscallhdr.sh
>>> @@ -33,4 +33,5 @@ grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | (
>>>         printf "#endif\n"
>>>         printf "\n"
>>>         printf "#endif /* %s */\n" "${fileguard}"
>>
>> Here there's already \n at the end, so no need for another one?
> 
> Thanks! I completely missed that.
> So I did fix the original while applying ;-)

I can drop m68k or align with with others. I would prefer to have the
same solution in all these scripts.

Thanks,
Michal
Geert Uytterhoeven Feb. 12, 2020, 9:32 a.m. UTC | #6
Hi Michal,

On Wed, Feb 12, 2020 at 10:27 AM Michal Simek <michal.simek@xilinx.com> wrote:
> On 12. 02. 20 10:25, Geert Uytterhoeven wrote:
> > On Wed, Feb 12, 2020 at 10:23 AM Max Filippov <jcmvbkbc@gmail.com> wrote:
> >> On Wed, Feb 12, 2020 at 1:16 AM Michal Simek <michal.simek@xilinx.com> wrote:
> >>>
> >>> Generated files are also checked by sparse that's why add newline
> >>> to remove sparse (C=1) warning.
> >>>
> >>> The issue was found on Microblaze and reported like this:
> >>> ./arch/microblaze/include/generated/uapi/asm/unistd_32.h:438:45:
> >>> warning: no newline at end of file
> >>>
> >>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> >>> Reviewed-by: Stefan Asserhall <stefan.asserhall@xilinx.com>
> >
> >>> --- a/arch/m68k/kernel/syscalls/syscallhdr.sh
> >>> +++ b/arch/m68k/kernel/syscalls/syscallhdr.sh
> >>> @@ -33,4 +33,5 @@ grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | (
> >>>         printf "#endif\n"
> >>>         printf "\n"
> >>>         printf "#endif /* %s */\n" "${fileguard}"
> >>
> >> Here there's already \n at the end, so no need for another one?
> >
> > Thanks! I completely missed that.
> > So I did fix the original while applying ;-)
>
> I can drop m68k or align with with others. I would prefer to have the
> same solution in all these scripts.

Yeah, it makes sense to align as much as possible.
IIRC, the original plan was to consolidate more later.

Note that all other lines are terminated with a "\n" at the end.
The separate 'printf "\n"' is an extra blank line, not the terminator for the
previous line.

Gr{oetje,eeting}s,

                        Geert
Michal Simek Feb. 12, 2020, 9:37 a.m. UTC | #7
On 12. 02. 20 10:32, Geert Uytterhoeven wrote:
> Hi Michal,
> 
> On Wed, Feb 12, 2020 at 10:27 AM Michal Simek <michal.simek@xilinx.com> wrote:
>> On 12. 02. 20 10:25, Geert Uytterhoeven wrote:
>>> On Wed, Feb 12, 2020 at 10:23 AM Max Filippov <jcmvbkbc@gmail.com> wrote:
>>>> On Wed, Feb 12, 2020 at 1:16 AM Michal Simek <michal.simek@xilinx.com> wrote:
>>>>>
>>>>> Generated files are also checked by sparse that's why add newline
>>>>> to remove sparse (C=1) warning.
>>>>>
>>>>> The issue was found on Microblaze and reported like this:
>>>>> ./arch/microblaze/include/generated/uapi/asm/unistd_32.h:438:45:
>>>>> warning: no newline at end of file
>>>>>
>>>>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>>>>> Reviewed-by: Stefan Asserhall <stefan.asserhall@xilinx.com>
>>>
>>>>> --- a/arch/m68k/kernel/syscalls/syscallhdr.sh
>>>>> +++ b/arch/m68k/kernel/syscalls/syscallhdr.sh
>>>>> @@ -33,4 +33,5 @@ grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | (
>>>>>         printf "#endif\n"
>>>>>         printf "\n"
>>>>>         printf "#endif /* %s */\n" "${fileguard}"
>>>>
>>>> Here there's already \n at the end, so no need for another one?
>>>
>>> Thanks! I completely missed that.
>>> So I did fix the original while applying ;-)
>>
>> I can drop m68k or align with with others. I would prefer to have the
>> same solution in all these scripts.
> 
> Yeah, it makes sense to align as much as possible.
> IIRC, the original plan was to consolidate more later.
> 
> Note that all other lines are terminated with a "\n" at the end.
> The separate 'printf "\n"' is an extra blank line, not the terminator for the
> previous line.

Should we also get rid of 'printf "\n"' lines or just keep them as they
are today?

M
Geert Uytterhoeven Feb. 12, 2020, 9:40 a.m. UTC | #8
Hi Michal,

On Wed, Feb 12, 2020 at 10:38 AM Michal Simek <michal.simek@xilinx.com> wrote:
> On 12. 02. 20 10:32, Geert Uytterhoeven wrote:
> > On Wed, Feb 12, 2020 at 10:27 AM Michal Simek <michal.simek@xilinx.com> wrote:
> >> On 12. 02. 20 10:25, Geert Uytterhoeven wrote:
> >>> On Wed, Feb 12, 2020 at 10:23 AM Max Filippov <jcmvbkbc@gmail.com> wrote:
> >>>> On Wed, Feb 12, 2020 at 1:16 AM Michal Simek <michal.simek@xilinx.com> wrote:
> >>>>>
> >>>>> Generated files are also checked by sparse that's why add newline
> >>>>> to remove sparse (C=1) warning.
> >>>>>
> >>>>> The issue was found on Microblaze and reported like this:
> >>>>> ./arch/microblaze/include/generated/uapi/asm/unistd_32.h:438:45:
> >>>>> warning: no newline at end of file
> >>>>>
> >>>>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> >>>>> Reviewed-by: Stefan Asserhall <stefan.asserhall@xilinx.com>
> >>>
> >>>>> --- a/arch/m68k/kernel/syscalls/syscallhdr.sh
> >>>>> +++ b/arch/m68k/kernel/syscalls/syscallhdr.sh
> >>>>> @@ -33,4 +33,5 @@ grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | (
> >>>>>         printf "#endif\n"
> >>>>>         printf "\n"
> >>>>>         printf "#endif /* %s */\n" "${fileguard}"
> >>>>
> >>>> Here there's already \n at the end, so no need for another one?
> >>>
> >>> Thanks! I completely missed that.
> >>> So I did fix the original while applying ;-)
> >>
> >> I can drop m68k or align with with others. I would prefer to have the
> >> same solution in all these scripts.
> >
> > Yeah, it makes sense to align as much as possible.
> > IIRC, the original plan was to consolidate more later.
> >
> > Note that all other lines are terminated with a "\n" at the end.
> > The separate 'printf "\n"' is an extra blank line, not the terminator for the
> > previous line.
>
> Should we also get rid of 'printf "\n"' lines or just keep them as they
> are today?

Usually there is a blank line above the include guard terminator, so IMHO
it makes sense to have that in generated files, too.

Gr{oetje,eeting}s,

                        Geert
Michal Simek Feb. 12, 2020, 9:42 a.m. UTC | #9
On 12. 02. 20 10:40, Geert Uytterhoeven wrote:
> Hi Michal,
> 
> On Wed, Feb 12, 2020 at 10:38 AM Michal Simek <michal.simek@xilinx.com> wrote:
>> On 12. 02. 20 10:32, Geert Uytterhoeven wrote:
>>> On Wed, Feb 12, 2020 at 10:27 AM Michal Simek <michal.simek@xilinx.com> wrote:
>>>> On 12. 02. 20 10:25, Geert Uytterhoeven wrote:
>>>>> On Wed, Feb 12, 2020 at 10:23 AM Max Filippov <jcmvbkbc@gmail.com> wrote:
>>>>>> On Wed, Feb 12, 2020 at 1:16 AM Michal Simek <michal.simek@xilinx.com> wrote:
>>>>>>>
>>>>>>> Generated files are also checked by sparse that's why add newline
>>>>>>> to remove sparse (C=1) warning.
>>>>>>>
>>>>>>> The issue was found on Microblaze and reported like this:
>>>>>>> ./arch/microblaze/include/generated/uapi/asm/unistd_32.h:438:45:
>>>>>>> warning: no newline at end of file
>>>>>>>
>>>>>>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>>>>>>> Reviewed-by: Stefan Asserhall <stefan.asserhall@xilinx.com>
>>>>>
>>>>>>> --- a/arch/m68k/kernel/syscalls/syscallhdr.sh
>>>>>>> +++ b/arch/m68k/kernel/syscalls/syscallhdr.sh
>>>>>>> @@ -33,4 +33,5 @@ grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | (
>>>>>>>         printf "#endif\n"
>>>>>>>         printf "\n"
>>>>>>>         printf "#endif /* %s */\n" "${fileguard}"
>>>>>>
>>>>>> Here there's already \n at the end, so no need for another one?
>>>>>
>>>>> Thanks! I completely missed that.
>>>>> So I did fix the original while applying ;-)
>>>>
>>>> I can drop m68k or align with with others. I would prefer to have the
>>>> same solution in all these scripts.
>>>
>>> Yeah, it makes sense to align as much as possible.
>>> IIRC, the original plan was to consolidate more later.
>>>
>>> Note that all other lines are terminated with a "\n" at the end.
>>> The separate 'printf "\n"' is an extra blank line, not the terminator for the
>>> previous line.
>>
>> Should we also get rid of 'printf "\n"' lines or just keep them as they
>> are today?
> 
> Usually there is a blank line above the include guard terminator, so IMHO
> it makes sense to have that in generated files, too.

I meant more not to get rid of \n just include them in current prints.
It means like this 'printf "\n#endif /* %s */\n" "${fileguard}"'

M
Geert Uytterhoeven Feb. 12, 2020, 9:57 a.m. UTC | #10
Hi Michal,

On Wed, Feb 12, 2020 at 10:42 AM Michal Simek <michal.simek@xilinx.com> wrote:
> On 12. 02. 20 10:40, Geert Uytterhoeven wrote:
> > On Wed, Feb 12, 2020 at 10:38 AM Michal Simek <michal.simek@xilinx.com> wrote:
> >> On 12. 02. 20 10:32, Geert Uytterhoeven wrote:
> >>> On Wed, Feb 12, 2020 at 10:27 AM Michal Simek <michal.simek@xilinx.com> wrote:
> >>>> On 12. 02. 20 10:25, Geert Uytterhoeven wrote:
> >>>>> On Wed, Feb 12, 2020 at 10:23 AM Max Filippov <jcmvbkbc@gmail.com> wrote:
> >>>>>> On Wed, Feb 12, 2020 at 1:16 AM Michal Simek <michal.simek@xilinx.com> wrote:
> >>>>>>>
> >>>>>>> Generated files are also checked by sparse that's why add newline
> >>>>>>> to remove sparse (C=1) warning.
> >>>>>>>
> >>>>>>> The issue was found on Microblaze and reported like this:
> >>>>>>> ./arch/microblaze/include/generated/uapi/asm/unistd_32.h:438:45:
> >>>>>>> warning: no newline at end of file
> >>>>>>>
> >>>>>>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> >>>>>>> Reviewed-by: Stefan Asserhall <stefan.asserhall@xilinx.com>
> >>>>>
> >>>>>>> --- a/arch/m68k/kernel/syscalls/syscallhdr.sh
> >>>>>>> +++ b/arch/m68k/kernel/syscalls/syscallhdr.sh
> >>>>>>> @@ -33,4 +33,5 @@ grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | (
> >>>>>>>         printf "#endif\n"
> >>>>>>>         printf "\n"
> >>>>>>>         printf "#endif /* %s */\n" "${fileguard}"
> >>>>>>
> >>>>>> Here there's already \n at the end, so no need for another one?
> >>>>>
> >>>>> Thanks! I completely missed that.
> >>>>> So I did fix the original while applying ;-)
> >>>>
> >>>> I can drop m68k or align with with others. I would prefer to have the
> >>>> same solution in all these scripts.
> >>>
> >>> Yeah, it makes sense to align as much as possible.
> >>> IIRC, the original plan was to consolidate more later.
> >>>
> >>> Note that all other lines are terminated with a "\n" at the end.
> >>> The separate 'printf "\n"' is an extra blank line, not the terminator for the
> >>> previous line.
> >>
> >> Should we also get rid of 'printf "\n"' lines or just keep them as they
> >> are today?
> >
> > Usually there is a blank line above the include guard terminator, so IMHO
> > it makes sense to have that in generated files, too.
>
> I meant more not to get rid of \n just include them in current prints.
> It means like this 'printf "\n#endif /* %s */\n" "${fileguard}"'

I think having a "\n" at the start of a string makes the code harder to read.

You could move it to the end of the previous string, but that is not always
possible (e.g. after the loop), so I'd keep the separate prints for blank
lines.

Gr{oetje,eeting}s,

                        Geert
diff mbox series

Patch

diff --git a/arch/alpha/kernel/syscalls/syscallhdr.sh b/arch/alpha/kernel/syscalls/syscallhdr.sh
index e5b99bd2e5e7..524c69fbcab7 100644
--- a/arch/alpha/kernel/syscalls/syscallhdr.sh
+++ b/arch/alpha/kernel/syscalls/syscallhdr.sh
@@ -33,4 +33,5 @@  grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | (
 	printf "#endif\n"
 	printf "\n"
 	printf "#endif /* %s */" "${fileguard}"
+	printf "\n"
 ) > "$out"
diff --git a/arch/ia64/kernel/syscalls/syscallhdr.sh b/arch/ia64/kernel/syscalls/syscallhdr.sh
index 0c2d2c748565..8e462a9be54a 100644
--- a/arch/ia64/kernel/syscalls/syscallhdr.sh
+++ b/arch/ia64/kernel/syscalls/syscallhdr.sh
@@ -33,4 +33,5 @@  grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | (
 	printf "#endif\n"
 	printf "\n"
 	printf "#endif /* %s */" "${fileguard}"
+	printf "\n"
 ) > "$out"
diff --git a/arch/m68k/kernel/syscalls/syscallhdr.sh b/arch/m68k/kernel/syscalls/syscallhdr.sh
index 6f357d68ef44..8ac15be01ac2 100644
--- a/arch/m68k/kernel/syscalls/syscallhdr.sh
+++ b/arch/m68k/kernel/syscalls/syscallhdr.sh
@@ -33,4 +33,5 @@  grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | (
 	printf "#endif\n"
 	printf "\n"
 	printf "#endif /* %s */\n" "${fileguard}"
+	printf "\n"
 ) > "$out"
diff --git a/arch/microblaze/kernel/syscalls/syscallhdr.sh b/arch/microblaze/kernel/syscalls/syscallhdr.sh
index 2e9062a926a3..4f4238433644 100644
--- a/arch/microblaze/kernel/syscalls/syscallhdr.sh
+++ b/arch/microblaze/kernel/syscalls/syscallhdr.sh
@@ -33,4 +33,5 @@  grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | (
 	printf "#endif\n"
 	printf "\n"
 	printf "#endif /* %s */" "${fileguard}"
+	printf "\n"
 ) > "$out"
diff --git a/arch/parisc/kernel/syscalls/syscallhdr.sh b/arch/parisc/kernel/syscalls/syscallhdr.sh
index 50242b747d7c..77eb95416eae 100644
--- a/arch/parisc/kernel/syscalls/syscallhdr.sh
+++ b/arch/parisc/kernel/syscalls/syscallhdr.sh
@@ -33,4 +33,5 @@  grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | (
 	printf "#endif\n"
 	printf "\n"
 	printf "#endif /* %s */" "${fileguard}"
+	printf "\n"
 ) > "$out"
diff --git a/arch/sh/kernel/syscalls/syscallhdr.sh b/arch/sh/kernel/syscalls/syscallhdr.sh
index 1de0334e577f..7c45d405547c 100644
--- a/arch/sh/kernel/syscalls/syscallhdr.sh
+++ b/arch/sh/kernel/syscalls/syscallhdr.sh
@@ -33,4 +33,5 @@  grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | (
 	printf "#endif\n"
 	printf "\n"
 	printf "#endif /* %s */" "${fileguard}"
+	printf "\n"
 ) > "$out"
diff --git a/arch/sparc/kernel/syscalls/syscallhdr.sh b/arch/sparc/kernel/syscalls/syscallhdr.sh
index 626b5740a9f1..76e4d1a1f8bf 100644
--- a/arch/sparc/kernel/syscalls/syscallhdr.sh
+++ b/arch/sparc/kernel/syscalls/syscallhdr.sh
@@ -33,4 +33,5 @@  grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | (
 	printf "#endif\n"
 	printf "\n"
 	printf "#endif /* %s */" "${fileguard}"
+	printf "\n"
 ) > "$out"
diff --git a/arch/xtensa/kernel/syscalls/syscallhdr.sh b/arch/xtensa/kernel/syscalls/syscallhdr.sh
index d37db641ca31..c946c6b2a506 100644
--- a/arch/xtensa/kernel/syscalls/syscallhdr.sh
+++ b/arch/xtensa/kernel/syscalls/syscallhdr.sh
@@ -33,4 +33,5 @@  grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | (
 	printf "#endif\n"
 	printf "\n"
 	printf "#endif /* %s */" "${fileguard}"
+	printf "\n"
 ) > "$out"