linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ACPICA: Namespace: fix the no brace needed warning
@ 2019-08-31  8:31 tiantao
  2019-09-02 21:32 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: tiantao @ 2019-08-31  8:31 UTC (permalink / raw)
  To: rafael.j.wysocki, guohanjun, robert.moore, erik.schmauss, lenb
  Cc: linuxarm, linux-acpi, devel, linux-kernel

for if else statements having single block no braces are needed fixed
the following checkpatch warning

WARNING: braces {} are not necessary for any arm of this statement
+               if (!prev_node) {
[...]
+               } else {
[...]

Signed-off-by: tiantao <tiantao6@huawei.com>
---
 drivers/acpi/acpica/nsaccess.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/acpica/nsaccess.c b/drivers/acpi/acpica/nsaccess.c
index 2566e2d..7cef22a 100644
--- a/drivers/acpi/acpica/nsaccess.c
+++ b/drivers/acpi/acpica/nsaccess.c
@@ -109,11 +109,10 @@ acpi_status acpi_ns_root_initialize(void)
 		new_node->descriptor_type = ACPI_DESC_TYPE_NAMED;
 		new_node->type = init_val->type;
 
-		if (!prev_node) {
+		if (!prev_node)
 			acpi_gbl_root_node_struct.child = new_node;
-		} else {
+		else
 			prev_node->peer = new_node;
-		}
 
 		new_node->parent = &acpi_gbl_root_node_struct;
 		prev_node = new_node;
-- 
2.7.4


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

* Re: [PATCH] ACPICA: Namespace: fix the no brace needed warning
  2019-08-31  8:31 [PATCH] ACPICA: Namespace: fix the no brace needed warning tiantao
@ 2019-09-02 21:32 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2019-09-02 21:32 UTC (permalink / raw)
  To: tiantao
  Cc: Rafael Wysocki, Hanjun Guo, Robert Moore, Schmauss, Erik,
	Len Brown, Linuxarm, ACPI Devel Maling List,
	open list:ACPI COMPONENT ARCHITECTURE (ACPICA),
	Linux Kernel Mailing List

On Sat, Aug 31, 2019 at 10:34 AM tiantao <tiantao6@huawei.com> wrote:
>
> for if else statements having single block no braces are needed fixed
> the following checkpatch warning
>
> WARNING: braces {} are not necessary for any arm of this statement
> +               if (!prev_node) {
> [...]
> +               } else {
> [...]
>
> Signed-off-by: tiantao <tiantao6@huawei.com>
> ---
>  drivers/acpi/acpica/nsaccess.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/acpi/acpica/nsaccess.c b/drivers/acpi/acpica/nsaccess.c
> index 2566e2d..7cef22a 100644
> --- a/drivers/acpi/acpica/nsaccess.c
> +++ b/drivers/acpi/acpica/nsaccess.c
> @@ -109,11 +109,10 @@ acpi_status acpi_ns_root_initialize(void)
>                 new_node->descriptor_type = ACPI_DESC_TYPE_NAMED;
>                 new_node->type = init_val->type;
>
> -               if (!prev_node) {
> +               if (!prev_node)
>                         acpi_gbl_root_node_struct.child = new_node;
> -               } else {
> +               else
>                         prev_node->peer = new_node;
> -               }
>
>                 new_node->parent = &acpi_gbl_root_node_struct;
>                 prev_node = new_node;
> --

The ACPICA code comes from an external project and the coding style in
it is different from the rest of the kernel, so the patch is not
applicable.

Thanks!

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

end of thread, other threads:[~2019-09-02 21:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-31  8:31 [PATCH] ACPICA: Namespace: fix the no brace needed warning tiantao
2019-09-02 21:32 ` 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).