Re: [PATCH] drm/hisilicon: Remove redundant null check

From: Thomas Zimmermann
Date: Mon Nov 02 2020 - 03:32:08 EST


Hi

Am 30.10.20 um 10:27 schrieb Tian Tao:
> drm_irq_uninstall can handle the case where dev->irq_enable is false,
> so Remove redundant null check.
>
> Signed-off-by: Tian Tao <tiantao6@xxxxxxxxxxxxx>
> ---
> drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> index 0c1b40d..b71589b1 100644
> --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> @@ -246,13 +246,13 @@ static int hibmc_unload(struct drm_device *dev)
>
> drm_atomic_helper_shutdown(dev);
>
> - if (dev->irq_enabled)
> - drm_irq_uninstall(dev);
> -
> + drm_irq_uninstall(dev);

Removing this check would at least result in an error, [1] so rather
leave it in for now.

Instead, we could discuss if drm_irq_install() should become a managed
interface.

Best regards
Thomas

[1]
https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/drm_irq.c#L201

> pci_disable_msi(dev->pdev);
> +
> hibmc_kms_fini(priv);
> hibmc_mm_fini(priv);
> dev->dev_private = NULL;
> +
> return 0;
> }
>
>

--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

Attachment: OpenPGP_0x680DC11D530B7A23.asc
Description: application/pgp-keys

Attachment: OpenPGP_signature
Description: OpenPGP digital signature