Linux-ACPI Archive on lore.kernel.org
 help / color / 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	[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, back to index

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

Linux-ACPI Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-acpi/0 linux-acpi/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-acpi linux-acpi/ https://lore.kernel.org/linux-acpi \
		linux-acpi@vger.kernel.org linux-acpi@archiver.kernel.org
	public-inbox-index linux-acpi


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-acpi


AGPL code for this site: git clone https://public-inbox.org/ public-inbox