lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240411172540.4122581-4-andriy.shevchenko@linux.intel.com>
Date: Thu, 11 Apr 2024 20:22:30 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Bartosz Golaszewski <bartosz.golaszewski@...aro.org>,
	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
	David Thompson <davthompson@...dia.com>,
	Linus Walleij <linus.walleij@...aro.org>,
	Patrick Rudolph <patrick.rudolph@...ements.com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
	linux-gpio@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	linux-acpi@...r.kernel.org,
	netdev@...r.kernel.org
Cc: Bartosz Golaszewski <brgl@...ev.pl>,
	Mika Westerberg <mika.westerberg@...ux.intel.com>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>,
	Paolo Abeni <pabeni@...hat.com>,
	"Rafael J. Wysocki" <rafael@...nel.org>,
	Len Brown <lenb@...nel.org>
Subject: [PATCH v1 2/4] gpiolib: acpi: Simplify error handling in __acpi_find_gpio()

Now that we don't perform anything on the GPIO descriptor,
we may simplify the error path in newly introduced helper.
Do it so.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
---
 drivers/gpio/gpiolib-acpi.c | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c
index d47b22ac3ecb..fb2e14670b7a 100644
--- a/drivers/gpio/gpiolib-acpi.c
+++ b/drivers/gpio/gpiolib-acpi.c
@@ -974,20 +974,14 @@ __acpi_find_gpio(struct fwnode_handle *fwnode, const char *con_id, unsigned int
 			return ERR_CAST(desc);
 
 		if (!IS_ERR(desc))
-			break;
-	}
-
-	/* Then from plain _CRS GPIOs */
-	if (IS_ERR(desc)) {
-		if (!adev || !acpi_can_fallback_to_crs(adev, con_id))
-			return ERR_PTR(-ENOENT);
-
-		desc = acpi_get_gpiod_by_index(adev, NULL, idx, info);
-		if (IS_ERR(desc))
 			return desc;
 	}
 
-	return desc;
+	/* Then from plain _CRS GPIOs */
+	if (!adev || !acpi_can_fallback_to_crs(adev, con_id))
+		return ERR_PTR(-ENOENT);
+
+	return acpi_get_gpiod_by_index(adev, NULL, idx, info);
 }
 
 struct gpio_desc *acpi_find_gpio(struct fwnode_handle *fwnode,
-- 
2.43.0.rc1.1336.g36b5255a03ac


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ