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:   Mon, 7 Nov 2022 20:43:35 +0100
From:   Hans de Goede <hdegoede@...hat.com>
To:     Paul Cercueil <paul@...pouillou.net>,
        Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
        Maxime Ripard <mripard@...nel.org>,
        Thomas Zimmermann <tzimmermann@...e.de>,
        David Airlie <airlied@...il.com>,
        Daniel Vetter <daniel@...ll.ch>
Cc:     dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 24/26] drm: gm12u320: Remove #ifdef guards for PM related
 functions

Hi,

On 11/7/22 18:55, Paul Cercueil wrote:
> Use the pm_ptr() macro to handle the .suspend / .resume / .reset_resume
> callbacks.
> 
> This macro allows the suspend and resume functions to be automatically
> dropped by the compiler when CONFIG_PM is disabled, without having
> to use #ifdef guards.
> 
> This has the advantage of always compiling these functions in,
> independently of any Kconfig option. Thanks to that, bugs and other
> regressions are subsequently easier to catch. It also allows to drop the
> __maybe_unused tags.
> 
> Signed-off-by: Paul Cercueil <paul@...pouillou.net>
> ---
> Cc: Hans de Goede <hdegoede@...hat.com>

Thanks, patch looks good to me:

Reviewed-by: Hans de Goede <hdegoede@...hat.com>

Regards,

Hans


> ---
>  drivers/gpu/drm/tiny/gm12u320.c | 15 +++++++--------
>  1 file changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tiny/gm12u320.c b/drivers/gpu/drm/tiny/gm12u320.c
> index 7441d992a5d7..0a901201142e 100644
> --- a/drivers/gpu/drm/tiny/gm12u320.c
> +++ b/drivers/gpu/drm/tiny/gm12u320.c
> @@ -4,6 +4,7 @@
>   */
>  
>  #include <linux/module.h>
> +#include <linux/pm.h>
>  #include <linux/usb.h>
>  
>  #include <drm/drm_atomic_helper.h>
> @@ -718,15 +719,15 @@ static void gm12u320_usb_disconnect(struct usb_interface *interface)
>  	drm_atomic_helper_shutdown(dev);
>  }
>  
> -static __maybe_unused int gm12u320_suspend(struct usb_interface *interface,
> -					   pm_message_t message)
> +static int gm12u320_suspend(struct usb_interface *interface,
> +			    pm_message_t message)
>  {
>  	struct drm_device *dev = usb_get_intfdata(interface);
>  
>  	return drm_mode_config_helper_suspend(dev);
>  }
>  
> -static __maybe_unused int gm12u320_resume(struct usb_interface *interface)
> +static int gm12u320_resume(struct usb_interface *interface)
>  {
>  	struct drm_device *dev = usb_get_intfdata(interface);
>  	struct gm12u320_device *gm12u320 = to_gm12u320(dev);
> @@ -747,11 +748,9 @@ static struct usb_driver gm12u320_usb_driver = {
>  	.probe = gm12u320_usb_probe,
>  	.disconnect = gm12u320_usb_disconnect,
>  	.id_table = id_table,
> -#ifdef CONFIG_PM
> -	.suspend = gm12u320_suspend,
> -	.resume = gm12u320_resume,
> -	.reset_resume = gm12u320_resume,
> -#endif
> +	.suspend = pm_ptr(gm12u320_suspend),
> +	.resume = pm_ptr(gm12u320_resume),
> +	.reset_resume = pm_ptr(gm12u320_resume),
>  };
>  
>  module_usb_driver(gm12u320_usb_driver);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ