From patchwork Wed Oct 11 08:33:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wilczynski, Michal" X-Patchwork-Id: 13416888 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EB8B81A5AD for ; Wed, 11 Oct 2023 08:34:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Xmf/ZlVG" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697013257; x=1728549257; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+gMT7Bs4QZ3pqRHjQbkVcqijwQt7TCCPLlHrN6GVa+4=; b=Xmf/ZlVGQmk/0RggXtdoEM1uiX5NxnDCSlkRMYVJ+WI61+LOhXsClzhG HkTpC80Fh695AENSiozl4qtnm/bW6ZX64Sx/T+LxjXk3FR+GhgUf+52Dk mBFb++xxnpGTi1leg8aqttGPA8FR8Lopl6b30g9wyQj8tkLMaAaEpVN1Y Q9KFyYq1BHjWRoFy0mkvYbCGoyuWzZStC1OHkMIwiiURrJB4NllBHwTQn 8qMGC4NKN8imVwy+oafCGaR65IQQsqqDZopQXWBYzDckrS57hfUgzh38v LJAncZva8mRufNpNgMHSGJhGlPne5tNRxvsWwRnynP0TGTL11VLvHq/9C g==; X-IronPort-AV: E=McAfee;i="6600,9927,10859"; a="388480282" X-IronPort-AV: E=Sophos;i="6.03,214,1694761200"; d="scan'208";a="388480282" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2023 01:34:17 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10859"; a="897548228" X-IronPort-AV: E=Sophos;i="6.03,214,1694761200"; d="scan'208";a="897548228" Received: from powerlab.fi.intel.com ([10.237.71.25]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2023 01:32:29 -0700 From: Michal Wilczynski To: linux-acpi@vger.kernel.org Cc: rafael@kernel.org, dan.j.williams@intel.com, vishal.l.verma@intel.com, lenb@kernel.org, dave.jiang@intel.com, ira.weiny@intel.com, rui.zhang@intel.com, linux-kernel@vger.kernel.org, nvdimm@lists.linux.dev, Michal Wilczynski , Andy Shevchenko Subject: [PATCH v3 6/6] ACPI: NFIT: Remove redundant call to to_acpi_dev() Date: Wed, 11 Oct 2023 11:33:34 +0300 Message-ID: <20231011083334.3987477-7-michal.wilczynski@intel.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231011083334.3987477-1-michal.wilczynski@intel.com> References: <20231011083334.3987477-1-michal.wilczynski@intel.com> Precedence: bulk X-Mailing-List: nvdimm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In acpi_nfit_ctl() ACPI handle is extracted using to_acpi_dev() function and accessing handle field in ACPI device. After transformation from ACPI driver to platform driver this is not optimal anymore. To get a handle it's enough to just use ACPI_HANDLE() macro to extract the handle. Suggested-by: Andy Shevchenko Signed-off-by: Michal Wilczynski --- drivers/acpi/nfit/core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c index 6b9d10cae92c..402bb56d4163 100644 --- a/drivers/acpi/nfit/core.c +++ b/drivers/acpi/nfit/core.c @@ -475,8 +475,6 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm, guid = to_nfit_uuid(nfit_mem->family); handle = adev->handle; } else { - struct acpi_device *adev = to_acpi_dev(acpi_desc); - cmd_name = nvdimm_bus_cmd_name(cmd); cmd_mask = nd_desc->cmd_mask; if (cmd == ND_CMD_CALL && call_pkg->nd_family) { @@ -493,7 +491,7 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm, guid = to_nfit_uuid(NFIT_DEV_BUS); } desc = nd_cmd_bus_desc(cmd); - handle = adev->handle; + handle = ACPI_HANDLE(dev); dimm_name = "bus"; }