From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Linus Walleij <linus.walleij@linaro.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v1 2/2] gpiolib: of: Drop redundant check in of_mm_gpiochip_remove()
Date: Wed, 9 Nov 2022 17:07:34 +0200 [thread overview]
Message-ID: <20221109150734.38874-2-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20221109150734.38874-1-andriy.shevchenko@linux.intel.com>
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
next prev parent reply other threads:[~2022-11-09 15:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-09 15:07 [PATCH v1 1/2] gpiolib: of: Prepare of_mm_gpiochip_add_data() for fwnode Andy Shevchenko
2022-11-09 15:07 ` Andy Shevchenko [this message]
2022-11-09 21:13 ` [PATCH v1 2/2] gpiolib: of: Drop redundant check in of_mm_gpiochip_remove() Dmitry Torokhov
2022-11-09 15:16 ` [PATCH v1 1/2] gpiolib: of: Prepare of_mm_gpiochip_add_data() for fwnode Andy Shevchenko
2022-11-09 21:19 ` Dmitry Torokhov
2022-11-10 13:56 ` Andy Shevchenko
2022-11-10 10:11 ` Linus Walleij
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=20221109150734.38874-2-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=brgl@bgdev.pl \
--cc=dmitry.torokhov@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.