[PATCH v6 19/20] m68k/mac: Switch to use %ptR

2018-12-04 Thread Andy Shevchenko
Use %ptR instead of open coded variant to print content of
struct rtc_time in human readable format.

Cc: Geert Uytterhoeven 
Cc: linux-m68k 
Signed-off-by: Andy Shevchenko 
Reviewed-by: Geert Uytterhoeven 
Acked-by: Geert Uytterhoeven 
---
 arch/m68k/mac/misc.c | 8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/m68k/mac/misc.c b/arch/m68k/mac/misc.c
index ebb3b6d169ea..71c4735a31ee 100644
--- a/arch/m68k/mac/misc.c
+++ b/arch/m68k/mac/misc.c
@@ -605,13 +605,9 @@ int mac_hwclk(int op, struct rtc_time *t)
unmktime(now, 0,
 >tm_year, >tm_mon, >tm_mday,
 >tm_hour, >tm_min, >tm_sec);
-   pr_debug("%s: read %04d-%02d-%-2d %02d:%02d:%02d\n",
-__func__, t->tm_year + 1900, t->tm_mon + 1, t->tm_mday,
-t->tm_hour, t->tm_min, t->tm_sec);
+   pr_debug("%s: read %ptR\n", __func__, t);
} else { /* write */
-   pr_debug("%s: tried to write %04d-%02d-%-2d %02d:%02d:%02d\n",
-__func__, t->tm_year + 1900, t->tm_mon + 1, t->tm_mday,
-t->tm_hour, t->tm_min, t->tm_sec);
+   pr_debug("%s: tried to write %ptR\n", __func__, t);
 
switch (macintosh_config->adb_type) {
case MAC_ADB_IOP:
-- 
2.19.2



[PATCH v2] m68k: Fix crash in free_all_bootmem()

2018-12-04 Thread Geert Uytterhoeven
When running the kernel in Fast RAM on Atari:

Ignoring memory chunk at 0x0:0xe0 before the first chunk
...
Unable to handle kernel NULL pointer dereference at virtual address (ptrval)
Oops: 
Modules linked in:
PC: [<0069dbac>] free_all_bootmem+0x12c/0x186
SR: 2714  SP: (ptrval)  a2: 005e3314
d0: d1: 000ad2: 0e00d3: 
d4: 005e1fc0d5: 001aa0: 0100a1: 
Process swapper (pid: 0, task=(ptrval))
Frame format=7 eff addr=0736 ssw=0505 faddr=0736
wb 1 stat/addr/data:   
wb 2 stat/addr/data:   
wb 3 stat/addr/data:  0736 
push data:    
Stack from 005e1f84:
 000a 027d3260 006b5006    

0004f062 0003a220 0069e272 005e1ff8 054c  00e0 

0001 00693cd8 027d3260 0004f062 0003a220 00691be6  

    006b5006  00690872
Call Trace: [<0004f062>] printk+0x0/0x18
 [<0003a220>] parse_args+0x0/0x2d4
 [<0069e272>] memblock_virt_alloc_try_nid+0x0/0xa4
 [<00693cd8>] mem_init+0xa/0x5c
 [<0004f062>] printk+0x0/0x18
 [<0003a220>] parse_args+0x0/0x2d4
 [<00691be6>] start_kernel+0x1ca/0x462
 [<00690872>] _sinittext+0x872/0x11f8
Code: 7a1a eaae 2270 6db0 0061 ef14 2f01 2f03 <96a9> 0736 2203 e589 d681 
e78b d6a9 0732 2f03 2f40 0034 4eb9 0069 b8d0 260e 4fef
Disabling lock debugging due to kernel taint
Kernel panic - not syncing: Attempted to kill the idle task!

As the kernel must run in the memory chunk with the lowest address,
ST-RAM is ignored, and removed from the m68k_memory[] array.
However, it is not removed from memblock, causing a crash later.

Fix this by removing ignored memory chunks from memblock.

Amigas with both Zorro II and Zorro III RAM have a similar issue, as on
such systems, Zorro II RAM is ignored, and removed from the
m68k_memory[] array.  Fix this as well.

Reported-by: Andreas Schwab 
Suggested-by: Mike Rapoport 
Tested-by: Michael Schmitz 
Fixes: 1008a11590b966b4 ("m68k: switch to MEMBLOCK + NO_BOOTMEM")
Signed-off-by: Geert Uytterhoeven 
---
The Amiga part is untested.

v2:
  - Add missing #include .
---
 arch/m68k/amiga/config.c | 3 +++
 arch/m68k/mm/motorola.c  | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c
index 65f63a4571300085..068f9b6bb4bc3722 100644
--- a/arch/m68k/amiga/config.c
+++ b/arch/m68k/amiga/config.c
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -427,6 +428,8 @@ void __init config_amiga(void)
continue;
}
disabled_z2mem += m68k_memory[i].size;
+   memblock_remove(m68k_memory[i].addr,
+   m68k_memory[i].size);
m68k_num_memory--;
for (j = i; j < m68k_num_memory; j++)
m68k_memory[j] = m68k_memory[j+1];
diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c
index 7497cf30bf1cd41b..7cf0d57fa5c7e75e 100644
--- a/arch/m68k/mm/motorola.c
+++ b/arch/m68k/mm/motorola.c
@@ -233,6 +233,8 @@ void __init paging_init(void)
printk("Ignoring memory chunk at 0x%lx:0x%lx before the 
first chunk\n",
m68k_memory[i].addr, m68k_memory[i].size);
printk("Fix your bootloader or use a memfile to make 
use of this area!\n");
+   memblock_remove(m68k_memory[i].addr,
+   m68k_memory[i].size);
m68k_num_memory--;
memmove(m68k_memory + i, m68k_memory + i + 1,
(m68k_num_memory - i) * sizeof(struct 
m68k_mem_info));
-- 
2.17.1



[PATCH] m68k: Fix crash in free_all_bootmem()

2018-12-04 Thread Geert Uytterhoeven
When running the kernel in Fast RAM on Atari:

Ignoring memory chunk at 0x0:0xe0 before the first chunk
...
Unable to handle kernel NULL pointer dereference at virtual address (ptrval)
Oops: 
Modules linked in:
PC: [<0069dbac>] free_all_bootmem+0x12c/0x186
SR: 2714  SP: (ptrval)  a2: 005e3314
d0: d1: 000ad2: 0e00d3: 
d4: 005e1fc0d5: 001aa0: 0100a1: 
Process swapper (pid: 0, task=(ptrval))
Frame format=7 eff addr=0736 ssw=0505 faddr=0736
wb 1 stat/addr/data:   
wb 2 stat/addr/data:   
wb 3 stat/addr/data:  0736 
push data:    
Stack from 005e1f84:
 000a 027d3260 006b5006    

0004f062 0003a220 0069e272 005e1ff8 054c  00e0 

0001 00693cd8 027d3260 0004f062 0003a220 00691be6  

    006b5006  00690872
Call Trace: [<0004f062>] printk+0x0/0x18
 [<0003a220>] parse_args+0x0/0x2d4
 [<0069e272>] memblock_virt_alloc_try_nid+0x0/0xa4
 [<00693cd8>] mem_init+0xa/0x5c
 [<0004f062>] printk+0x0/0x18
 [<0003a220>] parse_args+0x0/0x2d4
 [<00691be6>] start_kernel+0x1ca/0x462
 [<00690872>] _sinittext+0x872/0x11f8
Code: 7a1a eaae 2270 6db0 0061 ef14 2f01 2f03 <96a9> 0736 2203 e589 d681 
e78b d6a9 0732 2f03 2f40 0034 4eb9 0069 b8d0 260e 4fef
Disabling lock debugging due to kernel taint
Kernel panic - not syncing: Attempted to kill the idle task!

As the kernel must run in the memory chunk with the lowest address,
ST-RAM is ignored, and removed from the m68k_memory[] array.
However, it is not removed from memblock, causing a crash later.

Fix this by removing ignored memory chunks from memblock.

Amigas with both Zorro II and Zorro III RAM have a similar issue, as on
such systems, Zorro II RAM is ignored, and removed from the
m68k_memory[] array.  Fix this as well.

Reported-by: Andreas Schwab 
Suggested-by: Mike Rapoport 
Tested-by: Michael Schmitz 
Fixes: 1008a11590b966b4 ("m68k: switch to MEMBLOCK + NO_BOOTMEM")
Signed-off-by: Geert Uytterhoeven 
---
The Amiga part is untested.
---
 arch/m68k/amiga/config.c | 2 ++
 arch/m68k/mm/motorola.c  | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c
index 65f63a4571300085..73e2bdf0f5ac8f2b 100644
--- a/arch/m68k/amiga/config.c
+++ b/arch/m68k/amiga/config.c
@@ -427,6 +427,8 @@ void __init config_amiga(void)
continue;
}
disabled_z2mem += m68k_memory[i].size;
+   memblock_remove(m68k_memory[i].addr,
+   m68k_memory[i].size);
m68k_num_memory--;
for (j = i; j < m68k_num_memory; j++)
m68k_memory[j] = m68k_memory[j+1];
diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c
index 4e17ecb5928aae85..98706bfe10a9ac5e 100644
--- a/arch/m68k/mm/motorola.c
+++ b/arch/m68k/mm/motorola.c
@@ -233,6 +233,8 @@ void __init paging_init(void)
printk("Ignoring memory chunk at 0x%lx:0x%lx before the 
first chunk\n",
m68k_memory[i].addr, m68k_memory[i].size);
printk("Fix your bootloader or use a memfile to make 
use of this area!\n");
+   memblock_remove(m68k_memory[i].addr,
+   m68k_memory[i].size);
m68k_num_memory--;
memmove(m68k_memory + i, m68k_memory + i + 1,
(m68k_num_memory - i) * sizeof(struct 
m68k_mem_info));
-- 
2.17.1



Re: [PATCH] m68k: Fix crash in free_all_bootmem()

2018-12-04 Thread Geert Uytterhoeven
On Tue, Dec 4, 2018 at 2:15 PM Geert Uytterhoeven  wrote:
> When running the kernel in Fast RAM on Atari:
>
> Ignoring memory chunk at 0x0:0xe0 before the first chunk
> ...

> ---
> The Amiga part is untested.

Oops, not even compile-tested...

/me hides in a brown paper bag...

Gr{oetje,eeting}s,

Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds


[PATCH] m68k: Fix crash in free_all_bootmem()

2018-12-04 Thread Geert Uytterhoeven
When running the kernel in Fast RAM on Atari:

Ignoring memory chunk at 0x0:0xe0 before the first chunk
...
Unable to handle kernel NULL pointer dereference at virtual address (ptrval)
Oops: 
Modules linked in:
PC: [<0069dbac>] free_all_bootmem+0x12c/0x186
SR: 2714  SP: (ptrval)  a2: 005e3314
d0: d1: 000ad2: 0e00d3: 
d4: 005e1fc0d5: 001aa0: 0100a1: 
Process swapper (pid: 0, task=(ptrval))
Frame format=7 eff addr=0736 ssw=0505 faddr=0736
wb 1 stat/addr/data:   
wb 2 stat/addr/data:   
wb 3 stat/addr/data:  0736 
push data:    
Stack from 005e1f84:
 000a 027d3260 006b5006    

0004f062 0003a220 0069e272 005e1ff8 054c  00e0 

0001 00693cd8 027d3260 0004f062 0003a220 00691be6  

    006b5006  00690872
Call Trace: [<0004f062>] printk+0x0/0x18
 [<0003a220>] parse_args+0x0/0x2d4
 [<0069e272>] memblock_virt_alloc_try_nid+0x0/0xa4
 [<00693cd8>] mem_init+0xa/0x5c
 [<0004f062>] printk+0x0/0x18
 [<0003a220>] parse_args+0x0/0x2d4
 [<00691be6>] start_kernel+0x1ca/0x462
 [<00690872>] _sinittext+0x872/0x11f8
Code: 7a1a eaae 2270 6db0 0061 ef14 2f01 2f03 <96a9> 0736 2203 e589 d681 
e78b d6a9 0732 2f03 2f40 0034 4eb9 0069 b8d0 260e 4fef
Disabling lock debugging due to kernel taint
Kernel panic - not syncing: Attempted to kill the idle task!

As the kernel must run in the memory chunk with the lowest address,
ST-RAM is ignored, and removed from the m68k_memory[] array.
However, it is not removed from memblock, causing a crash later.

Fix this by removing ignored memory chunks from memblock.

Amigas with both Zorro II and Zorro III RAM have a similar issue, as on
such systems, Zorro II RAM is ignored, and removed from the
m68k_memory[] array.  Fix this as well.

Reported-by: Andreas Schwab 
Suggested-by: Mike Rapoport 
Tested-by: Michael Schmitz 
Fixes: 1008a11590b966b4 ("m68k: switch to MEMBLOCK + NO_BOOTMEM")
Signed-off-by: Geert Uytterhoeven 
---
The Amiga part is untested.
---
 arch/m68k/amiga/config.c | 2 ++
 arch/m68k/mm/motorola.c  | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c
index 65f63a4571300085..73e2bdf0f5ac8f2b 100644
--- a/arch/m68k/amiga/config.c
+++ b/arch/m68k/amiga/config.c
@@ -427,6 +427,8 @@ void __init config_amiga(void)
continue;
}
disabled_z2mem += m68k_memory[i].size;
+   memblock_remove(m68k_memory[i].addr,
+   m68k_memory[i].size);
m68k_num_memory--;
for (j = i; j < m68k_num_memory; j++)
m68k_memory[j] = m68k_memory[j+1];
diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c
index 4e17ecb5928aae85..98706bfe10a9ac5e 100644
--- a/arch/m68k/mm/motorola.c
+++ b/arch/m68k/mm/motorola.c
@@ -233,6 +233,8 @@ void __init paging_init(void)
printk("Ignoring memory chunk at 0x%lx:0x%lx before the 
first chunk\n",
m68k_memory[i].addr, m68k_memory[i].size);
printk("Fix your bootloader or use a memfile to make 
use of this area!\n");
+   memblock_remove(m68k_memory[i].addr,
+   m68k_memory[i].size);
m68k_num_memory--;
memmove(m68k_memory + i, m68k_memory + i + 1,
(m68k_num_memory - i) * sizeof(struct 
m68k_mem_info));
-- 
2.17.1



Re: [PATCH v5 0/3] m68k: system call table generation support

2018-12-04 Thread Firoz Khan
Hi Geert,

On Tue, 4 Dec 2018 at 14:22, Geert Uytterhoeven  wrote:
>
> On Tue, Nov 13, 2018 at 7:01 AM Firoz Khan  wrote:
> > The purpose of this patch series is, we can easily
> > add/modify/delete system call table support by cha-
> > nging entry in syscall.tbl file instead of manually
> > changing many files. The other goal is to unify the
> > system call table generation support implementation
> > across all the architectures.
> >
> > The system call tables are in different format in
> > all architecture. It will be difficult to manually
> > add, modify or delete the system calls in the resp-
> > ective files manually. To make it easy by keeping a
> > script and which'll generate uapi header file and
> > syscall table file.
> >
> > syscall.tbl contains the list of available system
> > calls along with system call number and correspond-
> > ing entry point. Add a new system call in this arch-
> > itecture will be possible by adding new entry in the
> > syscall.tbl file.
> >
> > Adding a new table entry consisting of:
> > - System call number.
> > - ABI.
> > - System call name.
> > - Entry point name.
> >
> > ARM, s390 and x86 architecuture does exist the sim-
> > ilar support. I leverage their implementation to
> > come up with a generic solution.
> >
> > I have done the same support for work for alpha, ia64,
> > microblaze, mips, parisc, powerpc, sh, sparc and xtensa.
> > Below mentioned git repository contains more details
> > about the workflow.
> >
> > https://github.com/frzkhn/system_call_table_generator/
> >
> > Finally, this is the ground work to solve the Y2038
> > issue. We need to add two dozen of system calls to
> > solve Y2038 issue. So this patch series will help to
> > add new system calls easily by adding new entry in
> > the syscall.tbl.
> >
> > changes since v4:
> >  - changed from generic-y to generated-y in Kbuild.
> >  - remove the patch "0001-m68k-rename-system-call-
> >table-file-name.patch".
> >
> > changes since v3:
> >  - optimized/updated the syscall table generation
> >scripts.
> >  - fixed all mixed indentation issues in syscall.tbl.
> >  - added "comments" in syscall_*.tbl.
> >
> > changes since v2:
> >  - removed __IGNORE entries which was added in v2
> >to suppress the warning.
> >  - added missing new line.
> >
> > changes since v1:
> >  - enclosed __NR_sycalls macro with __KERNEL__.
> >
> > Firoz Khan (3):
> >   m68k: add __NR_syscalls along with NR_syscalls
> >   m68k: add system call table generation support
> >   m68k: generate uapi header and syscall table header files
> >
> >  arch/m68k/Makefile  |   3 +
> >  arch/m68k/include/asm/Kbuild|   1 +
> >  arch/m68k/include/asm/unistd.h  |   3 +-
> >  arch/m68k/include/uapi/asm/Kbuild   |   1 +
> >  arch/m68k/include/uapi/asm/unistd.h | 385 
> > +--
> >  arch/m68k/kernel/syscalls/Makefile  |  38 
> >  arch/m68k/kernel/syscalls/syscall.tbl   | 389 
> > 
> >  arch/m68k/kernel/syscalls/syscallhdr.sh |  36 +++
> >  arch/m68k/kernel/syscalls/syscalltbl.sh |  32 +++
> >  arch/m68k/kernel/syscalltable.S | 387 
> > +--
> >  10 files changed, 507 insertions(+), 768 deletions(-)
> >  create mode 100644 arch/m68k/kernel/syscalls/Makefile
> >  create mode 100644 arch/m68k/kernel/syscalls/syscall.tbl
> >  create mode 100644 arch/m68k/kernel/syscalls/syscallhdr.sh
> >  create mode 100644 arch/m68k/kernel/syscalls/syscalltbl.sh
>
> Thanks, applied and queued for v4.21 (with the missing newline added).

Great, Thanks!

Firoz

>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- 
> ge...@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like 
> that.
> -- Linus Torvalds


Re: [PATCH v5 0/3] m68k: system call table generation support

2018-12-04 Thread Geert Uytterhoeven
On Tue, Nov 13, 2018 at 7:01 AM Firoz Khan  wrote:
> The purpose of this patch series is, we can easily
> add/modify/delete system call table support by cha-
> nging entry in syscall.tbl file instead of manually
> changing many files. The other goal is to unify the
> system call table generation support implementation
> across all the architectures.
>
> The system call tables are in different format in
> all architecture. It will be difficult to manually
> add, modify or delete the system calls in the resp-
> ective files manually. To make it easy by keeping a
> script and which'll generate uapi header file and
> syscall table file.
>
> syscall.tbl contains the list of available system
> calls along with system call number and correspond-
> ing entry point. Add a new system call in this arch-
> itecture will be possible by adding new entry in the
> syscall.tbl file.
>
> Adding a new table entry consisting of:
> - System call number.
> - ABI.
> - System call name.
> - Entry point name.
>
> ARM, s390 and x86 architecuture does exist the sim-
> ilar support. I leverage their implementation to
> come up with a generic solution.
>
> I have done the same support for work for alpha, ia64,
> microblaze, mips, parisc, powerpc, sh, sparc and xtensa.
> Below mentioned git repository contains more details
> about the workflow.
>
> https://github.com/frzkhn/system_call_table_generator/
>
> Finally, this is the ground work to solve the Y2038
> issue. We need to add two dozen of system calls to
> solve Y2038 issue. So this patch series will help to
> add new system calls easily by adding new entry in
> the syscall.tbl.
>
> changes since v4:
>  - changed from generic-y to generated-y in Kbuild.
>  - remove the patch "0001-m68k-rename-system-call-
>table-file-name.patch".
>
> changes since v3:
>  - optimized/updated the syscall table generation
>scripts.
>  - fixed all mixed indentation issues in syscall.tbl.
>  - added "comments" in syscall_*.tbl.
>
> changes since v2:
>  - removed __IGNORE entries which was added in v2
>to suppress the warning.
>  - added missing new line.
>
> changes since v1:
>  - enclosed __NR_sycalls macro with __KERNEL__.
>
> Firoz Khan (3):
>   m68k: add __NR_syscalls along with NR_syscalls
>   m68k: add system call table generation support
>   m68k: generate uapi header and syscall table header files
>
>  arch/m68k/Makefile  |   3 +
>  arch/m68k/include/asm/Kbuild|   1 +
>  arch/m68k/include/asm/unistd.h  |   3 +-
>  arch/m68k/include/uapi/asm/Kbuild   |   1 +
>  arch/m68k/include/uapi/asm/unistd.h | 385 +--
>  arch/m68k/kernel/syscalls/Makefile  |  38 
>  arch/m68k/kernel/syscalls/syscall.tbl   | 389 
> 
>  arch/m68k/kernel/syscalls/syscallhdr.sh |  36 +++
>  arch/m68k/kernel/syscalls/syscalltbl.sh |  32 +++
>  arch/m68k/kernel/syscalltable.S | 387 +--
>  10 files changed, 507 insertions(+), 768 deletions(-)
>  create mode 100644 arch/m68k/kernel/syscalls/Makefile
>  create mode 100644 arch/m68k/kernel/syscalls/syscall.tbl
>  create mode 100644 arch/m68k/kernel/syscalls/syscallhdr.sh
>  create mode 100644 arch/m68k/kernel/syscalls/syscalltbl.sh

Thanks, applied and queued for v4.21 (with the missing newline added).

Gr{oetje,eeting}s,

Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds


Re: [PATCH v5 2/3] m68k: add system call table generation support

2018-12-04 Thread Firoz Khan
Hi Geert,

On Tue, 4 Dec 2018 at 13:26, Geert Uytterhoeven  wrote:
>
> Hi Firoz,
>
> On Tue, Dec 4, 2018 at 4:22 AM Firoz Khan  wrote:
> > On Sun, 2 Dec 2018 at 19:27, Geert Uytterhoeven  
> > wrote:
> > > On Tue, Nov 13, 2018 at 7:01 AM Firoz Khan  wrote:
> > > > The system call tables are in different format in all
> > > > architecture and it will be difficult to manually add,
> > > > modify or delete the syscall table entries in the res-
> > > > pective files. To make it easy by keeping a script and
> > > > which will generate the uapi header and syscall table
> > > > file. This change will also help to unify the implemen-
> > > > tation across all architectures.
> > > >
> > > > The system call table generation script is added in
> > > > kernel/syscalls directory which contain the scripts to
> > > > generate both uapi header file and system call table
> > > > files. The syscall.tbl will be input for the scripts.
> > > >
> > > > syscall.tbl contains the list of available system calls
> > > > along with system call number and corresponding entry
> > > > point. Add a new system call in this architecture will
> > > > be possible by adding new entry in the syscall.tbl file.
> > > >
> > > > Adding a new table entry consisting of:
> > > > - System call number.
> > > > - ABI.
> > > > - System call name.
> > > > - Entry point name.
> > > >
> > > > syscallhdr.sh and syscalltbl.sh will generate uapi header
> > > > unistd_32.h and syscall_table.h files respectively. Both
> > > > .sh files will parse the content syscall.tbl to generate
> > > > the header and table files. unistd_32.h will be included
> > > > by uapi/asm/unistd.h and syscall_table.h is included by
> > > > kernel/syscall_table.S - the real system call table.
> > > >
> > > > ARM, s390 and x86 architecuture does have similar support.
> > > > I leverage their implementation to come up with a generic
> > > > solution.
> > > >
> > > > Signed-off-by: Firoz Khan 
> > >
> > > Thanks for your patch!
> > >
> > > > --- /dev/null
> > > > +++ b/arch/m68k/kernel/syscalls/syscallhdr.sh
>
> > > > +   printf "#endif\n"
> > > > +   printf "\n"
> > > > +   printf "#endif /* %s */" "${fileguard}"
> > >
> > > The above line is lacking a "\n", causing:
> > >
> > > ./arch/m68k/include/generated/uapi/asm/unistd_32.h:370:42:
> > > warning: no newline at end of file
> >
> > I was wondering, I haven't seen this warning when I compiled it.
>
> It seems to depend on the compiler version.
> One more thing found by my good old gcc-4.1 ;-)
> (which I plan to retire soon, as I need to revert too many "drop support
>  for old gcc" patches to keep it working :-(.
>
> > > Changing it to:
> > >
> > > printf "#endif /* %s */\n" "${fileguard}"
> > >
> > > fixes this.
> >
> > Yes.
> >
> > > Interestingly, this issue seems to be present on powerpc, parisc, sparc,
> > > sh, xtensa (and probably more, I gave up looking), too?
> >
> > I kept the script to generate files *almost* identical. so this will be 
> > present
> > all 10 architecture.
> >
> > > Apart from that, it seems to work fine on m68k.
> >
> > I have three options here to fix this;
> > 1. I can send v6 by fixing this one.
> > 2. I can post a single patch which add \n in the script.
> > 3. Could you able to add \n in the script.
> >
> > Please choose one, I can act accordingly.
>
> So your plan is for me to apply your series to the m68k tree?

Yes.

> In that case there's no need to send a v6, I can incorporate the fix myself.

Sure, Another line - printf "\n" would be great. Thanks :)

Firoz

>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- 
> ge...@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like 
> that.
> -- Linus Torvalds