Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1493879rdb; Mon, 2 Oct 2023 11:09:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFtb5SvWFVQTlmJCfXhKT0Aqk8y4dePYmDjfGGXEncL6J36olLh2gd93eB88YZAFaAzKg/h X-Received: by 2002:a17:90b:4f43:b0:277:7969:6bf2 with SMTP id pj3-20020a17090b4f4300b0027779696bf2mr12181392pjb.47.1696270190074; Mon, 02 Oct 2023 11:09:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696270190; cv=none; d=google.com; s=arc-20160816; b=MGOj77JTZduaqDLff+UcLidzJXotJgzpFhqN8WGstvN3EQS8m0Tr5PI2D4we1Lqh7W keReqfyrkmV8ME/WSQL2YastxucXCoH7MHHL0f1nOsA86v+LjHmw43hvUMYXzk2f+qWe J1UUa1PGUl18QZV9cFn40AKQPJ5Txtt8HFyk9BjrIC8i921tEOPmyUqhdsYGzVr4UQBR JskyP4f0+UtVTLbE3tdaRbSi97JDovwy7cUrcbvyWt5pBWTGyXB18wnLoBIvif2F5/pF EhK9hOH6WYUPxaGTK/t03j4DVAgxD3RTks4XGIcFfClSDLjL5JL1t/hFCM+rjxIw0iS4 HkvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=qWhImKcJFhkIBTo/RR8Jieihmm30Hauzs72YHgXYVIQ=; fh=sRr8z53mZ8j0kFZ1jZe+Q0Gfv6vf8pi5SgK5oNFoS4Q=; b=vET7s1hROoSAY7LtQGvWbF4Tr0Qf40UKEv8LaY9hyoO1CoV6qMZ7/M98zMvs2c63rg DBYvmFNcMR8txgKM7HV1xfUcAdlxH2ZCZCDurBkrRDREkHVfv5T7lekQgmouMaHZ62o9 ZCUNgK3cfcwHyiJEoJuHuRlq3JGt+ttP3Huv1nmm2GbxMXctDTZnIRNIamdQvh4Wsvkr nomz+yrJX2INRleQy3XSs+EUEgqWRqqHWrOYNBd7/qMfBKXDz86QdsEEo6rFTsPtwg6U /NZQT7V6HUWt3qHql+XsIrFI6UycYzqLn2W9cU32Id1avNyqDMstBAGQ3LvZsHNgLyvW wJFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dgpMPu3M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id 19-20020a631753000000b00565eb0cf702si27560094pgx.310.2023.10.02.11.09.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 11:09:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dgpMPu3M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 9CDC9822899F; Mon, 2 Oct 2023 06:55:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237605AbjJBNzT (ORCPT + 99 others); Mon, 2 Oct 2023 09:55:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237618AbjJBNzL (ORCPT ); Mon, 2 Oct 2023 09:55:11 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C13BADC; Mon, 2 Oct 2023 06:55:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696254904; x=1727790904; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=7CvkNllIdMRaFkXGmuu4g9r5sHV6wrnsOajfayAqkbY=; b=dgpMPu3MAP3uQgS683ZLarOg4ngCglE+pUg1e6JHNk6AHywKYOFnEcbc bx9wkSMxzkDDG1PhfVkoyhcYEQySScyxcQde524W2pV0HKVIDGfu06Sw/ KI3OFx4nyQQdgKdVtjjU+9rhsRhbVm/Y4MYSdNuJ5dxYUwTOoVuugwdGN aWQSyAZIlLcT/gbrlj36XaWNZ0KDHTzHkg3dLcSNyglhNy98E7HcG9hZa ZRK+bm1wJIOOL46Ca79MMHp0NTj061YWEM64GPSbDtvfNOrZeylqdCxfc 3hn8sd/gG/etl+/P8zv5siY8uf2cwTdEI7O1v/t54N3VZ1iqwVLfwlr4w g==; X-IronPort-AV: E=McAfee;i="6600,9927,10851"; a="362911942" X-IronPort-AV: E=Sophos;i="6.03,194,1694761200"; d="scan'208";a="362911942" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Oct 2023 06:55:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10851"; a="785782513" X-IronPort-AV: E=Sophos;i="6.03,194,1694761200"; d="scan'208";a="785782513" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga001.jf.intel.com with ESMTP; 02 Oct 2023 06:55:01 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 9CE6A14AF; Mon, 2 Oct 2023 16:54:59 +0300 (EEST) From: Andy Shevchenko To: Michal Wilczynski , nvdimm@lists.linux.dev, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Dan Williams , Vishal Verma , Dave Jiang , Ira Weiny , "Rafael J. Wysocki" , Len Brown , Andy Shevchenko Subject: [PATCH v1 1/1] ACPI: NFIT: Switch to use acpi_evaluate_dsm_typed() Date: Mon, 2 Oct 2023 16:54:58 +0300 Message-Id: <20231002135458.2603293-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 02 Oct 2023 06:55:28 -0700 (PDT) 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/nfit/core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index f96bf32cd368..280da408c02c 100644 --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c @@ -1737,9 +1737,8 @@ __weak void nfit_intel_shutdown_status(struct nfit_mem *nfit_mem) if ((nfit_mem->dsm_mask & (1 << func)) == 0) return; - out_obj = acpi_evaluate_dsm(handle, guid, revid, func, &in_obj); - if (!out_obj || out_obj->type != ACPI_TYPE_BUFFER - || out_obj->buffer.length < sizeof(smart)) { + out_obj = acpi_evaluate_dsm_typed(handle, guid, revid, func, &in_obj, ACPI_TYPE_BUFFER); + if (!out_obj || out_obj->buffer.length < sizeof(smart)) { dev_dbg(dev->parent, "%s: failed to retrieve initial health\n", dev_name(dev)); ACPI_FREE(out_obj); -- 2.40.0.1.gaa8946217a0b