Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp669637ybt; Mon, 6 Jul 2020 20:01:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbR0XDr4Xf+U5hhpn3F1pYbXfJValz/ZHkxPRZKC9MI8Wvq60cI2joiVVqTBhRZBfBEiMh X-Received: by 2002:a05:6402:b84:: with SMTP id cf4mr34198219edb.21.1594090880129; Mon, 06 Jul 2020 20:01:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594090880; cv=none; d=google.com; s=arc-20160816; b=HSoOT65dV/kMBI1t4g5vz3Ga7gmNiZmLQKFC5dmlJBCzfQyt/9dK1Z69tbE5RkTnIZ /PGLuVf0pqUDar3FYJbuo1zG8iHXhBtgpQHctqw/fqYsjIwEohKfwo0FD07AK+Odk21j T9/dBR6CyW4MLIANW3PeITZ8dHcJOklhqSzepqfu7IQvgF4kNJ9k+jquX8baG2VJRBfz E+SObG6L8ub9Rw0u6TMQhKgoBtLk4ZdsiOnJqYFKrVIYQkVa0mqL9pBvHFVqrvkIEI9w gPZ6g61j73SU/EAmtmc9KVoKSohrkiu7roqwUugK7ACdhxFcroBgFKQNXSdTppINGUqN fOVw== 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=digOvnoRHOtc/maNHyzICYJa//BfbLx3Fx6vbQQMFyA=; b=pwiqpyH/qx8O40AT6adw6e70gtrEPzFtHHpGLOpFmEa3oJ5+mGdelrmkTvSC0q3Oax LhWtmBG+EWYNKTJBMM//EsprJaLaNDbrtQNsXigugfaIPVPxwW4dEFiQtk6Ek5N3sqGp 1cRYSqOFu/+OmZzSIs6QnCsrQwJHhlhDDd6Mfqf+orELEJGD+91aXv3xcd5eq9do7Pbx M+4FENUO1sUzO11k7hkv24h8nVOpcl1Ofgu6bPAmrAOGmuBSt5PlAdDMgVeK8O6gP62G Nxgii6bODmWaxontQPj87ETLC4jDNflBFLg2nYL34GvAbqgzGoPof9zRi2Q+KZPQdGTn 3qVg== 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 dc26si13715429edb.329.2020.07.06.20.00.56; Mon, 06 Jul 2020 20:01:20 -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 S1727951AbgGGDAN (ORCPT + 99 others); Mon, 6 Jul 2020 23:00:13 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:7379 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727094AbgGGDAN (ORCPT ); Mon, 6 Jul 2020 23:00:13 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 93175E51EB2E6213805D; Tue, 7 Jul 2020 11:00:08 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.487.0; Tue, 7 Jul 2020 10:59:59 +0800 From: Tian Tao To: , , , , , , , , , CC: Subject: [PATCH v2] drm/hisilicon: Fixed the warning: Assignment of 0/1 to bool variable Date: Tue, 7 Jul 2020 10:58:21 +0800 Message-ID: <1594090701-45741-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. Signed-off-by: Tian Tao --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 6 +++--- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h | 1 - 2 files changed, 3 insertions(+), 4 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..83c7bb5 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c @@ -254,7 +254,7 @@ static int hibmc_unload(struct drm_device *dev) if (dev->irq_enabled) drm_irq_uninstall(dev); - if (priv->msi_enabled) + if (dev->pdev->msi_enabled) pci_disable_msi(dev->pdev); hibmc_kms_fini(priv); @@ -294,12 +294,12 @@ static int hibmc_load(struct drm_device *dev) goto err; } - priv->msi_enabled = 0; + dev->pdev->msi_enabled = 0; ret = pci_enable_msi(dev->pdev); if (ret) { DRM_WARN("enabling MSI failed: %d\n", ret); } else { - priv->msi_enabled = 1; + dev->pdev->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