diff mbox series

ACPICA: Modify ACPI_STATE_COMMON and put it in a single line

Message ID 20230410144846.1959224-1-guodongtai@kylinos.cn
State Superseded
Headers show
Series ACPICA: Modify ACPI_STATE_COMMON and put it in a single line | expand

Commit Message

George Guo April 10, 2023, 2:48 p.m. UTC
Avoid trailing semicolons in macro, and it's not readable to put the macro 
ACPI_STATE_COMMON with other variables in the same line.
So modify the macro and just put it in a single line.

Signed-off-by: George Guo <guodongtai@kylinos.cn>
---
 drivers/acpi/acpica/aclocal.h | 30 +++++++++++++++++++-----------
 1 file changed, 19 insertions(+), 11 deletions(-)

Comments

Rafael J. Wysocki April 18, 2023, 1:18 p.m. UTC | #1
On Mon, Apr 10, 2023 at 4:49 PM George Guo <guodongtai@kylinos.cn> wrote:
>
> Avoid trailing semicolons in macro, and it's not readable to put the macro
> ACPI_STATE_COMMON with other variables in the same line.
> So modify the macro and just put it in a single line.
>
> Signed-off-by: George Guo <guodongtai@kylinos.cn>

ACPICA changes need to be submitted to the upstream project on GitHub
in the first place.

When you have an upstream ACPICA pull request corresponding to this
patch, please resend the patch with a Link: tag pointing to that pull
request.

Thanks!

> ---
>  drivers/acpi/acpica/aclocal.h | 30 +++++++++++++++++++-----------
>  1 file changed, 19 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h
> index 901b1543b869..cb757ac2c22e 100644
> --- a/drivers/acpi/acpica/aclocal.h
> +++ b/drivers/acpi/acpica/aclocal.h
> @@ -560,25 +560,28 @@ struct acpi_field_info {
>         u8                              descriptor_type; /* To differentiate various internal objs */\
>         u8                              flags; \
>         u16                             value; \
> -       u16                             state;
> +       u16                             state
>
>         /* There are 2 bytes available here until the next natural alignment boundary */
>
>  struct acpi_common_state {
> -ACPI_STATE_COMMON};
> +       ACPI_STATE_COMMON;
> +};
>
>  /*
>   * Update state - used to traverse complex objects such as packages
>   */
>  struct acpi_update_state {
> -       ACPI_STATE_COMMON union acpi_operand_object *object;
> +       ACPI_STATE_COMMON;
> +       union acpi_operand_object *object;
>  };
>
>  /*
>   * Pkg state - used to traverse nested package structures
>   */
>  struct acpi_pkg_state {
> -       ACPI_STATE_COMMON u32 index;
> +       ACPI_STATE_COMMON;
> +       u32 index;
>         union acpi_operand_object *source_object;
>         union acpi_operand_object *dest_object;
>         struct acpi_walk_state *walk_state;
> @@ -591,7 +594,8 @@ struct acpi_pkg_state {
>   * Allows nesting of these constructs
>   */
>  struct acpi_control_state {
> -       ACPI_STATE_COMMON u16 opcode;
> +       ACPI_STATE_COMMON;
> +       u16 opcode;
>         union acpi_parse_object *predicate_op;
>         u8 *aml_predicate_start;        /* Start of if/while predicate */
>         u8 *package_end;        /* End of if/while block */
> @@ -602,11 +606,13 @@ struct acpi_control_state {
>   * Scope state - current scope during namespace lookups
>   */
>  struct acpi_scope_state {
> -       ACPI_STATE_COMMON struct acpi_namespace_node *node;
> +       ACPI_STATE_COMMON;
> +       struct acpi_namespace_node *node;
>  };
>
>  struct acpi_pscope_state {
> -       ACPI_STATE_COMMON u32 arg_count;        /* Number of fixed arguments */
> +       ACPI_STATE_COMMON;
> +       u32 arg_count;  /* Number of fixed arguments */
>         union acpi_parse_object *op;    /* Current op being parsed */
>         u8 *arg_end;            /* Current argument end */
>         u8 *pkg_end;            /* Current package end */
> @@ -618,7 +624,8 @@ struct acpi_pscope_state {
>   * states are created when there are nested control methods executing.
>   */
>  struct acpi_thread_state {
> -       ACPI_STATE_COMMON u8 current_sync_level;        /* Mutex Sync (nested acquire) level */
> +       ACPI_STATE_COMMON;
> +       u8 current_sync_level;  /* Mutex Sync (nested acquire) level */
>         struct acpi_walk_state *walk_state_list;        /* Head of list of walk_states for this thread */
>         union acpi_operand_object *acquired_mutex_list; /* List of all currently acquired mutexes */
>         acpi_thread_id thread_id;       /* Running thread ID */
> @@ -629,8 +636,8 @@ struct acpi_thread_state {
>   * AML arguments
>   */
>  struct acpi_result_values {
> -       ACPI_STATE_COMMON
> -           union acpi_operand_object *obj_desc[ACPI_RESULTS_FRAME_OBJ_NUM];
> +       ACPI_STATE_COMMON;
> +       union acpi_operand_object *obj_desc[ACPI_RESULTS_FRAME_OBJ_NUM];
>  };
>
>  typedef
> @@ -652,7 +659,8 @@ struct acpi_global_notify_handler {
>   * handler/dispatcher.
>   */
>  struct acpi_notify_info {
> -       ACPI_STATE_COMMON u8 handler_list_id;
> +       ACPI_STATE_COMMON;
> +       u8 handler_list_id;
>         struct acpi_namespace_node *node;
>         union acpi_operand_object *handler_list_head;
>         struct acpi_global_notify_handler *global;
> --
> 2.34.1
>
diff mbox series

Patch

diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h
index 901b1543b869..cb757ac2c22e 100644
--- a/drivers/acpi/acpica/aclocal.h
+++ b/drivers/acpi/acpica/aclocal.h
@@ -560,25 +560,28 @@  struct acpi_field_info {
 	u8                              descriptor_type; /* To differentiate various internal objs */\
 	u8                              flags; \
 	u16                             value; \
-	u16                             state;
+	u16                             state
 
 	/* There are 2 bytes available here until the next natural alignment boundary */
 
 struct acpi_common_state {
-ACPI_STATE_COMMON};
+	ACPI_STATE_COMMON;
+};
 
 /*
  * Update state - used to traverse complex objects such as packages
  */
 struct acpi_update_state {
-	ACPI_STATE_COMMON union acpi_operand_object *object;
+	ACPI_STATE_COMMON;
+	union acpi_operand_object *object;
 };
 
 /*
  * Pkg state - used to traverse nested package structures
  */
 struct acpi_pkg_state {
-	ACPI_STATE_COMMON u32 index;
+	ACPI_STATE_COMMON;
+	u32 index;
 	union acpi_operand_object *source_object;
 	union acpi_operand_object *dest_object;
 	struct acpi_walk_state *walk_state;
@@ -591,7 +594,8 @@  struct acpi_pkg_state {
  * Allows nesting of these constructs
  */
 struct acpi_control_state {
-	ACPI_STATE_COMMON u16 opcode;
+	ACPI_STATE_COMMON;
+	u16 opcode;
 	union acpi_parse_object *predicate_op;
 	u8 *aml_predicate_start;	/* Start of if/while predicate */
 	u8 *package_end;	/* End of if/while block */
@@ -602,11 +606,13 @@  struct acpi_control_state {
  * Scope state - current scope during namespace lookups
  */
 struct acpi_scope_state {
-	ACPI_STATE_COMMON struct acpi_namespace_node *node;
+	ACPI_STATE_COMMON;
+	struct acpi_namespace_node *node;
 };
 
 struct acpi_pscope_state {
-	ACPI_STATE_COMMON u32 arg_count;	/* Number of fixed arguments */
+	ACPI_STATE_COMMON;
+	u32 arg_count;	/* Number of fixed arguments */
 	union acpi_parse_object *op;	/* Current op being parsed */
 	u8 *arg_end;		/* Current argument end */
 	u8 *pkg_end;		/* Current package end */
@@ -618,7 +624,8 @@  struct acpi_pscope_state {
  * states are created when there are nested control methods executing.
  */
 struct acpi_thread_state {
-	ACPI_STATE_COMMON u8 current_sync_level;	/* Mutex Sync (nested acquire) level */
+	ACPI_STATE_COMMON;
+	u8 current_sync_level;	/* Mutex Sync (nested acquire) level */
 	struct acpi_walk_state *walk_state_list;	/* Head of list of walk_states for this thread */
 	union acpi_operand_object *acquired_mutex_list;	/* List of all currently acquired mutexes */
 	acpi_thread_id thread_id;	/* Running thread ID */
@@ -629,8 +636,8 @@  struct acpi_thread_state {
  * AML arguments
  */
 struct acpi_result_values {
-	ACPI_STATE_COMMON
-	    union acpi_operand_object *obj_desc[ACPI_RESULTS_FRAME_OBJ_NUM];
+	ACPI_STATE_COMMON;
+	union acpi_operand_object *obj_desc[ACPI_RESULTS_FRAME_OBJ_NUM];
 };
 
 typedef
@@ -652,7 +659,8 @@  struct acpi_global_notify_handler {
  * handler/dispatcher.
  */
 struct acpi_notify_info {
-	ACPI_STATE_COMMON u8 handler_list_id;
+	ACPI_STATE_COMMON;
+	u8 handler_list_id;
 	struct acpi_namespace_node *node;
 	union acpi_operand_object *handler_list_head;
 	struct acpi_global_notify_handler *global;