All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] ACPI: memhotplug: Remove the 'state' from struct acpi_memory_device
@ 2020-09-27  9:55 Hanjun Guo
  2020-10-02 17:07 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Hanjun Guo @ 2020-09-27  9:55 UTC (permalink / raw)
  To: linux-acpi; +Cc: Rafael J. Wysocki, Hanjun Guo

After commit 315bbae9c5cb ("ACPI / memhotplug: deal with eject request
in hotplug queue"), the memory device state which is defined in struct
acpi_memory_device is not actually useful, so remove it along with
symbols related to it.

Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
---
v1->v2:
- Make it as a sparate cleanup patch.

 drivers/acpi/acpi_memhotplug.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
index e294f44..468ebb7 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -36,11 +36,6 @@
 
 #ifdef CONFIG_ACPI_HOTPLUG_MEMORY
 
-/* Memory Device States */
-#define MEMORY_INVALID_STATE	0
-#define MEMORY_POWER_ON_STATE	1
-#define MEMORY_POWER_OFF_STATE	2
-
 static int acpi_memory_device_add(struct acpi_device *device,
 				  const struct acpi_device_id *not_used);
 static void acpi_memory_device_remove(struct acpi_device *device);
@@ -64,8 +59,7 @@ struct acpi_memory_info {
 };
 
 struct acpi_memory_device {
-	struct acpi_device * device;
-	unsigned int state;	/* State of the memory device */
+	struct acpi_device *device;
 	struct list_head res_list;
 };
 
@@ -233,7 +227,6 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
 	}
 	if (!num_enabled) {
 		dev_err(&mem_device->device->dev, "add_memory failed\n");
-		mem_device->state = MEMORY_INVALID_STATE;
 		return -EINVAL;
 	}
 	/*
@@ -304,9 +297,6 @@ static int acpi_memory_device_add(struct acpi_device *device,
 		return result;
 	}
 
-	/* Set the device state */
-	mem_device->state = MEMORY_POWER_ON_STATE;
-
 	result = acpi_memory_check_device(mem_device);
 	if (result) {
 		acpi_memory_device_free(mem_device);
-- 
1.7.12.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] ACPI: memhotplug: Remove the 'state' from struct acpi_memory_device
  2020-09-27  9:55 [PATCH v2] ACPI: memhotplug: Remove the 'state' from struct acpi_memory_device Hanjun Guo
@ 2020-10-02 17:07 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2020-10-02 17:07 UTC (permalink / raw)
  To: Hanjun Guo; +Cc: ACPI Devel Maling List, Rafael J. Wysocki

On Sun, Sep 27, 2020 at 12:03 PM Hanjun Guo <guohanjun@huawei.com> wrote:
>
> After commit 315bbae9c5cb ("ACPI / memhotplug: deal with eject request
> in hotplug queue"), the memory device state which is defined in struct
> acpi_memory_device is not actually useful, so remove it along with
> symbols related to it.
>
> Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
> ---
> v1->v2:
> - Make it as a sparate cleanup patch.
>
>  drivers/acpi/acpi_memhotplug.c | 12 +-----------
>  1 file changed, 1 insertion(+), 11 deletions(-)
>
> diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
> index e294f44..468ebb7 100644
> --- a/drivers/acpi/acpi_memhotplug.c
> +++ b/drivers/acpi/acpi_memhotplug.c
> @@ -36,11 +36,6 @@
>
>  #ifdef CONFIG_ACPI_HOTPLUG_MEMORY
>
> -/* Memory Device States */
> -#define MEMORY_INVALID_STATE   0
> -#define MEMORY_POWER_ON_STATE  1
> -#define MEMORY_POWER_OFF_STATE 2
> -
>  static int acpi_memory_device_add(struct acpi_device *device,
>                                   const struct acpi_device_id *not_used);
>  static void acpi_memory_device_remove(struct acpi_device *device);
> @@ -64,8 +59,7 @@ struct acpi_memory_info {
>  };
>
>  struct acpi_memory_device {
> -       struct acpi_device * device;
> -       unsigned int state;     /* State of the memory device */
> +       struct acpi_device *device;
>         struct list_head res_list;
>  };
>
> @@ -233,7 +227,6 @@ static int acpi_memory_enable_device(struct acpi_memory_device *mem_device)
>         }
>         if (!num_enabled) {
>                 dev_err(&mem_device->device->dev, "add_memory failed\n");
> -               mem_device->state = MEMORY_INVALID_STATE;
>                 return -EINVAL;
>         }
>         /*
> @@ -304,9 +297,6 @@ static int acpi_memory_device_add(struct acpi_device *device,
>                 return result;
>         }
>
> -       /* Set the device state */
> -       mem_device->state = MEMORY_POWER_ON_STATE;
> -
>         result = acpi_memory_check_device(mem_device);
>         if (result) {
>                 acpi_memory_device_free(mem_device);
> --

Applied as 5.10 material with a couple of minor edits in the subject
and changelog, thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-02 17:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-27  9:55 [PATCH v2] ACPI: memhotplug: Remove the 'state' from struct acpi_memory_device Hanjun Guo
2020-10-02 17:07 ` Rafael J. Wysocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.