Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp276874ybg; Tue, 28 Jul 2020 05:58:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGIch4jLkNS1zEr3YzLLDKm8tG73czql/bCm7ytycJVpW5erVFEkEWj23d78i5dGVGSAZW X-Received: by 2002:a17:906:1ed3:: with SMTP id m19mr19156244ejj.396.1595941129063; Tue, 28 Jul 2020 05:58:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595941129; cv=none; d=google.com; s=arc-20160816; b=vOAyf5G8CJj4i7oyfP9u5DomZHPCjC63zU0MZD+YF/DjUHg82DP8LCtJ5G2Qhdh1ga fanI6LhPsbxgPtLnwghMcY7I/GR4/4WO9JcetuQhKmvzpgNEOu/9Kw17UM2O2yOc32Ta tvieNXNhucrQvyQburCV8AxpMizsCCSpw7mZs+4uwmyVezneXtaVRgJLNe4G2GbPvewp DlGEFa1yx3AjIXVtOInjiQkhG3f1c8lEHLaKkEsSQT721myMn1uoWSvtG4Ya4I5XVY2O QcxFJFsM3LNPDKXTcz9bvS2WRYpOZs/0J89lsUzZWiWBdsIyRZ23/t9JlN0H6DZDfs42 mQLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=BU1hodqvtbX0rLzIqBYqUkpABxuR+vsIUL5+q4txYyw=; b=HA+8stsvDk18o/yf7XhDMVsvDXmTvxUWOS82czo6uuZcPeaoGpM7xcbvcfvebiOiXZ BZhvEZ47gX1ZcTvN2NX5qDVV0s7R1AJLbAJGQt3TvqTbtXPq4iloEneaBHLDe7bUOBlY geB+Y6UWpdaonEwk/j2qv+cd4E9ZtbVwdV780RwNXOhPt3c8gnDUyy5ciV/eEXq2upYt R/4JiMGBSiyyaF46Uudc/gbnhqMsCkxQ7GBji41TkXM7dHzu92ft27Eg5oZ8BWPfRPFo qEvgjbutHGCEXT6KHOleHiJXL2P8Rmo3SY13Rhx3JuetiUsuRDcdMEfnoRsXAwI4VExM tb/w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 17si6758341ejw.686.2020.07.28.05.58.26; Tue, 28 Jul 2020 05:58:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729751AbgG1M5I (ORCPT + 99 others); Tue, 28 Jul 2020 08:57:08 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:8844 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729622AbgG1M5H (ORCPT ); Tue, 28 Jul 2020 08:57:07 -0400 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 84C4B6635318109F9F2B; Tue, 28 Jul 2020 20:57:04 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.487.0; Tue, 28 Jul 2020 20:56:59 +0800 From: Tian Tao To: , , , , , , , , CC: Subject: [PATCH v3] drm/hisilicon: Fixed the warning: Assignment of 0/1 to bool variable Date: Tue, 28 Jul 2020 20:55:07 +0800 Message-ID: <1595940907-17874-1-git-send-email-tiantao6@hisilicon.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. v2: using the pci_dev.msi_enabled instead of priv->msi_enabled. v3: just call pci_enable_msi() and pci_disable_msi(), it's no need to set dev->pdev->msi_enabled again. Signed-off-by: Tian Tao --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 5 +---- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h | 1 - 2 files changed, 1 insertion(+), 5 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..b8d839a 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c @@ -254,9 +254,8 @@ static int hibmc_unload(struct drm_device *dev) if (dev->irq_enabled) drm_irq_uninstall(dev); - if (priv->msi_enabled) - pci_disable_msi(dev->pdev); + pci_disable_msi(dev->pdev); hibmc_kms_fini(priv); hibmc_mm_fini(priv); dev->dev_private = NULL; @@ -294,12 +293,10 @@ static int hibmc_load(struct drm_device *dev) goto err; } - priv->msi_enabled = 0; ret = pci_enable_msi(dev->pdev); if (ret) { DRM_WARN("enabling MSI failed: %d\n", ret); } else { - priv->msi_enabled = 1; ret = drm_irq_install(dev, dev->pdev->irq); if (ret) DRM_WARN("install irq failed: %d\n", ret); diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h index 6097687..a683763 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h @@ -25,7 +25,6 @@ struct hibmc_drm_private { void __iomem *fb_map; unsigned long fb_base; unsigned long fb_size; - bool msi_enabled; /* drm */ struct drm_device *dev; -- 2.7.4