public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Corey Minyard <cminyard@mvista.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	openipmi-developer@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Cc: Corey Minyard <minyard@acm.org>
Subject: [PATCH v2 02/10] ipmi_si: Remove bogus err_free label
Date: Fri,  2 Apr 2021 20:43:26 +0300	[thread overview]
Message-ID: <20210402174334.13466-3-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20210402174334.13466-1-andriy.shevchenko@linux.intel.com>

There is no more 'free' in the error path, so drop the label and
return errors inline.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/char/ipmi/ipmi_si_platform.c | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/drivers/char/ipmi/ipmi_si_platform.c b/drivers/char/ipmi/ipmi_si_platform.c
index 8f2fefc015b2..e5cd5006f0e5 100644
--- a/drivers/char/ipmi/ipmi_si_platform.c
+++ b/drivers/char/ipmi/ipmi_si_platform.c
@@ -316,7 +316,6 @@ static int acpi_ipmi_probe(struct platform_device *pdev)
 	acpi_status status;
 	unsigned long long tmp;
 	struct resource *res;
-	int rv = -EINVAL;
 
 	if (!si_tryacpi)
 		return -ENODEV;
@@ -336,7 +335,7 @@ static int acpi_ipmi_probe(struct platform_device *pdev)
 	if (ACPI_FAILURE(status)) {
 		dev_err(&pdev->dev,
 			"Could not find ACPI IPMI interface type\n");
-		goto err_free;
+		return -EINVAL;
 	}
 
 	switch (tmp) {
@@ -350,21 +349,18 @@ static int acpi_ipmi_probe(struct platform_device *pdev)
 		io.si_type = SI_BT;
 		break;
 	case 4: /* SSIF, just ignore */
-		rv = -ENODEV;
-		goto err_free;
+		return -ENODEV;
 	default:
 		dev_info(&pdev->dev, "unknown IPMI type %lld\n", tmp);
-		goto err_free;
+		return -EINVAL;
 	}
 
 	io.regsize = DEFAULT_REGSIZE;
 	io.regshift = 0;
 
 	res = ipmi_get_info_from_resources(pdev, &io);
-	if (!res) {
-		rv = -EINVAL;
-		goto err_free;
-	}
+	if (!res)
+		return -EINVAL;
 
 	/* If _GPE exists, use it; otherwise use standard interrupts */
 	status = acpi_evaluate_integer(handle, "_GPE", NULL, &tmp);
@@ -390,9 +386,6 @@ static int acpi_ipmi_probe(struct platform_device *pdev)
 	request_module("acpi_ipmi");
 
 	return ipmi_si_add_smi(&io);
-
-err_free:
-	return rv;
 }
 
 static const struct acpi_device_id acpi_ipmi_match[] = {
-- 
2.30.2


  parent reply	other threads:[~2021-04-02 17:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-02 17:43 [PATCH v2 00/10] ipmi_si: Set of clean ups Andy Shevchenko
2021-04-02 17:43 ` [PATCH v2 01/10] ipmi_si: Switch to use platform_get_mem_or_io() Andy Shevchenko
2021-04-02 17:43 ` Andy Shevchenko [this message]
2021-04-02 17:43 ` [PATCH v2 03/10] ipmi_si: Utilize temporary variable to hold device pointer Andy Shevchenko
2021-04-02 17:43 ` [PATCH v2 04/10] ipmi_si: Use proper ACPI macros to check error code for failures Andy Shevchenko
2021-04-02 17:43 ` [PATCH v2 05/10] ipmi_si: Introduce ipmi_panic_event_str[] array Andy Shevchenko
2021-04-02 17:43 ` [PATCH v2 06/10] ipmi_si: Reuse si_to_str[] array in ipmi_hardcode_init_one() Andy Shevchenko
2021-04-02 17:43 ` [PATCH v2 07/10] ipmi_si: Get rid of ->addr_source_cleanup() Andy Shevchenko
2021-04-02 17:43 ` [PATCH v2 08/10] ipmi_si: Use strstrip() to remove surrounding spaces Andy Shevchenko
2021-04-02 17:43 ` [PATCH v2 09/10] ipmi_si: Drop redundant check before calling put_device() Andy Shevchenko
2021-04-02 17:43 ` [PATCH v2 10/10] ipmi_si: Join string literals back Andy Shevchenko
2021-04-02 18:25 ` [PATCH v2 00/10] ipmi_si: Set of clean ups Corey Minyard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210402174334.13466-3-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=cminyard@mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=minyard@acm.org \
    --cc=openipmi-developer@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox