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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdWVedppkaO5sF4WH78e8rdVJKXJknFVEZQo+VD2Rxmk=A@mail.gmail.com>
Date:	Tue, 10 Jan 2012 21:47:40 +0100
From:	Geert Uytterhoeven <geert@...ux-m68k.org>
To:	JJ Ding <jj_ding@....com.tw>
Cc:	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	Greg Kroah-Hartman <gregkh@...e.de>,
	Grant Likely <grant.likely@...retlab.ca>,
	linux-kernel@...r.kernel.org, linux-input@...r.kernel.org,
	JJ Ding <dgdunix@...il.com>
Subject: Re: [PATCH TRIVIAL 1/5] Input: keyboard: use macro module_platform_driver()

On Tue, Nov 22, 2011 at 10:00, JJ Ding <jj_ding@....com.tw> wrote:
> From: JJ Ding <dgdunix@...il.com>
>
> Commit 940ab88962bc1aff3273a8356d64577a6e386736 introduced a new macro to
> save some platform_driver boilerplate code. Use it.

> diff --git a/drivers/input/keyboard/amikbd.c b/drivers/input/keyboard/amikbd.c
> index 79172af..6df5f6a 100644
> --- a/drivers/input/keyboard/amikbd.c
> +++ b/drivers/input/keyboard/amikbd.c
> @@ -259,19 +259,6 @@ static struct platform_driver amikbd_driver = {
>                .owner  = THIS_MODULE,
>        },
>  };
> -
> -static int __init amikbd_init(void)
> -{
> -       return platform_driver_probe(&amikbd_driver, amikbd_probe);
> -}
> -
> -module_init(amikbd_init);
> -
> -static void __exit amikbd_exit(void)
> -{
> -       platform_driver_unregister(&amikbd_driver);
> -}
> -
> -module_exit(amikbd_exit);
> +module_platform_driver(amikbd_driver);
>
>  MODULE_ALIAS("platform:amiga-keyboard");

Sorry for not noticing before, but this is not correct.
Drivers using platform_driver_probe() typically don't fill in the
platform_driver.probe
method, as it's passed explicitly to platform_driver_probe() instead.
Hence amikbd_probe() is now referenced nowhere, and thus never called
(doesn't the compiler warn about amikbd_probe() being defined but unused?).

> diff --git a/drivers/input/keyboard/davinci_keyscan.c b/drivers/input/keyboard/davinci_keyscan.c
> index 9d82b3a..4698252 100644
> --- a/drivers/input/keyboard/davinci_keyscan.c
> +++ b/drivers/input/keyboard/davinci_keyscan.c
> @@ -328,18 +328,7 @@ static struct platform_driver davinci_ks_driver = {
>        },
>        .remove = __devexit_p(davinci_ks_remove),
>  };
> -
> -static int __init davinci_ks_init(void)
> -{
> -       return platform_driver_probe(&davinci_ks_driver, davinci_ks_probe);
> -}
> -module_init(davinci_ks_init);
> -
> -static void __exit davinci_ks_exit(void)
> -{
> -       platform_driver_unregister(&davinci_ks_driver);
> -}
> -module_exit(davinci_ks_exit);
> +module_platform_driver(davinci_ks_driver);
>
>  MODULE_AUTHOR("Miguel Aguilar");
>  MODULE_DESCRIPTION("Texas Instruments DaVinci Key Scan Driver");

Same here, I think.

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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ