drivers/acpi/utils.c: Fixed coding style issues
PATCH 1/1 drivers/acpi/utils.c: Fixed coding style issues
Quoted 1 line
From
e770496964bf749c30df8a19abbdfe0f79d64fb7Mon Sep 17 00:00:00 2001
From: Karthigan Srinivasan <[email protected]>
Date: Wed, 20 Apr 2011 18:14:10 -0500
Subject: [PATCH] drivers/acpi/utils.c: Fixed coding style issues.
Fixed brace and comment coding style issues in code.
--- drivers/acpi/utils.c | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-)
drivers/acpi/utils.c +9 -9
@@ -99,9 +99,9 @@ acpi_extract_package(union acpi_object *package,union acpi_object *element = &(package->package.elements[i]); -if (!element) { +if (!element)return AE_BAD_DATA ; - } +switch (element->type) {
@@ -185,9 +185,9 @@ acpi_extract_package(union acpi_object *package,u8 **pointer =NULL ;union acpi_object *element = &(package->package.elements[i]); -if (!element) { +if (!element)return AE_BAD_DATA ; - } +switch (element->type) {
@@ -303,9 +303,9 @@ acpi_evaluate_reference(acpi_handle handle,u32 i =0 ; -if (!list) { +if (!list)return AE_BAD_PARAMETER ; - } +/* Evaluate object. */
@@ -337,9 +337,9 @@ acpi_evaluate_reference(acpi_handle handle, goto end; } -if (package->package.count >ACPI_MAX_HANDLES ) { +if (package->package.count >ACPI_MAX_HANDLES )return AE_NO_MEMORY ; - } + list->count = package->package.count;/* Extract package data. */
@@ -373,7 +373,7 @@ acpi_evaluate_reference(acpi_handle handle, end:if (ACPI_FAILURE (status)) { list->count =0 ; -//kfree(list->handles); +/* kfree(list->handles);*/ }kfree (buffer.pointer);
Signature · 1 line
1.7.1
* Karthigan Srinivasan <[email protected]>:
Quoted 12 lines
Fixed brace and comment coding style issues in code.
Signed-off-by Karthigan Srinivasan <[email protected]>--- drivers/acpi/utils.c | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-)drivers/acpi/utils.c +0
-0
drivers/acpi/utils.c acpi_extract_package(union acpi_object *package, · line 102
Quoted 5 lines
drivers/acpi/utils.c +1
-1@@ -99,9 +99,9 @@ acpi_extract_package(union acpi_object *package,union acpi_object *element = &(package->package.elements[i]); -if (!element) { +if (!element)
^
You are introducing trailing whitespace.
drivers/acpi/utils.c acpi_extract_package(union acpi_object *package, · line 104
Quoted 3 lines
drivers/acpi/utils.c +1
-1return AE_BAD_DATA ; - } +
^^^^^^^^^^^^^
For every pair of braces you clean away, you're adding two new coding style issues.
Best regards,
Nicolas Kaiser
Quoted 8 lines
You are introducing trailing whitespace.
Review
Quoted 3 lines
(quoted diff) +1
-1return AE_BAD_DATA; - } +^^^^^^^^^^^^^
For every pair of braces you clean away, you're adding two new coding style issues.
Nicolas - appreciate your feedback and apologize for the error. I have corrected these issues. Re-submitting patch below with corrections.
Best Regards,
Karthigan Srinivasan.
Fixed brace and comment coding style issues is code.
--- drivers/acpi/utils.c | 15 ++++++--------- 1 files changed, 6 insertions(+), 9 deletions(-)
drivers/acpi/utils.c +6 -9
@@ -99,9 +99,8 @@ acpi_extract_package(union acpi_object *package,union acpi_object *element = &(package->package.elements[i]); -if (!element) { +if (!element)return AE_BAD_DATA ; - }switch (element->type) {
@@ -185,9 +184,8 @@ acpi_extract_package(union acpi_object *package,u8 **pointer =NULL ;union acpi_object *element = &(package->package.elements[i]); -if (!element) { +if (!element)return AE_BAD_DATA ; - }switch (element->type) {
@@ -303,9 +301,8 @@ acpi_evaluate_reference(acpi_handle handle,u32 i =0 ; -if (!list) { +if (!list)return AE_BAD_PARAMETER ; - }/* Evaluate object. */
@@ -337,9 +334,9 @@ acpi_evaluate_reference(acpi_handle handle, goto end; } -if (package->package.count >ACPI_MAX_HANDLES ) { +if (package->package.count >ACPI_MAX_HANDLES )return AE_NO_MEMORY ; - } + list->count = package->package.count;/* Extract package data. */
@@ -373,7 +370,7 @@ acpi_evaluate_reference(acpi_handle handle, end:if (ACPI_FAILURE (status)) { list->count =0 ; -//kfree(list->handles); +/* kfree(list->handles); */ }kfree (buffer.pointer);
Signature · 1 line
1.7.1
Quoted 1 line · Karthigan Srinivasan
Len - I submitted this patch on 4/21 and have not received any acknowledgement. I am re-submitting it again. Please review and approve.
Best Regards,
Karthigan Srinivasan.
====
Fixed brace and comment coding style issues is code.
--- drivers/acpi/utils.c | 15 ++++++--------- 1 files changed, 6 insertions(+), 9 deletions(-)
drivers/acpi/utils.c +6 -9
@@ -99,9 +99,8 @@ acpi_extract_package(union acpi_object *package,union acpi_object *element = &(package->package.elements[i]); -if (!element) { +if (!element)return AE_BAD_DATA ; - }switch (element->type) {
@@ -185,9 +184,8 @@ acpi_extract_package(union acpi_object *package,u8 **pointer =NULL ;union acpi_object *element = &(package->package.elements[i]); -if (!element) { +if (!element)return AE_BAD_DATA ; - }switch (element->type) {
@@ -303,9 +301,8 @@ acpi_evaluate_reference(acpi_handle handle,u32 i =0 ; -if (!list) { +if (!list)return AE_BAD_PARAMETER ; - }/* Evaluate object. */
@@ -337,9 +334,9 @@ acpi_evaluate_reference(acpi_handle handle, goto end; } -if (package->package.count >ACPI_MAX_HANDLES ) { +if (package->package.count >ACPI_MAX_HANDLES )return AE_NO_MEMORY ; - } + list->count = package->package.count;/* Extract package data. */
@@ -373,7 +370,7 @@ acpi_evaluate_reference(acpi_handle handle, end:if (ACPI_FAILURE (status)) { list->count =0 ; -//kfree(list->handles); +/* kfree(list->handles); */ }kfree (buffer.pointer);
Signature · 1 line
1.7.1
drivers/acpi/utils.c acpi_evaluate_reference(acpi_handle handle, · line 373
Quoted 7 lines · Karthigan Srinivasan
drivers/acpi/utils.c | 15 ++++++---------drivers/acpi/utils.c +1
-1@@ -373,7 +370,7 @@ acpi_evaluate_reference(acpi_handle handle, end:if (ACPI_FAILURE (status)) { list->count =0 ; -//kfree(list->handles); +/* kfree(list->handles); */
Just delete the line instead.
Quoted 4 lines
Review
Quoted 2 lines
(quoted diff) +1
-1- //kfree(list->handles); + /* kfree(list->handles); */Just delete the line instead.
Len, Joe, Nicolas - re-submitting patch with above recommended change.
Best Regards,
Karthigan.
=========
Fixed brace, comment, and label coding style issues.
--- drivers/acpi/utils.c | 19 +++++++------------ 1 files changed, 7 insertions(+), 12 deletions(-)
drivers/acpi/utils.c +7 -12
@@ -99,9 +99,8 @@ acpi_extract_package(union acpi_object *package,union acpi_object *element = &(package->package.elements[i]); -if (!element) { +if (!element)return AE_BAD_DATA ; - }switch (element->type) {
@@ -185,9 +184,8 @@ acpi_extract_package(union acpi_object *package,u8 **pointer =NULL ;union acpi_object *element = &(package->package.elements[i]); -if (!element) { +if (!element)return AE_BAD_DATA ; - }switch (element->type) {
@@ -303,9 +301,8 @@ acpi_evaluate_reference(acpi_handle handle,u32 i =0 ; -if (!list) { +if (!list)return AE_BAD_PARAMETER ; - }/* Evaluate object. */
@@ -337,9 +334,9 @@ acpi_evaluate_reference(acpi_handle handle, goto end; } -if (package->package.count >ACPI_MAX_HANDLES ) { +if (package->package.count >ACPI_MAX_HANDLES )return AE_NO_MEMORY ; - } + list->count = package->package.count;/* Extract package data. */
@@ -370,11 +367,9 @@ acpi_evaluate_reference(acpi_handle handle, list->handles[i])); } - end: -if (ACPI_FAILURE (status)) { +end: +if (ACPI_FAILURE (status)) list->count =0 ; -//kfree(list->handles); - }kfree (buffer.pointer);
Signature · 1 line
1.7.1