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]
Date:   Tue, 7 Sep 2021 15:19:13 +0200
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     Arnd Bergmann <arnd@...nel.org>
Cc:     "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Arnd Bergmann <arnd@...db.de>, Armin Wolf <W_Armin@....de>,
        netdev <netdev@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ne2000: fix unused function warning

Hi Arnd,

Thanks for your patch!

On Tue, Sep 7, 2021 at 3:10 PM Arnd Bergmann <arnd@...nel.org> wrote:
> From: Arnd Bergmann <arnd@...db.de>
>
> Geert noticed a warning on MIPS TX49xx:
>
> drivers/net/ethernet/8390/ne.c:909:20: warning: ‘ne_add_devices’ defined but not used [-Wunused-function]

And on Atari.

>
> Move the function into the #ifdef section that contains its
> only caller.

What about the second caller inside #ifdef MODULE?

> Fixes: 4228c3942821 ("make legacy ISA probe optional")
> Reported-by: Geert Uytterhoeven <geert@...ux-m68k.org>
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> --- a/drivers/net/ethernet/8390/ne.c
> +++ b/drivers/net/ethernet/8390/ne.c
> @@ -906,22 +906,6 @@ static struct platform_driver ne_driver = {
>         },
>  };
>
> -static void __init ne_add_devices(void)
> -{
> -       int this_dev;
> -       struct platform_device *pdev;
> -
> -       for (this_dev = 0; this_dev < MAX_NE_CARDS; this_dev++) {
> -               if (pdev_ne[this_dev])
> -                       continue;
> -               pdev = platform_device_register_simple(
> -                       DRV_NAME, this_dev, NULL, 0);
> -               if (IS_ERR(pdev))
> -                       continue;
> -               pdev_ne[this_dev] = pdev;
> -       }
> -}
> -
>  #ifdef MODULE
>  static int __init ne_init(void)
>  {
> @@ -953,6 +937,22 @@ static int __init ne_init(void)
>  module_init(ne_init);
>
>  #ifdef CONFIG_NETDEV_LEGACY_INIT
> +static void __init ne_add_devices(void)
> +{
> +       int this_dev;
> +       struct platform_device *pdev;
> +
> +       for (this_dev = 0; this_dev < MAX_NE_CARDS; this_dev++) {
> +               if (pdev_ne[this_dev])
> +                       continue;
> +               pdev = platform_device_register_simple(
> +                       DRV_NAME, this_dev, NULL, 0);
> +               if (IS_ERR(pdev))
> +                       continue;
> +               pdev_ne[this_dev] = pdev;
> +       }
> +}
> +
>  struct net_device * __init ne_probe(int unit)
>  {
>         int this_dev;
> --
> 2.29.2
>


--
Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ