public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/2] gpiolib: of: Drop redundant check in of_mm_gpiochip_remove()
@ 2022-11-09 15:07 Andy Shevchenko
  2022-11-09 15:07 ` [PATCH v1 2/2] gpiolib: Get rid of not used of_node member Andy Shevchenko
  2022-11-09 15:14 ` [PATCH v1 1/2] gpiolib: of: Drop redundant check in of_mm_gpiochip_remove() Andy Shevchenko
  0 siblings, 2 replies; 6+ messages in thread
From: Andy Shevchenko @ 2022-11-09 15:07 UTC (permalink / raw)
  To: Andy Shevchenko, Raul E Rangel, Bartosz Golaszewski,
	Dmitry Torokhov, linux-gpio, linux-acpi, linux-kernel
  Cc: Mika Westerberg, Linus Walleij

The callers never call the function with invalid pointer.
Moreover, compiler quite likely dropped that check anyway
because we use that pointer before the check.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpiolib-of.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index feeb9e8e846d..83997434215e 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -963,9 +963,6 @@ void of_mm_gpiochip_remove(struct of_mm_gpio_chip *mm_gc)
 {
 	struct gpio_chip *gc = &mm_gc->gc;
 
-	if (!mm_gc)
-		return;
-
 	gpiochip_remove(gc);
 	iounmap(mm_gc->regs);
 	kfree(gc->label);
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-11-12 12:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-09 15:07 [PATCH v1 1/2] gpiolib: of: Drop redundant check in of_mm_gpiochip_remove() Andy Shevchenko
2022-11-09 15:07 ` [PATCH v1 2/2] gpiolib: Get rid of not used of_node member Andy Shevchenko
2022-11-09 15:15   ` Andy Shevchenko
2022-11-10 20:30   ` kernel test robot
2022-11-12 12:05   ` kernel test robot
2022-11-09 15:14 ` [PATCH v1 1/2] gpiolib: of: Drop redundant check in of_mm_gpiochip_remove() Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox