diff mbox series

[v2,1/4] ACPI: platform: Get rid of redundant 'else'

Message ID 20220831140327.79149-1-andriy.shevchenko@linux.intel.com
State Accepted
Commit f3bc9ca5285de3b3a149f18c60c05ab57b0a0a4e
Headers show
Series [v2,1/4] ACPI: platform: Get rid of redundant 'else' | expand

Commit Message

Andy Shevchenko Aug. 31, 2022, 2:03 p.m. UTC
In the snippets like the following

	if (...)
		return / goto / break / continue ...;
	else
		...

the 'else' is redundant. Get rid of it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v2: no changes
 drivers/acpi/acpi_platform.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Rafael J. Wysocki Sept. 3, 2022, 6:54 p.m. UTC | #1
On Wed, Aug 31, 2022 at 4:03 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> In the snippets like the following
>
>         if (...)
>                 return / goto / break / continue ...;
>         else
>                 ...
>
> the 'else' is redundant. Get rid of it.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> v2: no changes
>  drivers/acpi/acpi_platform.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c
> index 1a1c78b23fba..75e26528056d 100644
> --- a/drivers/acpi/acpi_platform.c
> +++ b/drivers/acpi/acpi_platform.c
> @@ -114,9 +114,9 @@ struct platform_device *acpi_create_platform_device(struct acpi_device *adev,
>
>         INIT_LIST_HEAD(&resource_list);
>         count = acpi_dev_get_resources(adev, &resource_list, NULL, NULL);
> -       if (count < 0) {
> +       if (count < 0)
>                 return NULL;
> -       } else if (count > 0) {
> +       if (count > 0) {
>                 resources = kcalloc(count, sizeof(struct resource),
>                                     GFP_KERNEL);
>                 if (!resources) {
> --

Whole series applied as 6.1 material, thanks!
diff mbox series

Patch

diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c
index 1a1c78b23fba..75e26528056d 100644
--- a/drivers/acpi/acpi_platform.c
+++ b/drivers/acpi/acpi_platform.c
@@ -114,9 +114,9 @@  struct platform_device *acpi_create_platform_device(struct acpi_device *adev,
 
 	INIT_LIST_HEAD(&resource_list);
 	count = acpi_dev_get_resources(adev, &resource_list, NULL, NULL);
-	if (count < 0) {
+	if (count < 0)
 		return NULL;
-	} else if (count > 0) {
+	if (count > 0) {
 		resources = kcalloc(count, sizeof(struct resource),
 				    GFP_KERNEL);
 		if (!resources) {