mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michal Wilczynski <michal.wilczynski@intel.com>
To: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	nvdimm@lists.linux.dev
Cc: rafael.j.wysocki@intel.com, andriy.shevchenko@intel.com,
	lenb@kernel.org, dan.j.williams@intel.com,
	vishal.l.verma@intel.com, ira.weiny@intel.com,
	rui.zhang@intel.com,
	Michal Wilczynski <michal.wilczynski@intel.com>,
	Andy Shevchenko <andy.shevchenko@gmail.com>
Subject: [PATCH v1 8/9] ACPI: NFIT: Remove redundant call to to_acpi_dev()
Date: Mon, 25 Sep 2023 17:48:41 +0300	[thread overview]
Message-ID: <20230925144842.586829-9-michal.wilczynski@intel.com> (raw)
In-Reply-To: <20230925144842.586829-1-michal.wilczynski@intel.com>

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 <andy.shevchenko@gmail.com>
Signed-off-by: Michal Wilczynski <michal.wilczynski@intel.com>
---
 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 2e50b1334a69..f09530d2520a 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";
 	}
 
-- 
2.41.0


  parent reply	other threads:[~2023-09-25 14:49 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-25 14:48 [PATCH v1 0/9] Replace acpi_driver with platform_driver Michal Wilczynski
2023-09-25 14:48 ` [PATCH v1 1/9] ACPI: bus: Make notify wrappers more generic Michal Wilczynski
2023-10-04 19:09   ` Rafael J. Wysocki
2023-10-05  8:09     ` Wilczynski, Michal
2023-10-05 10:57       ` Rafael J. Wysocki
2023-10-05 12:05         ` Wilczynski, Michal
2023-10-05 15:30           ` Rafael J. Wysocki
2023-10-05 17:03             ` Rafael J. Wysocki
2023-10-05 18:27               ` Wilczynski, Michal
2023-10-05 18:29                 ` Rafael J. Wysocki
2023-09-25 14:48 ` [PATCH v1 2/9] docs: firmware-guide: ACPI: Clarify ACPI bus concepts Michal Wilczynski
2023-10-05 17:57   ` Rafael J. Wysocki
2023-10-05 18:28     ` Wilczynski, Michal
2023-10-05 18:58       ` Wilczynski, Michal
2023-10-06 15:36         ` Rafael J. Wysocki
2023-10-06 17:29           ` Wilczynski, Michal
2023-09-25 14:48 ` [PATCH v1 3/9] ACPI: AC: Remove unnecessary checks Michal Wilczynski
2023-09-25 14:48 ` [PATCH v1 4/9] ACPI: AC: Use string_choices API instead of ternary operator Michal Wilczynski
2023-09-25 14:48 ` [PATCH v1 5/9] ACPI: AC: Replace acpi_driver with platform_driver Michal Wilczynski
2023-09-25 14:48 ` [PATCH v1 6/9] ACPI: AC: Rename ACPI device from device to adev Michal Wilczynski
2023-09-25 14:48 ` [PATCH v1 7/9] ACPI: NFIT: Replace acpi_driver with platform_driver Michal Wilczynski
2023-09-25 14:48 ` Michal Wilczynski [this message]
2023-09-25 14:48 ` [PATCH v1 9/9] ACPI: NFIT: Don't use KBUILD_MODNAME for driver name Michal Wilczynski
2023-09-25 15:47   ` Andy Shevchenko
2023-09-25 16:11     ` Dan Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230925144842.586829-9-michal.wilczynski@intel.com \
    --to=michal.wilczynski@intel.com \
    --cc=andriy.shevchenko@intel.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=dan.j.williams@intel.com \
    --cc=ira.weiny@intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nvdimm@lists.linux.dev \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rui.zhang@intel.com \
    --cc=vishal.l.verma@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®