diff mbox series

[v2,-next] powerpc/spufs: Fix build warning when CONFIG_PROC_FS=n

Message ID 20220308100928.23540-1-yuehaibing@huawei.com (mailing list archive)
State Accepted
Headers show
Series [v2,-next] powerpc/spufs: Fix build warning when CONFIG_PROC_FS=n | expand

Checks

Context Check Description
snowpatch_ozlabs/github-powerpc_ppctests success Successfully ran 8 jobs.
snowpatch_ozlabs/github-powerpc_selftests success Successfully ran 8 jobs.
snowpatch_ozlabs/github-powerpc_sparse success Successfully ran 4 jobs.
snowpatch_ozlabs/github-powerpc_kernel_qemu success Successfully ran 24 jobs.
snowpatch_ozlabs/github-powerpc_clang success Successfully ran 7 jobs.

Commit Message

Yue Haibing March 8, 2022, 10:09 a.m. UTC
arch/powerpc/platforms/cell/spufs/sched.c:1055:12: warning: ‘show_spu_loadavg’ defined but not used [-Wunused-function]
 static int show_spu_loadavg(struct seq_file *s, void *private)
            ^~~~~~~~~~~~~~~~

Move it into #ifdef block to fix this, also remove unneeded semicolon.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
v2: use #ifdef instead of __maybe_unused
---
 arch/powerpc/platforms/cell/spufs/sched.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Christophe Leroy March 8, 2022, 10:17 a.m. UTC | #1
Le 08/03/2022 à 11:09, YueHaibing a écrit :
> arch/powerpc/platforms/cell/spufs/sched.c:1055:12: warning: ‘show_spu_loadavg’ defined but not used [-Wunused-function]
>   static int show_spu_loadavg(struct seq_file *s, void *private)
>              ^~~~~~~~~~~~~~~~
> 
> Move it into #ifdef block to fix this, also remove unneeded semicolon.
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>

> ---
> v2: use #ifdef instead of __maybe_unused
> ---
>   arch/powerpc/platforms/cell/spufs/sched.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c
> index d058f6233e66..99bd027a7f7c 100644
> --- a/arch/powerpc/platforms/cell/spufs/sched.c
> +++ b/arch/powerpc/platforms/cell/spufs/sched.c
> @@ -1052,6 +1052,7 @@ void spuctx_switch_state(struct spu_context *ctx,
>   	}
>   }
>   
> +#ifdef CONFIG_PROC_FS
>   static int show_spu_loadavg(struct seq_file *s, void *private)
>   {
>   	int a, b, c;
> @@ -1073,7 +1074,8 @@ static int show_spu_loadavg(struct seq_file *s, void *private)
>   		atomic_read(&nr_spu_contexts),
>   		idr_get_cursor(&task_active_pid_ns(current)->idr) - 1);
>   	return 0;
> -};
> +}
> +#endif
>   
>   int __init spu_sched_init(void)
>   {
Michael Ellerman March 12, 2022, 10:29 a.m. UTC | #2
On Tue, 8 Mar 2022 18:09:28 +0800, YueHaibing wrote:
> arch/powerpc/platforms/cell/spufs/sched.c:1055:12: warning: ‘show_spu_loadavg’ defined but not used [-Wunused-function]
>  static int show_spu_loadavg(struct seq_file *s, void *private)
>             ^~~~~~~~~~~~~~~~
> 
> Move it into #ifdef block to fix this, also remove unneeded semicolon.
> 
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc/spufs: Fix build warning when CONFIG_PROC_FS=n
      https://git.kernel.org/powerpc/c/5986f6b6575ac830ede9648cfb64353c58067a9f

cheers
diff mbox series

Patch

diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c
index d058f6233e66..99bd027a7f7c 100644
--- a/arch/powerpc/platforms/cell/spufs/sched.c
+++ b/arch/powerpc/platforms/cell/spufs/sched.c
@@ -1052,6 +1052,7 @@  void spuctx_switch_state(struct spu_context *ctx,
 	}
 }
 
+#ifdef CONFIG_PROC_FS
 static int show_spu_loadavg(struct seq_file *s, void *private)
 {
 	int a, b, c;
@@ -1073,7 +1074,8 @@  static int show_spu_loadavg(struct seq_file *s, void *private)
 		atomic_read(&nr_spu_contexts),
 		idr_get_cursor(&task_active_pid_ns(current)->idr) - 1);
 	return 0;
-};
+}
+#endif
 
 int __init spu_sched_init(void)
 {