* [PATCH] i2c: nomadik: remove an unnecessary NULL check in nmk_i2c_remove()
@ 2019-03-28 14:16 Dan Carpenter
2019-03-28 16:14 ` Linus Walleij
2019-04-03 20:49 ` Wolfram Sang
0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2019-03-28 14:16 UTC (permalink / raw)
To: kernel-janitors
"res" can't be NULL because it's a pointer to somewhere in the middle of
the "adev" struct. Also probe() succeeded so there is no need to check
here.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/i2c/busses/i2c-nomadik.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c
index 0ed5a41804dc..4f30a43b63da 100644
--- a/drivers/i2c/busses/i2c-nomadik.c
+++ b/drivers/i2c/busses/i2c-nomadik.c
@@ -1070,8 +1070,7 @@ static int nmk_i2c_remove(struct amba_device *adev)
/* disable the controller */
i2c_clr_bit(dev->virtbase + I2C_CR, I2C_CR_PE);
clk_disable_unprepare(dev->clk);
- if (res)
- release_mem_region(res->start, resource_size(res));
+ release_mem_region(res->start, resource_size(res));
return 0;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] i2c: nomadik: remove an unnecessary NULL check in nmk_i2c_remove()
2019-03-28 14:16 [PATCH] i2c: nomadik: remove an unnecessary NULL check in nmk_i2c_remove() Dan Carpenter
@ 2019-03-28 16:14 ` Linus Walleij
2019-04-03 20:49 ` Wolfram Sang
1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2019-03-28 16:14 UTC (permalink / raw)
To: kernel-janitors
On Thu, Mar 28, 2019 at 3:16 PM Dan Carpenter <dan.carpenter@oracle.com> wrote:
> "res" can't be NULL because it's a pointer to somewhere in the middle of
> the "adev" struct. Also probe() succeeded so there is no need to check
> here.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] i2c: nomadik: remove an unnecessary NULL check in nmk_i2c_remove()
2019-03-28 14:16 [PATCH] i2c: nomadik: remove an unnecessary NULL check in nmk_i2c_remove() Dan Carpenter
2019-03-28 16:14 ` Linus Walleij
@ 2019-04-03 20:49 ` Wolfram Sang
1 sibling, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2019-04-03 20:49 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 321 bytes --]
On Thu, Mar 28, 2019 at 05:16:09PM +0300, Dan Carpenter wrote:
> "res" can't be NULL because it's a pointer to somewhere in the middle of
> the "adev" struct. Also probe() succeeded so there is no need to check
> here.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Applied to for-next, thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-04-03 20:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-28 14:16 [PATCH] i2c: nomadik: remove an unnecessary NULL check in nmk_i2c_remove() Dan Carpenter
2019-03-28 16:14 ` Linus Walleij
2019-04-03 20:49 ` Wolfram Sang
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.