linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] acpi: acpica: utmisc.c:  Remove unused function
@ 2015-01-01 17:15 Rickard Strandqvist
  2015-01-05  8:32 ` Zheng, Lv
  0 siblings, 1 reply; 3+ messages in thread
From: Rickard Strandqvist @ 2015-01-01 17:15 UTC (permalink / raw)
  To: Robert Moore, Lv Zheng
  Cc: Rickard Strandqvist, Rafael J. Wysocki, Len Brown, linux-acpi,
	devel, linux-kernel

Remove the function acpi_ut_is_aml_table() that is not used anywhere.

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/acpi/acpica/acutils.h |    2 --
 drivers/acpi/acpica/utmisc.c  |   28 ----------------------------
 2 files changed, 30 deletions(-)

diff --git a/drivers/acpi/acpica/acutils.h b/drivers/acpi/acpica/acutils.h
index 486d342..ec5da45 100644
--- a/drivers/acpi/acpica/acutils.h
+++ b/drivers/acpi/acpica/acutils.h
@@ -570,8 +570,6 @@ const struct acpi_exception_info *acpi_ut_validate_exception(acpi_status
 
 u8 acpi_ut_is_pci_root_bridge(char *id);
 
-u8 acpi_ut_is_aml_table(struct acpi_table_header *table);
-
 acpi_status
 acpi_ut_walk_package_tree(union acpi_operand_object *source_object,
 			  void *target_object,
diff --git a/drivers/acpi/acpica/utmisc.c b/drivers/acpi/acpica/utmisc.c
index 2e2bb14..a9440af 100644
--- a/drivers/acpi/acpica/utmisc.c
+++ b/drivers/acpi/acpica/utmisc.c
@@ -77,34 +77,6 @@ u8 acpi_ut_is_pci_root_bridge(char *id)
 
 /*******************************************************************************
  *
- * FUNCTION:    acpi_ut_is_aml_table
- *
- * PARAMETERS:  table               - An ACPI table
- *
- * RETURN:      TRUE if table contains executable AML; FALSE otherwise
- *
- * DESCRIPTION: Check ACPI Signature for a table that contains AML code.
- *              Currently, these are DSDT,SSDT,PSDT. All other table types are
- *              data tables that do not contain AML code.
- *
- ******************************************************************************/
-
-u8 acpi_ut_is_aml_table(struct acpi_table_header *table)
-{
-
-	/* These are the only tables that contain executable AML */
-
-	if (ACPI_COMPARE_NAME(table->signature, ACPI_SIG_DSDT) ||
-	    ACPI_COMPARE_NAME(table->signature, ACPI_SIG_PSDT) ||
-	    ACPI_COMPARE_NAME(table->signature, ACPI_SIG_SSDT)) {
-		return (TRUE);
-	}
-
-	return (FALSE);
-}
-
-/*******************************************************************************
- *
  * FUNCTION:    acpi_ut_dword_byte_swap
  *
  * PARAMETERS:  value           - Value to be converted
-- 
1.7.10.4


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

* RE: [PATCH] acpi: acpica: utmisc.c:  Remove unused function
  2015-01-01 17:15 [PATCH] acpi: acpica: utmisc.c: Remove unused function Rickard Strandqvist
@ 2015-01-05  8:32 ` Zheng, Lv
  2015-01-05 23:30   ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: Zheng, Lv @ 2015-01-05  8:32 UTC (permalink / raw)
  To: Rickard Strandqvist, Moore, Robert
  Cc: Wysocki, Rafael J, Len Brown, linux-acpi, devel, linux-kernel

Hi, Rickard

> From: Rickard Strandqvist [mailto:rickard_strandqvist@spectrumdigital.se]
> Sent: Friday, January 02, 2015 1:16 AM
> 
> Remove the function acpi_ut_is_aml_table() that is not used anywhere.

This function is used by the ACPICA debugger and disassembler.
The ACPICA release process has just automatically released this function from the ACPICA code base to the Linux kernel.

We shouldn't just remove it from the Linux kernel code base.
If we do so, it's just turned into divergences that can hurt the release automation.
You may use ACPI_FUTURE_USAGE around these functions instead.

Same rule should apply to all of the other patches from you.

Thanks and best regards
-Lv

> 
> This was partially found by using a static code analysis program called cppcheck.
> 
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> ---
>  drivers/acpi/acpica/acutils.h |    2 --
>  drivers/acpi/acpica/utmisc.c  |   28 ----------------------------
>  2 files changed, 30 deletions(-)
> 
> diff --git a/drivers/acpi/acpica/acutils.h b/drivers/acpi/acpica/acutils.h
> index 486d342..ec5da45 100644
> --- a/drivers/acpi/acpica/acutils.h
> +++ b/drivers/acpi/acpica/acutils.h
> @@ -570,8 +570,6 @@ const struct acpi_exception_info *acpi_ut_validate_exception(acpi_status
> 
>  u8 acpi_ut_is_pci_root_bridge(char *id);
> 
> -u8 acpi_ut_is_aml_table(struct acpi_table_header *table);
> -
>  acpi_status
>  acpi_ut_walk_package_tree(union acpi_operand_object *source_object,
>  			  void *target_object,
> diff --git a/drivers/acpi/acpica/utmisc.c b/drivers/acpi/acpica/utmisc.c
> index 2e2bb14..a9440af 100644
> --- a/drivers/acpi/acpica/utmisc.c
> +++ b/drivers/acpi/acpica/utmisc.c
> @@ -77,34 +77,6 @@ u8 acpi_ut_is_pci_root_bridge(char *id)
> 
>  /*******************************************************************************
>   *
> - * FUNCTION:    acpi_ut_is_aml_table
> - *
> - * PARAMETERS:  table               - An ACPI table
> - *
> - * RETURN:      TRUE if table contains executable AML; FALSE otherwise
> - *
> - * DESCRIPTION: Check ACPI Signature for a table that contains AML code.
> - *              Currently, these are DSDT,SSDT,PSDT. All other table types are
> - *              data tables that do not contain AML code.
> - *
> - ******************************************************************************/
> -
> -u8 acpi_ut_is_aml_table(struct acpi_table_header *table)
> -{
> -
> -	/* These are the only tables that contain executable AML */
> -
> -	if (ACPI_COMPARE_NAME(table->signature, ACPI_SIG_DSDT) ||
> -	    ACPI_COMPARE_NAME(table->signature, ACPI_SIG_PSDT) ||
> -	    ACPI_COMPARE_NAME(table->signature, ACPI_SIG_SSDT)) {
> -		return (TRUE);
> -	}
> -
> -	return (FALSE);
> -}
> -
> -/*******************************************************************************
> - *
>   * FUNCTION:    acpi_ut_dword_byte_swap
>   *
>   * PARAMETERS:  value           - Value to be converted
> --
> 1.7.10.4


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

* Re: [PATCH] acpi: acpica: utmisc.c:  Remove unused function
  2015-01-05  8:32 ` Zheng, Lv
@ 2015-01-05 23:30   ` Rafael J. Wysocki
  0 siblings, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2015-01-05 23:30 UTC (permalink / raw)
  To: Zheng, Lv
  Cc: Rickard Strandqvist, Moore, Robert, Wysocki, Rafael J, Len Brown,
	linux-acpi, devel, linux-kernel

On Monday, January 05, 2015 08:32:59 AM Zheng, Lv wrote:
> Hi, Rickard
> 
> > From: Rickard Strandqvist [mailto:rickard_strandqvist@spectrumdigital.se]
> > Sent: Friday, January 02, 2015 1:16 AM
> > 
> > Remove the function acpi_ut_is_aml_table() that is not used anywhere.
> 
> This function is used by the ACPICA debugger and disassembler.
> The ACPICA release process has just automatically released this function from the ACPICA code base to the Linux kernel.
> 
> We shouldn't just remove it from the Linux kernel code base.
> If we do so, it's just turned into divergences that can hurt the release automation.
> You may use ACPI_FUTURE_USAGE around these functions instead.

Can we do that in upstream ACPICA?


-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

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

end of thread, other threads:[~2015-01-05 23:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-01 17:15 [PATCH] acpi: acpica: utmisc.c: Remove unused function Rickard Strandqvist
2015-01-05  8:32 ` Zheng, Lv
2015-01-05 23:30   ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).