2021-01-12 13:07:31

by Jinyang He

[permalink] [raw]
Subject: [PATCH 1/4] MIPS: process: Reorder header files

Just reorder the header files.

Signed-off-by: Jinyang He <[email protected]>
---
arch/mips/kernel/process.c | 44 ++++++++++++++++++++++----------------------
1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
index d7e288f..361bd28 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -9,28 +9,29 @@
* Copyright (C) 2004 Thiemo Seufer
* Copyright (C) 2013 Imagination Technologies Ltd.
*/
+#include <linux/completion.h>
+#include <linux/cpu.h>
#include <linux/errno.h>
+#include <linux/export.h>
+#include <linux/init.h>
+#include <linux/kallsyms.h>
+#include <linux/kernel.h>
+#include <linux/mm.h>
+#include <linux/mman.h>
+#include <linux/nmi.h>
+#include <linux/personality.h>
+#include <linux/ptrace.h>
+#include <linux/prctl.h>
+#include <linux/random.h>
#include <linux/sched.h>
#include <linux/sched/debug.h>
#include <linux/sched/task.h>
#include <linux/sched/task_stack.h>
-#include <linux/tick.h>
-#include <linux/kernel.h>
-#include <linux/mm.h>
#include <linux/stddef.h>
-#include <linux/unistd.h>
-#include <linux/export.h>
-#include <linux/ptrace.h>
-#include <linux/mman.h>
-#include <linux/personality.h>
#include <linux/sys.h>
-#include <linux/init.h>
-#include <linux/completion.h>
-#include <linux/kallsyms.h>
-#include <linux/random.h>
-#include <linux/prctl.h>
-#include <linux/nmi.h>
-#include <linux/cpu.h>
+#include <linux/tick.h>
+#include <linux/uaccess.h>
+#include <linux/unistd.h>

#include <asm/abi.h>
#include <asm/asm.h>
@@ -38,21 +39,20 @@
#include <asm/cpu.h>
#include <asm/dsemul.h>
#include <asm/dsp.h>
+#include <asm/elf.h>
+#include <asm/exec.h>
#include <asm/fpu.h>
+#include <asm/inst.h>
+#include <asm/io.h>
#include <asm/irq.h>
+#include <asm/irq_regs.h>
+#include <asm/isadep.h>
#include <asm/mips-cps.h>
#include <asm/msa.h>
#include <asm/mipsregs.h>
#include <asm/processor.h>
#include <asm/reg.h>
-#include <linux/uaccess.h>
-#include <asm/io.h>
-#include <asm/elf.h>
-#include <asm/isadep.h>
-#include <asm/inst.h>
#include <asm/stacktrace.h>
-#include <asm/irq_regs.h>
-#include <asm/exec.h>

#ifdef CONFIG_HOTPLUG_CPU
void arch_cpu_idle_dead(void)
--
2.1.0


2021-01-13 03:34:09

by Huacai Chen

[permalink] [raw]
Subject: Re: [PATCH 1/4] MIPS: process: Reorder header files

Reviewed-by: Huacai Chen <[email protected]>

On Tue, Jan 12, 2021 at 9:07 PM Jinyang He <[email protected]> wrote:
>
> Just reorder the header files.
>
> Signed-off-by: Jinyang He <[email protected]>
> ---
> arch/mips/kernel/process.c | 44 ++++++++++++++++++++++----------------------
> 1 file changed, 22 insertions(+), 22 deletions(-)
>
> diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
> index d7e288f..361bd28 100644
> --- a/arch/mips/kernel/process.c
> +++ b/arch/mips/kernel/process.c
> @@ -9,28 +9,29 @@
> * Copyright (C) 2004 Thiemo Seufer
> * Copyright (C) 2013 Imagination Technologies Ltd.
> */
> +#include <linux/completion.h>
> +#include <linux/cpu.h>
> #include <linux/errno.h>
> +#include <linux/export.h>
> +#include <linux/init.h>
> +#include <linux/kallsyms.h>
> +#include <linux/kernel.h>
> +#include <linux/mm.h>
> +#include <linux/mman.h>
> +#include <linux/nmi.h>
> +#include <linux/personality.h>
> +#include <linux/ptrace.h>
> +#include <linux/prctl.h>
> +#include <linux/random.h>
> #include <linux/sched.h>
> #include <linux/sched/debug.h>
> #include <linux/sched/task.h>
> #include <linux/sched/task_stack.h>
> -#include <linux/tick.h>
> -#include <linux/kernel.h>
> -#include <linux/mm.h>
> #include <linux/stddef.h>
> -#include <linux/unistd.h>
> -#include <linux/export.h>
> -#include <linux/ptrace.h>
> -#include <linux/mman.h>
> -#include <linux/personality.h>
> #include <linux/sys.h>
> -#include <linux/init.h>
> -#include <linux/completion.h>
> -#include <linux/kallsyms.h>
> -#include <linux/random.h>
> -#include <linux/prctl.h>
> -#include <linux/nmi.h>
> -#include <linux/cpu.h>
> +#include <linux/tick.h>
> +#include <linux/uaccess.h>
> +#include <linux/unistd.h>
>
> #include <asm/abi.h>
> #include <asm/asm.h>
> @@ -38,21 +39,20 @@
> #include <asm/cpu.h>
> #include <asm/dsemul.h>
> #include <asm/dsp.h>
> +#include <asm/elf.h>
> +#include <asm/exec.h>
> #include <asm/fpu.h>
> +#include <asm/inst.h>
> +#include <asm/io.h>
> #include <asm/irq.h>
> +#include <asm/irq_regs.h>
> +#include <asm/isadep.h>
> #include <asm/mips-cps.h>
> #include <asm/msa.h>
> #include <asm/mipsregs.h>
> #include <asm/processor.h>
> #include <asm/reg.h>
> -#include <linux/uaccess.h>
> -#include <asm/io.h>
> -#include <asm/elf.h>
> -#include <asm/isadep.h>
> -#include <asm/inst.h>
> #include <asm/stacktrace.h>
> -#include <asm/irq_regs.h>
> -#include <asm/exec.h>
>
> #ifdef CONFIG_HOTPLUG_CPU
> void arch_cpu_idle_dead(void)
> --
> 2.1.0
>

2021-01-15 14:49:05

by Thomas Bogendoerfer

[permalink] [raw]
Subject: Re: [PATCH 1/4] MIPS: process: Reorder header files

On Tue, Jan 12, 2021 at 08:29:14PM +0800, Jinyang He wrote:
> Just reorder the header files.

This alone isn't worth a commit, IMHO. I bet there are lots of includes
no longer needed, so removing and sorting them is ok for me.

Thomas.

--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]

2021-01-18 11:34:11

by Jinyang He

[permalink] [raw]
Subject: Re: [PATCH 1/4] MIPS: process: Reorder header files

Ping?

On 01/18/2021 06:02 PM, Jinyang He wrote:
> On 01/15/2021 10:46 PM, Thomas Bogendoerfer wrote:
>
>> On Tue, Jan 12, 2021 at 08:29:14PM +0800, Jinyang He wrote:
>>> Just reorder the header files.
>> This alone isn't worth a commit, IMHO. I bet there are lots of includes
>> no longer needed, so removing and sorting them is ok for me.
>>
>> Thomas.
>>
>
> Hi, Thomas,
>
> Thanks for your advice. I analyzed majority of the symbols in this file.
> The following are examples of header file references:
>
> Space indicates that it cannot be found. (Maybe I missed it.)
>
> Header files Examples in
> this file
> #include <linux/completion.h>
> * #include <linux/cpu.h> get_online_cpus
> * #include <linux/errno.h> EOPNOTSUPP
> #include <linux/export.h>
> * #include <linux/init.h> arch_initcall
> * #include <linux/kallsyms.h> kallsyms_lookup_name
> * #include <linux/kernel.h> __kernel_text_address
> #include <linux/mm.h>
> #include <linux/mman.h>
> * #include <linux/nmi.h> nmi_cpu_backtrace
> * #include <linux/personality.h> ADDR_NO_RANDOMIZE
> #include <linux/ptrace.h>
> * #include <linux/prctl.h> PR_FP_MODE_FR
> #include <linux/random.h>
> * #include <linux/sched.h> PF_KTHREAD
> * #include <linux/sched/debug.h> in_sched_functions
> #include <linux/sched/task.h>
> * #include <linux/sched/task_stack.h> task_stack_page
> #include <linux/stddef.h>
> #include <linux/sys.h>
> #include <linux/tick.h>
> #include <linux/uaccess.h>
> #include <linux/unistd.h>
>
> * #include <asm/abi.h> current->thread.abi->vdso->size
> * #include <asm/asm.h> ALMASK
> #include <asm/bootinfo.h>
> #include <asm/cpu.h>
> * #include <asm/dsemul.h> dsemul_thread_cleanup
> * #include <asm/dsp.h> init_dsp
> #include <asm/elf.h>
> #include <asm/exec.h>
> * #include <asm/fpu.h> lose_fpu
> * #include <asm/inst.h> mips_instruction
> #include <asm/io.h>
> * #include <asm/irq.h> on_irq_stack
> * #include <asm/irq_regs.h> get_irq_regs
> * #include <asm/isadep.h> KU_USER
> #include <asm/mips-cps.h>
> * #include <asm/msa.h> is_msa_enabled
> * #include <asm/mipsregs.h> ST0_CU0
> * #include <asm/processor.h> VDSO_RANDOMIZE_SIZE
> * #include <asm/reg.h> MIPS32_EF_R1
> #include <asm/stacktrace.h>
>
>
> Here about this file config is:
>
> Enable:
> CONFIG_HOTPLUG_CPU, CONFIG_MIPS_FP_SUPPORT, CONFIG_STACKPROTECTOR,
> CONFIG_CPU_LOONGSON64, CONFIG_KALLSYMS, CONFIG_64BIT
>
> Disable:
> CONFIG_CPU_R3000, CONFIG_CPU_TX39XX, CONFIG_MIPS_MT_FPAFF,
> CONFIG_CPU_MICROMIPS
> CONFIG_MIPS_O32_FP64_SUPPORT, CONFIG_32BIT, CONFIG_MIPS32_O32
>
> By including only these header files which marked by '*', I have been
> able
> to compile and use certain functions (unwind_stack) normally. So are
> other
> header files no longer needed?
>
> In addition, <linux/cpu.h> includes <linux/cpumask.h>, and
> <linux/cpumask.h>
> includes <linux/kernel.h>. What should we do?
>
> Thanks,
> Jinyang

2021-01-18 21:40:15

by Jinyang He

[permalink] [raw]
Subject: Re: [PATCH 1/4] MIPS: process: Reorder header files

On 01/15/2021 10:46 PM, Thomas Bogendoerfer wrote:

> On Tue, Jan 12, 2021 at 08:29:14PM +0800, Jinyang He wrote:
>> Just reorder the header files.
> This alone isn't worth a commit, IMHO. I bet there are lots of includes
> no longer needed, so removing and sorting them is ok for me.
>
> Thomas.
>

Hi, Thomas,

Thanks for your advice. I analyzed majority of the symbols in this file.
The following are examples of header file references:

Space indicates that it cannot be found. (Maybe I missed it.)

Header files Examples in this file
#include <linux/completion.h>
* #include <linux/cpu.h> get_online_cpus
* #include <linux/errno.h> EOPNOTSUPP
#include <linux/export.h>
* #include <linux/init.h> arch_initcall
* #include <linux/kallsyms.h> kallsyms_lookup_name
* #include <linux/kernel.h> __kernel_text_address
#include <linux/mm.h>
#include <linux/mman.h>
* #include <linux/nmi.h> nmi_cpu_backtrace
* #include <linux/personality.h> ADDR_NO_RANDOMIZE
#include <linux/ptrace.h>
* #include <linux/prctl.h> PR_FP_MODE_FR
#include <linux/random.h>
* #include <linux/sched.h> PF_KTHREAD
* #include <linux/sched/debug.h> in_sched_functions
#include <linux/sched/task.h>
* #include <linux/sched/task_stack.h> task_stack_page
#include <linux/stddef.h>
#include <linux/sys.h>
#include <linux/tick.h>
#include <linux/uaccess.h>
#include <linux/unistd.h>

* #include <asm/abi.h> current->thread.abi->vdso->size
* #include <asm/asm.h> ALMASK
#include <asm/bootinfo.h>
#include <asm/cpu.h>
* #include <asm/dsemul.h> dsemul_thread_cleanup
* #include <asm/dsp.h> init_dsp
#include <asm/elf.h>
#include <asm/exec.h>
* #include <asm/fpu.h> lose_fpu
* #include <asm/inst.h> mips_instruction
#include <asm/io.h>
* #include <asm/irq.h> on_irq_stack
* #include <asm/irq_regs.h> get_irq_regs
* #include <asm/isadep.h> KU_USER
#include <asm/mips-cps.h>
* #include <asm/msa.h> is_msa_enabled
* #include <asm/mipsregs.h> ST0_CU0
* #include <asm/processor.h> VDSO_RANDOMIZE_SIZE
* #include <asm/reg.h> MIPS32_EF_R1
#include <asm/stacktrace.h>


Here about this file config is:

Enable:
CONFIG_HOTPLUG_CPU, CONFIG_MIPS_FP_SUPPORT, CONFIG_STACKPROTECTOR,
CONFIG_CPU_LOONGSON64, CONFIG_KALLSYMS, CONFIG_64BIT

Disable:
CONFIG_CPU_R3000, CONFIG_CPU_TX39XX, CONFIG_MIPS_MT_FPAFF,
CONFIG_CPU_MICROMIPS
CONFIG_MIPS_O32_FP64_SUPPORT, CONFIG_32BIT, CONFIG_MIPS32_O32

By including only these header files which marked by '*', I have been able
to compile and use certain functions (unwind_stack) normally. So are other
header files no longer needed?

In addition, <linux/cpu.h> includes <linux/cpumask.h>, and <linux/cpumask.h>
includes <linux/kernel.h>. What should we do?

Thanks,
Jinyang

2021-01-18 22:14:37

by Thomas Bogendoerfer

[permalink] [raw]
Subject: Re: [PATCH 1/4] MIPS: process: Reorder header files

On Mon, Jan 18, 2021 at 06:02:08PM +0800, Jinyang He wrote:
> On 01/15/2021 10:46 PM, Thomas Bogendoerfer wrote:
>
> > On Tue, Jan 12, 2021 at 08:29:14PM +0800, Jinyang He wrote:
> > > Just reorder the header files.
> > This alone isn't worth a commit, IMHO. I bet there are lots of includes
> > no longer needed, so removing and sorting them is ok for me.
> >
> > Thomas.
> >
>
> Hi, Thomas,
>
> Thanks for your advice. I analyzed majority of the symbols in this file.
> The following are examples of header file references:
>
> Space indicates that it cannot be found. (Maybe I missed it.)
>
> Header files Examples in this file
> #include <linux/completion.h>
> * #include <linux/cpu.h> get_online_cpus
> * #include <linux/errno.h> EOPNOTSUPP
> [..]

thank you for doing this.

> By including only these header files which marked by '*', I have been able
> to compile and use certain functions (unwind_stack) normally. So are other
> header files no longer needed?
>
> In addition, <linux/cpu.h> includes <linux/cpumask.h>, and <linux/cpumask.h>
> includes <linux/kernel.h>. What should we do?

send a patch, which deletes the not needed #includes ;-)

Thomas.

--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]