* [PATCH] i2c: omap: fix usage of IS_ERR_VALUE with pm_runtime_get_sync
@ 2014-03-27 16:18 Nishanth Menon
[not found] ` <1395937113-10222-1-git-send-email-nm-l0cyMroinI0@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Nishanth Menon @ 2014-03-27 16:18 UTC (permalink / raw)
To: Tony Lindgren, Wolfram Sang
Cc: linux-omap-u79uwXL29TY76Z2rM5mHXA,
linux-i2c-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Nishanth Menon
we use IS_ERR_VALUE to check for error values of pm_runtime_get_sync,
when the value can only be < 0 in the case of err. Replace the
check with a simpler < 0 check.
This fixes the coccicheck warnings:
linux-2.6/drivers/i2c/busses/i2c-omap.c:1157:5-24:
pm_runtime_get_sync returns < 0 as error. Unecessary IS_ERR_VALUE at
line 1158
linux-2.6/drivers/i2c/busses/i2c-omap.c:1278:7-26:
pm_runtime_get_sync returns < 0 as error. Unecessary IS_ERR_VALUE at
line 1279
drivers/i2c/busses/i2c-omap.c:638:5-24:
pm_runtime_get_sync returns < 0 as error. Unecessary IS_ERR_VALUE at
line 639
Signed-off-by: Nishanth Menon <nm-l0cyMroinI0@public.gmane.org>
---
Patch based on: v3.14-rc8
coccicheck report based on next-20140326 tag
drivers/i2c/busses/i2c-omap.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 90dcc2e..078a3de 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -636,7 +636,7 @@ omap_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
int r;
r = pm_runtime_get_sync(dev->dev);
- if (IS_ERR_VALUE(r))
+ if (r < 0)
goto out;
r = omap_i2c_wait_for_bb(dev);
@@ -1155,7 +1155,7 @@ omap_i2c_probe(struct platform_device *pdev)
pm_runtime_use_autosuspend(dev->dev);
r = pm_runtime_get_sync(dev->dev);
- if (IS_ERR_VALUE(r))
+ if (r < 0)
goto err_free_mem;
/*
@@ -1276,7 +1276,7 @@ static int omap_i2c_remove(struct platform_device *pdev)
i2c_del_adapter(&dev->adapter);
ret = pm_runtime_get_sync(&pdev->dev);
- if (IS_ERR_VALUE(ret))
+ if (ret < 0)
return ret;
omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] i2c: omap: fix usage of IS_ERR_VALUE with pm_runtime_get_sync
[not found] ` <1395937113-10222-1-git-send-email-nm-l0cyMroinI0@public.gmane.org>
@ 2014-03-27 16:23 ` Felipe Balbi
2014-03-27 17:52 ` Wolfram Sang
1 sibling, 0 replies; 3+ messages in thread
From: Felipe Balbi @ 2014-03-27 16:23 UTC (permalink / raw)
To: Nishanth Menon
Cc: Tony Lindgren, Wolfram Sang, linux-omap-u79uwXL29TY76Z2rM5mHXA,
linux-i2c-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 2304 bytes --]
On Thu, Mar 27, 2014 at 11:18:33AM -0500, Nishanth Menon wrote:
> we use IS_ERR_VALUE to check for error values of pm_runtime_get_sync,
> when the value can only be < 0 in the case of err. Replace the
> check with a simpler < 0 check.
>
> This fixes the coccicheck warnings:
> linux-2.6/drivers/i2c/busses/i2c-omap.c:1157:5-24:
> pm_runtime_get_sync returns < 0 as error. Unecessary IS_ERR_VALUE at
> line 1158
> linux-2.6/drivers/i2c/busses/i2c-omap.c:1278:7-26:
> pm_runtime_get_sync returns < 0 as error. Unecessary IS_ERR_VALUE at
> line 1279
> drivers/i2c/busses/i2c-omap.c:638:5-24:
> pm_runtime_get_sync returns < 0 as error. Unecessary IS_ERR_VALUE at
> line 639
>
> Signed-off-by: Nishanth Menon <nm-l0cyMroinI0@public.gmane.org>
Reviewed-by: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>
> ---
> Patch based on: v3.14-rc8
> coccicheck report based on next-20140326 tag
>
> drivers/i2c/busses/i2c-omap.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
> index 90dcc2e..078a3de 100644
> --- a/drivers/i2c/busses/i2c-omap.c
> +++ b/drivers/i2c/busses/i2c-omap.c
> @@ -636,7 +636,7 @@ omap_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
> int r;
>
> r = pm_runtime_get_sync(dev->dev);
> - if (IS_ERR_VALUE(r))
> + if (r < 0)
> goto out;
>
> r = omap_i2c_wait_for_bb(dev);
> @@ -1155,7 +1155,7 @@ omap_i2c_probe(struct platform_device *pdev)
> pm_runtime_use_autosuspend(dev->dev);
>
> r = pm_runtime_get_sync(dev->dev);
> - if (IS_ERR_VALUE(r))
> + if (r < 0)
> goto err_free_mem;
>
> /*
> @@ -1276,7 +1276,7 @@ static int omap_i2c_remove(struct platform_device *pdev)
>
> i2c_del_adapter(&dev->adapter);
> ret = pm_runtime_get_sync(&pdev->dev);
> - if (IS_ERR_VALUE(ret))
> + if (ret < 0)
> return ret;
>
> omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0);
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] i2c: omap: fix usage of IS_ERR_VALUE with pm_runtime_get_sync
[not found] ` <1395937113-10222-1-git-send-email-nm-l0cyMroinI0@public.gmane.org>
2014-03-27 16:23 ` Felipe Balbi
@ 2014-03-27 17:52 ` Wolfram Sang
1 sibling, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2014-03-27 17:52 UTC (permalink / raw)
To: Nishanth Menon
Cc: Tony Lindgren, linux-omap-u79uwXL29TY76Z2rM5mHXA,
linux-i2c-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 792 bytes --]
On Thu, Mar 27, 2014 at 11:18:33AM -0500, Nishanth Menon wrote:
> we use IS_ERR_VALUE to check for error values of pm_runtime_get_sync,
> when the value can only be < 0 in the case of err. Replace the
> check with a simpler < 0 check.
>
> This fixes the coccicheck warnings:
> linux-2.6/drivers/i2c/busses/i2c-omap.c:1157:5-24:
> pm_runtime_get_sync returns < 0 as error. Unecessary IS_ERR_VALUE at
> line 1158
> linux-2.6/drivers/i2c/busses/i2c-omap.c:1278:7-26:
> pm_runtime_get_sync returns < 0 as error. Unecessary IS_ERR_VALUE at
> line 1279
> drivers/i2c/busses/i2c-omap.c:638:5-24:
> pm_runtime_get_sync returns < 0 as error. Unecessary IS_ERR_VALUE at
> line 639
>
> Signed-off-by: Nishanth Menon <nm-l0cyMroinI0@public.gmane.org>
Applied to for-next, thanks!
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-03-27 17:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-27 16:18 [PATCH] i2c: omap: fix usage of IS_ERR_VALUE with pm_runtime_get_sync Nishanth Menon
[not found] ` <1395937113-10222-1-git-send-email-nm-l0cyMroinI0@public.gmane.org>
2014-03-27 16:23 ` Felipe Balbi
2014-03-27 17:52 ` Wolfram Sang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).