2020-07-02 12:59:15

by Tian Tao

[permalink] [raw]
Subject: [PATCH] drm/hisilicon: Fixed the warning: Assignment of 0/1 to bool variable

fixed the following warning:
hibmc_drm_drv.c:296:1-18:WARNING: Assignment of 0/1 to bool variable.
hibmc_drm_drv.c:301:2-19: WARNING: Assignment of 0/1 to bool variable.

Signed-off-by: Tian Tao <[email protected]>
---
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
index 249c298..2fc0c97 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
@@ -294,12 +294,12 @@ static int hibmc_load(struct drm_device *dev)
goto err;
}

- priv->msi_enabled = 0;
+ priv->msi_enabled = false;
ret = pci_enable_msi(dev->pdev);
if (ret) {
DRM_WARN("enabling MSI failed: %d\n", ret);
} else {
- priv->msi_enabled = 1;
+ priv->msi_enabled = true;
ret = drm_irq_install(dev, dev->pdev->irq);
if (ret)
DRM_WARN("install irq failed: %d\n", ret);
--
2.7.4


2020-07-03 06:48:25

by Thomas Zimmermann

[permalink] [raw]
Subject: Re: [PATCH] drm/hisilicon: Fixed the warning: Assignment of 0/1 to bool variable

Hi

thanks for improving the driver.

Am 02.07.20 um 14:54 schrieb Tian Tao:
> fixed the following warning:
> hibmc_drm_drv.c:296:1-18:WARNING: Assignment of 0/1 to bool variable.
> hibmc_drm_drv.c:301:2-19: WARNING: Assignment of 0/1 to bool variable.
>
> Signed-off-by: Tian Tao <[email protected]>
> ---
> drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> index 249c298..2fc0c97 100644
> --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
> @@ -294,12 +294,12 @@ static int hibmc_load(struct drm_device *dev)
> goto err;
> }
>
> - priv->msi_enabled = 0;
> + priv->msi_enabled = false;
> ret = pci_enable_msi(dev->pdev);

priv->msi_enabled is unused by the driver. Better remove it entirely. If
the MSI flag will be required later, there's already struct
pci_dev.msi_enabled.

Apart from that, the one-by-one approach to patching is somewhat
tedious. Could you collect patches and send them out in batches? It
would make reviewing easier and give reviewers an idea of where you're
going with the driver.

Best regards
Thomas

> if (ret) {
> DRM_WARN("enabling MSI failed: %d\n", ret);
> } else {
> - priv->msi_enabled = 1;
> + priv->msi_enabled = true;
> ret = drm_irq_install(dev, dev->pdev->irq);
> if (ret)
> DRM_WARN("install irq failed: %d\n", ret);
>

--
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


Attachments:
signature.asc (527.00 B)
OpenPGP digital signature