linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vcodec: mediatek: fix odd_ptr_err.cocci warnings
@ 2016-09-06 14:51 Julia Lawall
  2016-09-07  5:25 ` Tiffany Lin
  0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2016-09-06 14:51 UTC (permalink / raw)
  To: Tiffany Lin
  Cc: Hans Verkuil, Mauro Carvalho Chehab, linux-media,
	Matthias Brugger, linux-arm-kernel, linux-mediatek, linux-kernel,
	kbuild-all

PTR_ERR should access the value just tested by IS_ERR

Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci

CC: Tiffany Lin <tiffany.lin@mediatek.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

 mtk_vcodec_dec_drv.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c
@@ -255,7 +255,7 @@ static int mtk_vcodec_probe(struct platf
 		}
 		dev->reg_base[i] = devm_ioremap_resource(&pdev->dev, res);
 		if (IS_ERR((__force void *)dev->reg_base[i])) {
-			ret = PTR_ERR((__force void *)dev->reg_base);
+			ret = PTR_ERR((__force void *)dev->reg_base[i]);
 			goto err_res;
 		}
 		mtk_v4l2_debug(2, "reg[%d] base=%p", i, dev->reg_base[i]);

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

* Re: [PATCH] vcodec: mediatek: fix odd_ptr_err.cocci warnings
  2016-09-06 14:51 [PATCH] vcodec: mediatek: fix odd_ptr_err.cocci warnings Julia Lawall
@ 2016-09-07  5:25 ` Tiffany Lin
  0 siblings, 0 replies; 2+ messages in thread
From: Tiffany Lin @ 2016-09-07  5:25 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Hans Verkuil, Mauro Carvalho Chehab, linux-media,
	Matthias Brugger, linux-arm-kernel, linux-mediatek, linux-kernel,
	kbuild-all

On Tue, 2016-09-06 at 22:51 +0800, Julia Lawall wrote:
> PTR_ERR should access the value just tested by IS_ERR
> 
> Generated by: scripts/coccinelle/tests/odd_ptr_err.cocci
> 
> CC: Tiffany Lin <tiffany.lin@mediatek.com>
> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>

Reviewed-by:Tiffany Lin <tiffany.lin@mediatek.com>

> ---
> 
>  mtk_vcodec_dec_drv.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c
> +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_drv.c
> @@ -255,7 +255,7 @@ static int mtk_vcodec_probe(struct platf
>  		}
>  		dev->reg_base[i] = devm_ioremap_resource(&pdev->dev, res);
>  		if (IS_ERR((__force void *)dev->reg_base[i])) {
> -			ret = PTR_ERR((__force void *)dev->reg_base);
> +			ret = PTR_ERR((__force void *)dev->reg_base[i]);
>  			goto err_res;
>  		}
>  		mtk_v4l2_debug(2, "reg[%d] base=%p", i, dev->reg_base[i]);

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

end of thread, other threads:[~2016-09-07  5:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-06 14:51 [PATCH] vcodec: mediatek: fix odd_ptr_err.cocci warnings Julia Lawall
2016-09-07  5:25 ` Tiffany Lin

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).