mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiaxun Yang <jiaxun.yang@flygoat.com>
To: zhaoxiao <zhaoxiao@uniontech.com>,
	linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: tsbogend@alpha.franken.de
Subject: Re: [PATCH] arch/mips/kernel/asm-offsets.c: Make local functions static
Date: Wed, 19 May 2021 22:04:35 +0800	[thread overview]
Message-ID: <8223a6cd-ff3b-d105-0a95-30d5a4d1194e@flygoat.com> (raw)
In-Reply-To: <20210519062804.30047-1-zhaoxiao@uniontech.com>



在 2021/5/19 14:28, zhaoxiao 写道:
> Fixes the following W=1 kernel build warning(s):
> arch/mips/kernel/asm-offsets.c:26:6: warning: no previous prototype for 'output_ptreg_defines' [-Wmissing-prototypes]
>   void output_ptreg_defines(void)
>        ^~~~~~~~~~~~~~~~~~~~
> arch/mips/kernel/asm-offsets.c:78:6: warning: no previous prototype for 'output_task_defines' [-Wmissing-prototypes]
>   void output_task_defines(void)
>        ^~~~~~~~~~~~~~~~~~~
> arch/mips/kernel/asm-offsets.c:93:6: warning: no previous prototype for 'output_thread_info_defines' [-Wmissing-prototypes]
>   void output_thread_info_defines(void)
>        ^~~~~~~~~~~~~~~~~~~~~~~~~~
> arch/mips/kernel/asm-offsets.c:109:6: warning: no previous prototype for 'output_thread_defines' [-Wmissing-prototypes]
>   void output_thread_defines(void)
>        ^~~~~~~~~~~~~~~~~~~~~
> arch/mips/kernel/asm-offsets.c:137:6: warning: no previous prototype for 'output_thread_fpu_defines' [-Wmissing-prototypes]
>   void output_thread_fpu_defines(void)
>        ^~~~~~~~~~~~~~~~~~~~~~~~~
> arch/mips/kernel/asm-offsets.c:180:6: warning: no previous prototype for 'output_mm_defines' [-Wmissing-prototypes]
>   void output_mm_defines(void)
>        ^~~~~~~~~~~~~~~~~
> arch/mips/kernel/asm-offsets.c:241:6: warning: no previous prototype for 'output_sc_defines' [-Wmissing-prototypes]
>   void output_sc_defines(void)
>        ^~~~~~~~~~~~~~~~~
> arch/mips/kernel/asm-offsets.c:254:6: warning: no previous prototype for 'output_signal_defined' [-Wmissing-prototypes]
>   void output_signal_defined(void)
>        ^~~~~~~~~~~~~~~~~~~~~
> arch/mips/kernel/asm-offsets.c:347:6: warning: no previous prototype for 'output_kvm_defines' [-Wmissing-prototypes]
>   void output_kvm_defines(void)

The same... they're supposed to be used by asm-offset generator.
If you don't understand how it works there is an article[1] in Chinese.

You may try __used attribute to bypass these warning.

Thanks.

[1]: https://insidelinuxdev.net/article/a030fi.html

- Jiaxun
>
> Signed-off-by: zhaoxiao <zhaoxiao@uniontech.com>
> ---
>   arch/mips/kernel/asm-offsets.c | 20 ++++++++++----------
>   1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/arch/mips/kernel/asm-offsets.c b/arch/mips/kernel/asm-offsets.c
> index 5735b2cd6f2a..2dc1ecb12c00 100644
> --- a/arch/mips/kernel/asm-offsets.c
> +++ b/arch/mips/kernel/asm-offsets.c
> @@ -23,7 +23,7 @@
>   
>   #include <linux/kvm_host.h>
>   
> -void output_ptreg_defines(void)
> +static void output_ptreg_defines(void)
>   {
>   	COMMENT("MIPS pt_regs offsets.");
>   	OFFSET(PT_R0, pt_regs, regs[0]);
> @@ -75,7 +75,7 @@ void output_ptreg_defines(void)
>   	BLANK();
>   }
>   
> -void output_task_defines(void)
> +static void output_task_defines(void)
>   {
>   	COMMENT("MIPS task_struct offsets.");
>   	OFFSET(TASK_STATE, task_struct, state);
> @@ -90,7 +90,7 @@ void output_task_defines(void)
>   	BLANK();
>   }
>   
> -void output_thread_info_defines(void)
> +static void output_thread_info_defines(void)
>   {
>   	COMMENT("MIPS thread_info offsets.");
>   	OFFSET(TI_TASK, thread_info, task);
> @@ -106,7 +106,7 @@ void output_thread_info_defines(void)
>   	BLANK();
>   }
>   
> -void output_thread_defines(void)
> +static void output_thread_defines(void)
>   {
>   	COMMENT("MIPS specific thread_struct offsets.");
>   	OFFSET(THREAD_REG16, task_struct, thread.reg16);
> @@ -134,7 +134,7 @@ void output_thread_defines(void)
>   }
>   
>   #ifdef CONFIG_MIPS_FP_SUPPORT
> -void output_thread_fpu_defines(void)
> +static void output_thread_fpu_defines(void)
>   {
>   	OFFSET(THREAD_FPU, task_struct, thread.fpu);
>   
> @@ -177,7 +177,7 @@ void output_thread_fpu_defines(void)
>   }
>   #endif
>   
> -void output_mm_defines(void)
> +static void output_mm_defines(void)
>   {
>   	COMMENT("Size of struct page");
>   	DEFINE(STRUCT_PAGE_SIZE, sizeof(struct page));
> @@ -216,7 +216,7 @@ void output_mm_defines(void)
>   }
>   
>   #ifdef CONFIG_32BIT
> -void output_sc_defines(void)
> +static void output_sc_defines(void)
>   {
>   	COMMENT("Linux sigcontext offsets.");
>   	OFFSET(SC_REGS, sigcontext, sc_regs);
> @@ -238,7 +238,7 @@ void output_sc_defines(void)
>   #endif
>   
>   #ifdef CONFIG_64BIT
> -void output_sc_defines(void)
> +static void output_sc_defines(void)
>   {
>   	COMMENT("Linux sigcontext offsets.");
>   	OFFSET(SC_REGS, sigcontext, sc_regs);
> @@ -251,7 +251,7 @@ void output_sc_defines(void)
>   }
>   #endif
>   
> -void output_signal_defined(void)
> +static void output_signal_defined(void)
>   {
>   	COMMENT("Linux signal numbers.");
>   	DEFINE(_SIGHUP, SIGHUP);
> @@ -344,7 +344,7 @@ void output_pm_defines(void)
>   #endif
>   
>   #ifdef CONFIG_MIPS_FP_SUPPORT
> -void output_kvm_defines(void)
> +static void output_kvm_defines(void)
>   {
>   	COMMENT(" KVM/MIPS Specific offsets. ");
>   


      reply	other threads:[~2021-05-19 14:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-19  6:28 zhaoxiao
2021-05-19 14:04 ` Jiaxun Yang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8223a6cd-ff3b-d105-0a95-30d5a4d1194e@flygoat.com \
    --to=jiaxun.yang@flygoat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=tsbogend@alpha.franken.de \
    --cc=zhaoxiao@uniontech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®