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: <SJ0PR03MB62537CAF01121AC08D236F988EDD9@SJ0PR03MB6253.namprd03.prod.outlook.com>
Date:   Mon, 30 May 2022 10:06:44 +0000
From:   "Hennerich, Michael" <Michael.Hennerich@...log.com>
To:     Dmitry Torokhov <dmitry.torokhov@...il.com>
CC:     Uwe Kleine-König 
        <u.kleine-koenig@...gutronix.de>,
        "linux-input@...r.kernel.org" <linux-input@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 1/4] Input: adp5588-keys - drop CONFIG_PM guards



> -----Original Message-----
> From: Dmitry Torokhov <dmitry.torokhov@...il.com>
> Sent: Samstag, 28. Mai 2022 06:56
> To: Hennerich, Michael <Michael.Hennerich@...log.com>
> Cc: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>; linux-
> input@...r.kernel.org; linux-kernel@...r.kernel.org
> Subject: [PATCH 1/4] Input: adp5588-keys - drop CONFIG_PM guards
> 
> 
> To improve compile-time coverage let's drop #ifdef CONFIG_PM guards and
> use SIMPLE_DEV_PM_OPS and __maybe_unused attributes and rely on the
> linker to drop unused code.
> 
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@...il.com>

Acked-by: Michael Hennerich <michael.hennerich@...log.com>

> ---
> 
> Since we are talking about keeping the driver and switching it away from
> platform data and towards device properties, here are some cleanups.
> 
> Only compiled, not tested.
> 
>  drivers/input/keyboard/adp5588-keys.c | 13 +++----------
>  1 file changed, 3 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/input/keyboard/adp5588-keys.c
> b/drivers/input/keyboard/adp5588-keys.c
> index 1592da4de336..ea67d0834be1 100644
> --- a/drivers/input/keyboard/adp5588-keys.c
> +++ b/drivers/input/keyboard/adp5588-keys.c
> @@ -612,8 +612,7 @@ static int adp5588_remove(struct i2c_client *client)
>  	return 0;
>  }
> 
> -#ifdef CONFIG_PM
> -static int adp5588_suspend(struct device *dev)
> +static int __maybe_unused adp5588_suspend(struct device *dev)
>  {
>  	struct adp5588_kpad *kpad = dev_get_drvdata(dev);
>  	struct i2c_client *client = kpad->client; @@ -627,7 +626,7 @@ static
> int adp5588_suspend(struct device *dev)
>  	return 0;
>  }
> 
> -static int adp5588_resume(struct device *dev)
> +static int __maybe_unused adp5588_resume(struct device *dev)
>  {
>  	struct adp5588_kpad *kpad = dev_get_drvdata(dev);
>  	struct i2c_client *client = kpad->client; @@ -640,11 +639,7 @@ static
> int adp5588_resume(struct device *dev)
>  	return 0;
>  }
> 
> -static const struct dev_pm_ops adp5588_dev_pm_ops = {
> -	.suspend = adp5588_suspend,
> -	.resume  = adp5588_resume,
> -};
> -#endif
> +static SIMPLE_DEV_PM_OPS(adp5588_dev_pm_ops, adp5588_suspend,
> +adp5588_resume);
> 
>  static const struct i2c_device_id adp5588_id[] = {
>  	{ "adp5588-keys", 0 },
> @@ -656,9 +651,7 @@ MODULE_DEVICE_TABLE(i2c, adp5588_id);  static
> struct i2c_driver adp5588_driver = {
>  	.driver = {
>  		.name = KBUILD_MODNAME,
> -#ifdef CONFIG_PM
>  		.pm   = &adp5588_dev_pm_ops,
> -#endif
>  	},
>  	.probe    = adp5588_probe,
>  	.remove   = adp5588_remove,
> --
> 2.36.1.124.g0e6072fb45-goog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ