diff mbox

acpica: tidy up code to remove GCC warnings

Message ID 1345627987-24310-1-git-send-email-colin.king@canonical.com
State Accepted
Headers show

Commit Message

Colin Ian King Aug. 22, 2012, 9:33 a.m. UTC
From: Colin Ian King <colin.king@canonical.com>

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/acpica/source/compiler/fwts_iasl_interface.c |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

Comments

Alex Hung Aug. 23, 2012, 7:30 a.m. UTC | #1
On 08/22/2012 05:33 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/acpica/source/compiler/fwts_iasl_interface.c |   11 +++++------
>   1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/src/acpica/source/compiler/fwts_iasl_interface.c b/src/acpica/source/compiler/fwts_iasl_interface.c
> index 88a20a2..76f6356 100644
> --- a/src/acpica/source/compiler/fwts_iasl_interface.c
> +++ b/src/acpica/source/compiler/fwts_iasl_interface.c
> @@ -46,8 +46,8 @@ static void init_asl_core(void)
>
>   int fwts_iasl_disassemble_aml(const char *aml, const char *outputfile)
>   {
> -	ACPI_STATUS	status;
>   	pid_t	pid;
> +	int	status;
>
>   	pid = fork();
>   	switch (pid) {
> @@ -64,9 +64,9 @@ int fwts_iasl_disassemble_aml(const char *aml, const char *outputfile)
>   		Gbl_UseDefaultAmlFilename = FALSE;
>
>   		/* Throw away noisy errors */
> -		freopen("/dev/null", "w", stderr);
> +		if (freopen("/dev/null", "w", stderr) != NULL)
> +			(void)AslDoOnePathname((char *)aml, AslDoOneFile);
>
> -		status = AslDoOnePathname(aml, AslDoOneFile);
>   		_exit(0);
>   		break;
>   	default:
> @@ -86,7 +86,6 @@ int fwts_iasl_assemble_aml(const char *source, char **output)
>   	int	n;
>   	int 	len = 0;
>   	int	status;
> -	FILE 	*fp;
>
>   	if (pipe(pipefds) < 0)
>   		return -1;
> @@ -112,9 +111,9 @@ int fwts_iasl_assemble_aml(const char *source, char **output)
>           	Gbl_DoCompile = TRUE;
>   		Gbl_PreprocessFlag = TRUE;
>           	Gbl_UseDefaultAmlFilename = FALSE;
> -        	Gbl_OutputFilenamePrefix = source;
> +        	Gbl_OutputFilenamePrefix = (char*)source;
>
> -		status = AslDoOnePathname(source, AslDoOneFile);
> +		status = AslDoOnePathname((char*)source, AslDoOneFile);
>
>   		close(pipefds[1]);
>
>

Acked-by: Alex Hung <alex.hung@canonical.com>
Ivan Hu Aug. 24, 2012, 6:05 a.m. UTC | #2
On 08/22/2012 05:33 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/acpica/source/compiler/fwts_iasl_interface.c |   11 +++++------
>   1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/src/acpica/source/compiler/fwts_iasl_interface.c b/src/acpica/source/compiler/fwts_iasl_interface.c
> index 88a20a2..76f6356 100644
> --- a/src/acpica/source/compiler/fwts_iasl_interface.c
> +++ b/src/acpica/source/compiler/fwts_iasl_interface.c
> @@ -46,8 +46,8 @@ static void init_asl_core(void)
>
>   int fwts_iasl_disassemble_aml(const char *aml, const char *outputfile)
>   {
> -	ACPI_STATUS	status;
>   	pid_t	pid;
> +	int	status;
>
>   	pid = fork();
>   	switch (pid) {
> @@ -64,9 +64,9 @@ int fwts_iasl_disassemble_aml(const char *aml, const char *outputfile)
>   		Gbl_UseDefaultAmlFilename = FALSE;
>
>   		/* Throw away noisy errors */
> -		freopen("/dev/null", "w", stderr);
> +		if (freopen("/dev/null", "w", stderr) != NULL)
> +			(void)AslDoOnePathname((char *)aml, AslDoOneFile);
>
> -		status = AslDoOnePathname(aml, AslDoOneFile);
>   		_exit(0);
>   		break;
>   	default:
> @@ -86,7 +86,6 @@ int fwts_iasl_assemble_aml(const char *source, char **output)
>   	int	n;
>   	int 	len = 0;
>   	int	status;
> -	FILE 	*fp;
>
>   	if (pipe(pipefds) < 0)
>   		return -1;
> @@ -112,9 +111,9 @@ int fwts_iasl_assemble_aml(const char *source, char **output)
>           	Gbl_DoCompile = TRUE;
>   		Gbl_PreprocessFlag = TRUE;
>           	Gbl_UseDefaultAmlFilename = FALSE;
> -        	Gbl_OutputFilenamePrefix = source;
> +        	Gbl_OutputFilenamePrefix = (char*)source;
>
> -		status = AslDoOnePathname(source, AslDoOneFile);
> +		status = AslDoOnePathname((char*)source, AslDoOneFile);
>
>   		close(pipefds[1]);
>
>

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

Patch

diff --git a/src/acpica/source/compiler/fwts_iasl_interface.c b/src/acpica/source/compiler/fwts_iasl_interface.c
index 88a20a2..76f6356 100644
--- a/src/acpica/source/compiler/fwts_iasl_interface.c
+++ b/src/acpica/source/compiler/fwts_iasl_interface.c
@@ -46,8 +46,8 @@  static void init_asl_core(void)
 
 int fwts_iasl_disassemble_aml(const char *aml, const char *outputfile)
 {
-	ACPI_STATUS	status;
 	pid_t	pid;
+	int	status;
 
 	pid = fork();
 	switch (pid) {
@@ -64,9 +64,9 @@  int fwts_iasl_disassemble_aml(const char *aml, const char *outputfile)
 		Gbl_UseDefaultAmlFilename = FALSE;
 
 		/* Throw away noisy errors */
-		freopen("/dev/null", "w", stderr);
+		if (freopen("/dev/null", "w", stderr) != NULL)
+			(void)AslDoOnePathname((char *)aml, AslDoOneFile);
 
-		status = AslDoOnePathname(aml, AslDoOneFile);
 		_exit(0);
 		break;
 	default:
@@ -86,7 +86,6 @@  int fwts_iasl_assemble_aml(const char *source, char **output)
 	int	n;
 	int 	len = 0;
 	int	status;
-	FILE 	*fp;
 
 	if (pipe(pipefds) < 0)
 		return -1;
@@ -112,9 +111,9 @@  int fwts_iasl_assemble_aml(const char *source, char **output)
         	Gbl_DoCompile = TRUE;
 		Gbl_PreprocessFlag = TRUE;
         	Gbl_UseDefaultAmlFilename = FALSE;
-        	Gbl_OutputFilenamePrefix = source;
+        	Gbl_OutputFilenamePrefix = (char*)source;
 
-		status = AslDoOnePathname(source, AslDoOneFile);
+		status = AslDoOnePathname((char*)source, AslDoOneFile);
 
 		close(pipefds[1]);