From patchwork Mon May 25 22:22:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre Moreau X-Patchwork-Id: 6477431 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DF11FC0020 for ; Mon, 25 May 2015 22:21:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 12326205EF for ; Mon, 25 May 2015 22:21:36 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 373C6205EC for ; Mon, 25 May 2015 22:21:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 53EDF6E2D1; Mon, 25 May 2015 15:21:34 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp1-g21.free.fr (smtp1-g21.free.fr [212.27.42.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 858976E475; Mon, 25 May 2015 15:21:33 -0700 (PDT) Received: from testlinux.localdomain (unknown [83.248.242.206]) (Authenticated sender: pierre.morrow) by smtp1-g21.free.fr (Postfix) with ESMTPSA id BAC42940089; Tue, 26 May 2015 00:17:54 +0200 (CEST) From: Pierre Moreau To: nouveau@lists.freedesktop.org Subject: [PATCH 8/8] acpi: Use booleans when probing different _DSM types Date: Tue, 26 May 2015 00:22:53 +0200 Message-Id: <1432592573-13743-8-git-send-email-pierre.morrow@free.fr> X-Mailer: git-send-email 2.4.1 In-Reply-To: <1432592573-13743-1-git-send-email-pierre.morrow@free.fr> References: <1432592573-13743-1-git-send-email-pierre.morrow@free.fr> Cc: bskeggs@redhat.com, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Pierre Moreau --- drm/nouveau/nouveau_acpi.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drm/nouveau/nouveau_acpi.c b/drm/nouveau/nouveau_acpi.c index 3d6a1ea..5d63621 100644 --- a/drm/nouveau/nouveau_acpi.c +++ b/drm/nouveau/nouveau_acpi.c @@ -297,8 +297,8 @@ static bool nouveau_dsm_detect(void) char acpi_method_name[255] = { 0 }; struct acpi_buffer buffer = {sizeof(acpi_method_name), acpi_method_name}; struct pci_dev *pdev = NULL; - int has_dsm = 0; - int has_optimus = 0; + bool has_mux = false; + bool has_optimus = false; bool has_gmux = false; int vga_count = 0; bool guid_valid; @@ -317,9 +317,9 @@ static bool nouveau_dsm_detect(void) retval = nouveau_dsm_pci_probe(pdev); if (retval & NOUVEAU_DSM_HAS_MUX) - has_dsm |= 1; + has_mux = true; if (retval & NOUVEAU_DSM_HAS_OPT) - has_optimus = 1; + has_optimus = true; if (retval & NOUVEAU_DSM_HAS_GMUX) has_gmux = true; } @@ -329,9 +329,9 @@ static bool nouveau_dsm_detect(void) retval = nouveau_dsm_pci_probe(pdev); if (retval & NOUVEAU_DSM_HAS_MUX) - has_dsm |= 1; + has_mux = true; if (retval & NOUVEAU_DSM_HAS_OPT) - has_optimus = 1; + has_optimus = true; if (retval & NOUVEAU_DSM_HAS_GMUX) has_gmux = true; } @@ -344,7 +344,7 @@ static bool nouveau_dsm_detect(void) acpi_method_name); nouveau_dsm_priv.optimus_detected = true; ret = true; - } else if (vga_count == 2 && has_dsm && guid_valid) { + } else if (vga_count == 2 && has_mux && guid_valid) { acpi_get_name(nouveau_dsm_priv.dhandle, ACPI_FULL_PATHNAME, &buffer); printk(KERN_INFO "VGA switcheroo: detected mux DSM switching method %s handle\n",