* [PATCH -next] powerpc/spufs: Fix build warning when CONFIG_PROC_FS=n
@ 2022-03-05 12:31 YueHaibing
2022-03-06 20:04 ` Christophe Leroy
0 siblings, 1 reply; 5+ messages in thread
From: YueHaibing @ 2022-03-05 12:31 UTC (permalink / raw)
To: jk, arnd, mpe, benh, paulus; +Cc: linuxppc-dev, linux-kernel, YueHaibing
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)
^~~~~~~~~~~~~~~~
Mark this as __maybe_unused to fix this.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
arch/powerpc/platforms/cell/spufs/sched.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c
index d058f6233e66..c46835625133 100644
--- a/arch/powerpc/platforms/cell/spufs/sched.c
+++ b/arch/powerpc/platforms/cell/spufs/sched.c
@@ -1052,7 +1052,7 @@ void spuctx_switch_state(struct spu_context *ctx,
}
}
-static int show_spu_loadavg(struct seq_file *s, void *private)
+static int __maybe_unused show_spu_loadavg(struct seq_file *s, void *private)
{
int a, b, c;
--
2.17.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH -next] powerpc/spufs: Fix build warning when CONFIG_PROC_FS=n
2022-03-05 12:31 [PATCH -next] powerpc/spufs: Fix build warning when CONFIG_PROC_FS=n YueHaibing
@ 2022-03-06 20:04 ` Christophe Leroy
2022-03-07 13:10 ` Arnd Bergmann
0 siblings, 1 reply; 5+ messages in thread
From: Christophe Leroy @ 2022-03-06 20:04 UTC (permalink / raw)
To: YueHaibing, jk, arnd, mpe, benh, paulus; +Cc: linuxppc-dev, linux-kernel
Le 05/03/2022 à 13:31, 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)
> ^~~~~~~~~~~~~~~~
>
> Mark this as __maybe_unused to fix this.
Marking it as __maybe_unused doesn't fix it. It just pushes the dust
under the carpet.
proc_create_single macro should be fix to avoid that warning.
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
> arch/powerpc/platforms/cell/spufs/sched.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c
> index d058f6233e66..c46835625133 100644
> --- a/arch/powerpc/platforms/cell/spufs/sched.c
> +++ b/arch/powerpc/platforms/cell/spufs/sched.c
> @@ -1052,7 +1052,7 @@ void spuctx_switch_state(struct spu_context *ctx,
> }
> }
>
> -static int show_spu_loadavg(struct seq_file *s, void *private)
> +static int __maybe_unused show_spu_loadavg(struct seq_file *s, void *private)
> {
> int a, b, c;
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH -next] powerpc/spufs: Fix build warning when CONFIG_PROC_FS=n
2022-03-06 20:04 ` Christophe Leroy
@ 2022-03-07 13:10 ` Arnd Bergmann
2022-03-07 13:30 ` Christophe Leroy
0 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2022-03-07 13:10 UTC (permalink / raw)
To: Christophe Leroy
Cc: YueHaibing, jk, arnd, mpe, benh, paulus, linuxppc-dev, linux-kernel
On Sun, Mar 6, 2022 at 9:04 PM Christophe Leroy
<christophe.leroy@csgroup.eu> wrote:
> Le 05/03/2022 à 13:31, 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)
> > ^~~~~~~~~~~~~~~~
> >
> > Mark this as __maybe_unused to fix this.
>
> Marking it as __maybe_unused doesn't fix it. It just pushes the dust
> under the carpet.
>
> proc_create_single macro should be fix to avoid that warning.
We discussed that when proc_create_single() was introduced, but ended up
not doing it that way because there were already a lot of files using an #ifdef
around the function definitions. To change it back, one would have to audit
every user of proc_create_single() and remove the #ifdefs.
Arnd
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH -next] powerpc/spufs: Fix build warning when CONFIG_PROC_FS=n
2022-03-07 13:10 ` Arnd Bergmann
@ 2022-03-07 13:30 ` Christophe Leroy
2022-03-08 9:51 ` YueHaibing
0 siblings, 1 reply; 5+ messages in thread
From: Christophe Leroy @ 2022-03-07 13:30 UTC (permalink / raw)
To: Arnd Bergmann
Cc: YueHaibing, jk, mpe, benh, paulus, linuxppc-dev, linux-kernel
Le 07/03/2022 à 14:10, Arnd Bergmann a écrit :
> On Sun, Mar 6, 2022 at 9:04 PM Christophe Leroy
> <christophe.leroy@csgroup.eu> wrote:
>> Le 05/03/2022 à 13:31, 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)
>>> ^~~~~~~~~~~~~~~~
>>>
>>> Mark this as __maybe_unused to fix this.
>>
>> Marking it as __maybe_unused doesn't fix it. It just pushes the dust
>> under the carpet.
>>
>> proc_create_single macro should be fix to avoid that warning.
>
> We discussed that when proc_create_single() was introduced, but ended up
> not doing it that way because there were already a lot of files using an #ifdef
> around the function definitions. To change it back, one would have to audit
> every user of proc_create_single() and remove the #ifdefs.
>
Fair enough.
In that case, I'd prefer to go for a #ifdef as well for
show_spu_loadavg() instead of going for a __maybe_unused flag.
Christophe
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH -next] powerpc/spufs: Fix build warning when CONFIG_PROC_FS=n
2022-03-07 13:30 ` Christophe Leroy
@ 2022-03-08 9:51 ` YueHaibing
0 siblings, 0 replies; 5+ messages in thread
From: YueHaibing @ 2022-03-08 9:51 UTC (permalink / raw)
To: Christophe Leroy, Arnd Bergmann
Cc: jk, mpe, benh, paulus, linuxppc-dev, linux-kernel
On 2022/3/7 21:30, Christophe Leroy wrote:
>
>
> Le 07/03/2022 à 14:10, Arnd Bergmann a écrit :
>> On Sun, Mar 6, 2022 at 9:04 PM Christophe Leroy
>> <christophe.leroy@csgroup.eu> wrote:
>>> Le 05/03/2022 à 13:31, 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)
>>>> ^~~~~~~~~~~~~~~~
>>>>
>>>> Mark this as __maybe_unused to fix this.
>>>
>>> Marking it as __maybe_unused doesn't fix it. It just pushes the dust
>>> under the carpet.
>>>
>>> proc_create_single macro should be fix to avoid that warning.
>>
>> We discussed that when proc_create_single() was introduced, but ended up
>> not doing it that way because there were already a lot of files using an #ifdef
>> around the function definitions. To change it back, one would have to audit
>> every user of proc_create_single() and remove the #ifdefs.
>>
>
> Fair enough.
>
> In that case, I'd prefer to go for a #ifdef as well for
> show_spu_loadavg() instead of going for a __maybe_unused flag.
Ok, will do that in v2.
>
> Christophe
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-03-08 9:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-05 12:31 [PATCH -next] powerpc/spufs: Fix build warning when CONFIG_PROC_FS=n YueHaibing
2022-03-06 20:04 ` Christophe Leroy
2022-03-07 13:10 ` Arnd Bergmann
2022-03-07 13:30 ` Christophe Leroy
2022-03-08 9:51 ` YueHaibing
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).