[PATCH 06/52] m68k: kernel: Add and use "process.h"

Geert Uytterhoeven posted 52 patches 2 years, 3 months ago
There is a newer version of this series
[PATCH 06/52] m68k: kernel: Add and use "process.h"
Posted by Geert Uytterhoeven 2 years, 3 months ago
When building with W=1:

    arch/m68k/kernel/process.c:115:16: warning: no previous prototype for ‘m68k_clone’ [-Wmissing-prototypes]
      115 | asmlinkage int m68k_clone(struct pt_regs *regs)
	  |                ^~~~~~~~~~
    arch/m68k/kernel/process.c:136:16: warning: no previous prototype for ‘m68k_clone3’ [-Wmissing-prototypes]
      136 | asmlinkage int m68k_clone3(struct pt_regs *regs)
	  |                ^~~~~~~~~~~

Fix this by introducing a new header file "process.h" for holding the
prototypes of functions implemented in arch/m68k/kernel/process.c.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 arch/m68k/kernel/process.c | 1 +
 arch/m68k/kernel/process.h | 8 ++++++++
 2 files changed, 9 insertions(+)
 create mode 100644 arch/m68k/kernel/process.h

diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c
index e06ce147c0b7fcf2..d2d6a57356502e5b 100644
--- a/arch/m68k/kernel/process.c
+++ b/arch/m68k/kernel/process.c
@@ -38,6 +38,7 @@
 #include <asm/machdep.h>
 #include <asm/setup.h>
 
+#include <process.h>
 
 asmlinkage void ret_from_fork(void);
 asmlinkage void ret_from_kernel_thread(void);
diff --git a/arch/m68k/kernel/process.h b/arch/m68k/kernel/process.h
new file mode 100644
index 0000000000000000..d31745f2e64bebab
--- /dev/null
+++ b/arch/m68k/kernel/process.h
@@ -0,0 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#include <linux/linkage.h>
+
+struct pt_regs;
+
+asmlinkage int m68k_clone(struct pt_regs *regs);
+asmlinkage int m68k_clone3(struct pt_regs *regs);
-- 
2.34.1

Re: [PATCH 06/52] m68k: kernel: Add and use "process.h"
Posted by Greg Ungerer 2 years, 3 months ago
Hi Geert,

Nice cleanups. My plan is to clean up the ColdFire/68000 warnings as well.


On 7/9/23 23:41, Geert Uytterhoeven wrote:
> When building with W=1:
> 
>      arch/m68k/kernel/process.c:115:16: warning: no previous prototype for ‘m68k_clone’ [-Wmissing-prototypes]
>        115 | asmlinkage int m68k_clone(struct pt_regs *regs)
> 	  |                ^~~~~~~~~~
>      arch/m68k/kernel/process.c:136:16: warning: no previous prototype for ‘m68k_clone3’ [-Wmissing-prototypes]
>        136 | asmlinkage int m68k_clone3(struct pt_regs *regs)
> 	  |                ^~~~~~~~~~~
> 
> Fix this by introducing a new header file "process.h" for holding the
> prototypes of functions implemented in arch/m68k/kernel/process.c.
> 
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
>   arch/m68k/kernel/process.c | 1 +
>   arch/m68k/kernel/process.h | 8 ++++++++
>   2 files changed, 9 insertions(+)
>   create mode 100644 arch/m68k/kernel/process.h
> 
> diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c
> index e06ce147c0b7fcf2..d2d6a57356502e5b 100644
> --- a/arch/m68k/kernel/process.c
> +++ b/arch/m68k/kernel/process.c
> @@ -38,6 +38,7 @@
>   #include <asm/machdep.h>
>   #include <asm/setup.h>
>   
> +#include <process.h>

I applied all 52 patches to linux-6.6-rc1 and see this:

     $ ARCH=m68k CROSS_COMPILE=m68k-linux- make amiga_defconfig
     $ ARCH=m68k CROSS_COMPILE=m68k-linux- make W=1
     ...
       CC      arch/m68k/kernel/process.o
     arch/m68k/kernel/process.c:41:10: fatal error: process.h: No such file or directory
      #include <process.h>
               ^~~~~~~~~~~

Of course trivially fixed by doing this:

diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c
index d2d6a5735650..2584e94e2134 100644
--- a/arch/m68k/kernel/process.c
+++ b/arch/m68k/kernel/process.c
@@ -38,7 +38,7 @@
  #include <asm/machdep.h>
  #include <asm/setup.h>
  
-#include <process.h>
+#include "process.h"
  
  asmlinkage void ret_from_fork(void);
  asmlinkage void ret_from_kernel_thread(void);


Regards
Greg


>   asmlinkage void ret_from_fork(void);
>   asmlinkage void ret_from_kernel_thread(void);
> diff --git a/arch/m68k/kernel/process.h b/arch/m68k/kernel/process.h
> new file mode 100644
> index 0000000000000000..d31745f2e64bebab
> --- /dev/null
> +++ b/arch/m68k/kernel/process.h
> @@ -0,0 +1,8 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +
> +#include <linux/linkage.h>
> +
> +struct pt_regs;
> +
> +asmlinkage int m68k_clone(struct pt_regs *regs);
> +asmlinkage int m68k_clone3(struct pt_regs *regs);
Re: [PATCH 06/52] m68k: kernel: Add and use "process.h"
Posted by Geert Uytterhoeven 2 years, 3 months ago
Hi Greg,

On Mon, Sep 11, 2023 at 3:42 PM Greg Ungerer <gerg@linux-m68k.org> wrote:
> Nice cleanups. My plan is to clean up the ColdFire/68000 warnings as well.

Thanks in advance!

> On 7/9/23 23:41, Geert Uytterhoeven wrote:
> > --- a/arch/m68k/kernel/process.c
> > +++ b/arch/m68k/kernel/process.c
> > @@ -38,6 +38,7 @@
> >   #include <asm/machdep.h>
> >   #include <asm/setup.h>
> >
> > +#include <process.h>
>
> I applied all 52 patches to linux-6.6-rc1 and see this:
>
>      $ ARCH=m68k CROSS_COMPILE=m68k-linux- make amiga_defconfig
>      $ ARCH=m68k CROSS_COMPILE=m68k-linux- make W=1
>      ...
>        CC      arch/m68k/kernel/process.o
>      arch/m68k/kernel/process.c:41:10: fatal error: process.h: No such file or directory
>       #include <process.h>
>                ^~~~~~~~~~~
>
> Of course trivially fixed by doing this:
>
> diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c
> index d2d6a5735650..2584e94e2134 100644
> --- a/arch/m68k/kernel/process.c
> +++ b/arch/m68k/kernel/process.c
> @@ -38,7 +38,7 @@
>   #include <asm/machdep.h>
>   #include <asm/setup.h>
>
> -#include <process.h>
> +#include "process.h"

Thanks, will fix (and any other similar typos, if any).

I usually build in separate output directories, which causes

    -I${srcdir}/include
    -I${srcdir}/arch/m68k/kernel
    -I./arch/m68k/kernel

to be added to the include path, causing <...> to work as well :-(

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@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