lkml.org 
[lkml]   [2022]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] macintosh/via-pmu: Fix compiler warnings when CONFIG_PROC_FS is disabled
On Mon, 21 Mar 2022, Christophe Leroy wrote:

> Le 19/03/2022 à 08:20, Finn Thain a écrit :
> > drivers/macintosh/via-pmu.c:897:12: warning: 'pmu_battery_proc_show' defined but not used [-Wunused-function]
> > static int pmu_battery_proc_show(struct seq_file *m, void *v)
> > ^~~~~~~~~~~~~~~~~~~~~
> > drivers/macintosh/via-pmu.c:871:12: warning: 'pmu_irqstats_proc_show' defined but not used [-Wunused-function]
> > static int pmu_irqstats_proc_show(struct seq_file *m, void *v)
> > ^~~~~~~~~~~~~~~~~~~~~~
> > drivers/macintosh/via-pmu.c:860:12: warning: 'pmu_info_proc_show' defined but not used [-Wunused-function]
> > static int pmu_info_proc_show(struct seq_file *m, void *v)
> > ^~~~~~~~~~~~~~~~~~
> >
> > Rearrange some code and add some #ifdefs to avoid unused code warnings
> > when CONFIG_PROC_FS is disabled.
>
> Why not just put those three functions inside an #ifdef CONFIG_PROC_FS ?
>

You'd get a warning about the prototypes ("declared static but never
defined"). Rather than add an ifdef around the prototypes as well, I just
reordered things a little.
\
 
 \ /
  Last update: 2022-03-21 09:34    [W:0.205 / U:0.416 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site