From patchwork Mon Oct 2 13:54:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13406263 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0234AE784AC for ; Mon, 2 Oct 2023 14:04:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237623AbjJBOEz (ORCPT ); Mon, 2 Oct 2023 10:04:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237474AbjJBOEy (ORCPT ); Mon, 2 Oct 2023 10:04:54 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8424BE1; Mon, 2 Oct 2023 07:04:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696255491; x=1727791491; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=nKIji5IZJhMWabHMFqIgraecALuN9dFAb1DqaVopkOo=; b=mkBV4JoGpyQS4QO+sXZDM5ofoPdXSEGvVvUf4M6279HpOH2KiO+bFwtd QeSEwiaIc5lahvAVpGK31n5fRTPoOUCFGFyZPcAboNrYQg5g1YwppqWhH rbZgE26Vq0golsJX3Z4Hk5rfVaBwo7ksqYrz8ghfZ6mNmYIXF0XsbriqF 740s5DsoXjvOfHRaKHtEog3cyBmyhg08acGY3lGXrTK4Lye9xNvutTm9q t1THk5FZbEeMFYvYhcIDk89rJLkFs7jvqAWoBfenhPHLlMj59uGul3TmI OPZCHaei1ol15Po4JLFhcLnGqoPNJ58fao6e8ZuUbojifCvrpbgKQbJTR g==; X-IronPort-AV: E=McAfee;i="6600,9927,10851"; a="468922858" X-IronPort-AV: E=Sophos;i="6.03,194,1694761200"; d="scan'208";a="468922858" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Oct 2023 07:04:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10851"; a="840994379" X-IronPort-AV: E=Sophos;i="6.03,194,1694761200"; d="scan'208";a="840994379" Received: from black.fi.intel.com ([10.237.72.28]) by FMSMGA003.fm.intel.com with ESMTP; 02 Oct 2023 07:04:48 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 3751F1A7; Mon, 2 Oct 2023 16:54:25 +0300 (EEST) From: Andy Shevchenko To: Dan Williams , Andy Shevchenko , linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Bjorn Helgaas , "Rafael J. Wysocki" , Len Brown Subject: [PATCH v1 1/1] ACPI: PCI: Switch to use acpi_evaluate_dsm_typed() Date: Mon, 2 Oct 2023 16:54:24 +0300 Message-Id: <20231002135424.2603191-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The acpi_evaluate_dsm_typed() provides a way to check the type of the object evaluated by _DSM call. Use it instead of open coded variant. Signed-off-by: Andy Shevchenko --- drivers/acpi/pci_root.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index 84030804a763..58b89b8d950e 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c @@ -1055,9 +1055,9 @@ struct pci_bus *acpi_pci_root_create(struct acpi_pci_root *root, * exists and returns 0, we must preserve any PCI resource * assignments made by firmware for this host bridge. */ - obj = acpi_evaluate_dsm(ACPI_HANDLE(bus->bridge), &pci_acpi_dsm_guid, 1, - DSM_PCI_PRESERVE_BOOT_CONFIG, NULL); - if (obj && obj->type == ACPI_TYPE_INTEGER && obj->integer.value == 0) + obj = acpi_evaluate_dsm_typed(ACPI_HANDLE(bus->bridge), &pci_acpi_dsm_guid, 1, + DSM_PCI_PRESERVE_BOOT_CONFIG, NULL, ACPI_TYPE_INTEGER); + if (obj && obj->integer.value == 0) host_bridge->preserve_config = 1; ACPI_FREE(obj);