lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6805e9e3-e891-fb0c-0937-83709a9d18c0@csgroup.eu>
Date:   Mon, 21 Mar 2022 08:55:36 +0000
From:   Christophe Leroy <christophe.leroy@...roup.eu>
To:     Finn Thain <fthain@...ux-m68k.org>
CC:     Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Randy Dunlap <rdunlap@...radead.org>,
        "linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] macintosh/via-pmu: Fix compiler warnings when
 CONFIG_PROC_FS is disabled



Le 21/03/2022 à 09:33, Finn Thain a écrit :
> 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.

Then now you have callers of proc_create_single_data() inside the ifdefs 
and then you have an additional #ifdef in the middle of 
via_pmu_dev_init() and also have to ifdef out all proc_pmu_xxxx.

I thing ifdefing out the prototypes would be less churn.

Christophe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ