diff mbox series

acpi: syntaxcheck: rename syntaxcheck_table to syntaxcheck_single_table

Message ID 20181113125233.17653-1-colin.king@canonical.com
State Accepted
Headers show
Series acpi: syntaxcheck: rename syntaxcheck_table to syntaxcheck_single_table | expand

Commit Message

Colin Ian King Nov. 13, 2018, 12:52 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

Function name syntaxcheck_table is also being used as a local variable
in function syntaxcheck_load_advice, and hence we've got some global
and local name shadowing occurring.  Rename function syntaxcheck_table
to avoid this shadowing.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/acpi/syntaxcheck/syntaxcheck.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Alex Hung Nov. 13, 2018, 12:55 p.m. UTC | #1
On 2018-11-13 8:52 p.m., Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Function name syntaxcheck_table is also being used as a local variable
> in function syntaxcheck_load_advice, and hence we've got some global
> and local name shadowing occurring.  Rename function syntaxcheck_table
> to avoid this shadowing.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/acpi/syntaxcheck/syntaxcheck.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/src/acpi/syntaxcheck/syntaxcheck.c b/src/acpi/syntaxcheck/syntaxcheck.c
> index 1556b48a..b0a5268c 100644
> --- a/src/acpi/syntaxcheck/syntaxcheck.c
> +++ b/src/acpi/syntaxcheck/syntaxcheck.c
> @@ -460,11 +460,11 @@ static void syntaxcheck_give_advice(fwts_framework *fw, uint32_t error_code)
>  }
>  
>  /*
> - *  syntaxcheck_table()
> + *  syntaxcheck_single_table()
>   *	disassemble and reassemble a table, check for errors. which indicates the Nth
>   *	table
>   */
> -static int syntaxcheck_table(
> +static int syntaxcheck_single_table(
>  	fwts_framework *fw,
>  	const fwts_acpi_table_info *info,
>  	const int n)
> @@ -627,7 +627,7 @@ static int syntaxcheck_tables(fwts_framework *fw)
>  		if (fwts_acpi_get_table(fw, i, &info) != FWTS_OK)
>  			break;
>  		if (info && info->has_aml)
> -			syntaxcheck_table(fw, info, n++);
> +			syntaxcheck_single_table(fw, info, n++);
>  	}
>  
>  	return FWTS_OK;
> 


Acked-by: Alex Hung <alex.hung@canonical.com>
Ivan Hu Nov. 14, 2018, 2:27 a.m. UTC | #2
On 11/13/18 8:52 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Function name syntaxcheck_table is also being used as a local variable
> in function syntaxcheck_load_advice, and hence we've got some global
> and local name shadowing occurring.  Rename function syntaxcheck_table
> to avoid this shadowing.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/acpi/syntaxcheck/syntaxcheck.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/acpi/syntaxcheck/syntaxcheck.c b/src/acpi/syntaxcheck/syntaxcheck.c
> index 1556b48a..b0a5268c 100644
> --- a/src/acpi/syntaxcheck/syntaxcheck.c
> +++ b/src/acpi/syntaxcheck/syntaxcheck.c
> @@ -460,11 +460,11 @@ static void syntaxcheck_give_advice(fwts_framework *fw, uint32_t error_code)
>  }
>  
>  /*
> - *  syntaxcheck_table()
> + *  syntaxcheck_single_table()
>   *	disassemble and reassemble a table, check for errors. which indicates the Nth
>   *	table
>   */
> -static int syntaxcheck_table(
> +static int syntaxcheck_single_table(
>  	fwts_framework *fw,
>  	const fwts_acpi_table_info *info,
>  	const int n)
> @@ -627,7 +627,7 @@ static int syntaxcheck_tables(fwts_framework *fw)
>  		if (fwts_acpi_get_table(fw, i, &info) != FWTS_OK)
>  			break;
>  		if (info && info->has_aml)
> -			syntaxcheck_table(fw, info, n++);
> +			syntaxcheck_single_table(fw, info, n++);
>  	}
>  
>  	return FWTS_OK;


Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff mbox series

Patch

diff --git a/src/acpi/syntaxcheck/syntaxcheck.c b/src/acpi/syntaxcheck/syntaxcheck.c
index 1556b48a..b0a5268c 100644
--- a/src/acpi/syntaxcheck/syntaxcheck.c
+++ b/src/acpi/syntaxcheck/syntaxcheck.c
@@ -460,11 +460,11 @@  static void syntaxcheck_give_advice(fwts_framework *fw, uint32_t error_code)
 }
 
 /*
- *  syntaxcheck_table()
+ *  syntaxcheck_single_table()
  *	disassemble and reassemble a table, check for errors. which indicates the Nth
  *	table
  */
-static int syntaxcheck_table(
+static int syntaxcheck_single_table(
 	fwts_framework *fw,
 	const fwts_acpi_table_info *info,
 	const int n)
@@ -627,7 +627,7 @@  static int syntaxcheck_tables(fwts_framework *fw)
 		if (fwts_acpi_get_table(fw, i, &info) != FWTS_OK)
 			break;
 		if (info && info->has_aml)
-			syntaxcheck_table(fw, info, n++);
+			syntaxcheck_single_table(fw, info, n++);
 	}
 
 	return FWTS_OK;