diff mbox

[2/2] ACPI / LPSS: make code less confusing for reader

Message ID 1363781670-28775-2-git-send-email-andriy.shevchenko@linux.intel.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Andy Shevchenko March 20, 2013, 12:14 p.m. UTC
The excerpt like this:

	if (err) {
		err = 0;
		goto error_out;
	}

makes a reader confused even if it's commented. Let's do necessary actions and
return no error explicitly.

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

Comments

Rafael Wysocki March 26, 2013, 1:36 p.m. UTC | #1
On Wednesday, March 20, 2013 02:14:30 PM Andy Shevchenko wrote:
> The excerpt like this:
> 
> 	if (err) {
> 		err = 0;
> 		goto error_out;
> 	}
> 
> makes a reader confused even if it's commented. Let's do necessary actions and
> return no error explicitly.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Applied to linux-pm.git/linux-next.

Thanks,
Rafael


> ---
>  drivers/acpi/acpi_lpss.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
> index c695841..5d7ded2 100644
> --- a/drivers/acpi/acpi_lpss.c
> +++ b/drivers/acpi/acpi_lpss.c
> @@ -152,8 +152,8 @@ static int acpi_lpss_create_device(struct acpi_device *adev,
>  			 * Skip the device, but don't terminate the namespace
>  			 * scan.
>  			 */
> -			ret = 0;
> -			goto err_out;
> +			kfree(pdata);
> +			return 0;
>  		}
>  	}
>  
>
diff mbox

Patch

diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
index c695841..5d7ded2 100644
--- a/drivers/acpi/acpi_lpss.c
+++ b/drivers/acpi/acpi_lpss.c
@@ -152,8 +152,8 @@  static int acpi_lpss_create_device(struct acpi_device *adev,
 			 * Skip the device, but don't terminate the namespace
 			 * scan.
 			 */
-			ret = 0;
-			goto err_out;
+			kfree(pdata);
+			return 0;
 		}
 	}