* [PATCH] nvmem: delete unneeded IS_ERR test @ 2015-12-19 21:19 ` Julia Lawall 0 siblings, 0 replies; 7+ messages in thread From: Julia Lawall @ 2015-12-19 21:19 UTC (permalink / raw) To: linux-arm-kernel devm_kzalloc returns NULL rather than an ERR_PTR value. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression x,e; @@ * x = devm_kzalloc(...) ... when != x = e * IS_ERR(x) // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> --- drivers/nvmem/rockchip-efuse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/nvmem/rockchip-efuse.c b/drivers/nvmem/rockchip-efuse.c index f552134..811c73c 100644 --- a/drivers/nvmem/rockchip-efuse.c +++ b/drivers/nvmem/rockchip-efuse.c @@ -136,8 +136,8 @@ static int rockchip_efuse_probe(struct platform_device *pdev) context = devm_kzalloc(dev, sizeof(struct rockchip_efuse_context), GFP_KERNEL); - if (IS_ERR(context)) - return PTR_ERR(context); + if (!context) + return -ENOMEM; clk = devm_clk_get(dev, "pclk_efuse"); if (IS_ERR(clk)) ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH] nvmem: delete unneeded IS_ERR test @ 2015-12-19 21:19 ` Julia Lawall 0 siblings, 0 replies; 7+ messages in thread From: Julia Lawall @ 2015-12-19 21:19 UTC (permalink / raw) To: linux-arm-kernel devm_kzalloc returns NULL rather than an ERR_PTR value. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression x,e; @@ * x = devm_kzalloc(...) ... when != x = e * IS_ERR(x) // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> --- drivers/nvmem/rockchip-efuse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/nvmem/rockchip-efuse.c b/drivers/nvmem/rockchip-efuse.c index f552134..811c73c 100644 --- a/drivers/nvmem/rockchip-efuse.c +++ b/drivers/nvmem/rockchip-efuse.c @@ -136,8 +136,8 @@ static int rockchip_efuse_probe(struct platform_device *pdev) context = devm_kzalloc(dev, sizeof(struct rockchip_efuse_context), GFP_KERNEL); - if (IS_ERR(context)) - return PTR_ERR(context); + if (!context) + return -ENOMEM; clk = devm_clk_get(dev, "pclk_efuse"); if (IS_ERR(clk)) ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH] nvmem: delete unneeded IS_ERR test @ 2015-12-19 21:19 ` Julia Lawall 0 siblings, 0 replies; 7+ messages in thread From: Julia Lawall @ 2015-12-19 21:19 UTC (permalink / raw) To: Srinivas Kandagatla Cc: kernel-janitors, Maxime Ripard, Heiko Stuebner, linux-arm-kernel, linux-rockchip, linux-kernel devm_kzalloc returns NULL rather than an ERR_PTR value. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression x,e; @@ * x = devm_kzalloc(...) ... when != x = e * IS_ERR(x) // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> --- drivers/nvmem/rockchip-efuse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/nvmem/rockchip-efuse.c b/drivers/nvmem/rockchip-efuse.c index f552134..811c73c 100644 --- a/drivers/nvmem/rockchip-efuse.c +++ b/drivers/nvmem/rockchip-efuse.c @@ -136,8 +136,8 @@ static int rockchip_efuse_probe(struct platform_device *pdev) context = devm_kzalloc(dev, sizeof(struct rockchip_efuse_context), GFP_KERNEL); - if (IS_ERR(context)) - return PTR_ERR(context); + if (!context) + return -ENOMEM; clk = devm_clk_get(dev, "pclk_efuse"); if (IS_ERR(clk)) ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] nvmem: delete unneeded IS_ERR test 2015-12-19 21:19 ` Julia Lawall (?) (?) @ 2015-12-20 2:21 ` Caesar Wang -1 siblings, 0 replies; 7+ messages in thread From: Caesar Wang @ 2015-12-20 2:21 UTC (permalink / raw) To: linux-arm-kernel Hi Julia, Thanks to check this, but there was a patch fixing it.:-) 在 2015年12月20日 05:19, Julia Lawall 写道: > devm_kzalloc returns NULL rather than an ERR_PTR value. > > The semantic match that finds this problem is as follows: > (http://coccinelle.lip6.fr/) > > // <smpl> > @@ > expression x,e; > @@ > > * x = devm_kzalloc(...) > ... when != x = e > * IS_ERR(x) > // </smpl> > > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> > > --- > drivers/nvmem/rockchip-efuse.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/nvmem/rockchip-efuse.c b/drivers/nvmem/rockchip-efuse.c > index f552134..811c73c 100644 > --- a/drivers/nvmem/rockchip-efuse.c > +++ b/drivers/nvmem/rockchip-efuse.c > @@ -136,8 +136,8 @@ static int rockchip_efuse_probe(struct platform_device *pdev) > > context = devm_kzalloc(dev, sizeof(struct rockchip_efuse_context), > GFP_KERNEL); > - if (IS_ERR(context)) > - return PTR_ERR(context); > + if (!context) > + return -ENOMEM; Fixed in this patch[0]. patch[0]: https://patchwork.kernel.org/patch/7842821/ Thanks, Caesar > > clk = devm_clk_get(dev, "pclk_efuse"); > if (IS_ERR(clk)) > > > _______________________________________________ > Linux-rockchip mailing list > Linux-rockchip@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-rockchip ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] nvmem: delete unneeded IS_ERR test @ 2015-12-20 2:21 ` Caesar Wang 0 siblings, 0 replies; 7+ messages in thread From: Caesar Wang @ 2015-12-20 2:21 UTC (permalink / raw) To: Julia Lawall, Srinivas Kandagatla Cc: Heiko Stuebner, kernel-janitors, linux-kernel, linux-rockchip, Maxime Ripard, linux-arm-kernel Hi Julia, Thanks to check this, but there was a patch fixing it.:-) 在 2015年12月20日 05:19, Julia Lawall 写道: > devm_kzalloc returns NULL rather than an ERR_PTR value. > > The semantic match that finds this problem is as follows: > (http://coccinelle.lip6.fr/) > > // <smpl> > @@ > expression x,e; > @@ > > * x = devm_kzalloc(...) > ... when != x = e > * IS_ERR(x) > // </smpl> > > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> > > --- > drivers/nvmem/rockchip-efuse.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/nvmem/rockchip-efuse.c b/drivers/nvmem/rockchip-efuse.c > index f552134..811c73c 100644 > --- a/drivers/nvmem/rockchip-efuse.c > +++ b/drivers/nvmem/rockchip-efuse.c > @@ -136,8 +136,8 @@ static int rockchip_efuse_probe(struct platform_device *pdev) > > context = devm_kzalloc(dev, sizeof(struct rockchip_efuse_context), > GFP_KERNEL); > - if (IS_ERR(context)) > - return PTR_ERR(context); > + if (!context) > + return -ENOMEM; Fixed in this patch[0]. patch[0]: https://patchwork.kernel.org/patch/7842821/ Thanks, Caesar > > clk = devm_clk_get(dev, "pclk_efuse"); > if (IS_ERR(clk)) > > > _______________________________________________ > Linux-rockchip mailing list > Linux-rockchip@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-rockchip ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] nvmem: delete unneeded IS_ERR test @ 2015-12-20 2:21 ` Caesar Wang 0 siblings, 0 replies; 7+ messages in thread From: Caesar Wang @ 2015-12-20 2:21 UTC (permalink / raw) To: linux-arm-kernel Hi Julia, Thanks to check this, but there was a patch fixing it.:-) ? 2015?12?20? 05:19, Julia Lawall ??: > devm_kzalloc returns NULL rather than an ERR_PTR value. > > The semantic match that finds this problem is as follows: > (http://coccinelle.lip6.fr/) > > // <smpl> > @@ > expression x,e; > @@ > > * x = devm_kzalloc(...) > ... when != x = e > * IS_ERR(x) > // </smpl> > > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> > > --- > drivers/nvmem/rockchip-efuse.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/nvmem/rockchip-efuse.c b/drivers/nvmem/rockchip-efuse.c > index f552134..811c73c 100644 > --- a/drivers/nvmem/rockchip-efuse.c > +++ b/drivers/nvmem/rockchip-efuse.c > @@ -136,8 +136,8 @@ static int rockchip_efuse_probe(struct platform_device *pdev) > > context = devm_kzalloc(dev, sizeof(struct rockchip_efuse_context), > GFP_KERNEL); > - if (IS_ERR(context)) > - return PTR_ERR(context); > + if (!context) > + return -ENOMEM; Fixed in this patch[0]. patch[0]: https://patchwork.kernel.org/patch/7842821/ Thanks, Caesar > > clk = devm_clk_get(dev, "pclk_efuse"); > if (IS_ERR(clk)) > > > _______________________________________________ > Linux-rockchip mailing list > Linux-rockchip at lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-rockchip ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] nvmem: delete unneeded IS_ERR test @ 2015-12-20 2:21 ` Caesar Wang 0 siblings, 0 replies; 7+ messages in thread From: Caesar Wang @ 2015-12-20 2:21 UTC (permalink / raw) To: Julia Lawall, Srinivas Kandagatla Cc: Heiko Stuebner, kernel-janitors, linux-kernel, linux-rockchip, Maxime Ripard, linux-arm-kernel Hi Julia, Thanks to check this, but there was a patch fixing it.:-) 在 2015年12月20日 05:19, Julia Lawall 写道: > devm_kzalloc returns NULL rather than an ERR_PTR value. > > The semantic match that finds this problem is as follows: > (http://coccinelle.lip6.fr/) > > // <smpl> > @@ > expression x,e; > @@ > > * x = devm_kzalloc(...) > ... when != x = e > * IS_ERR(x) > // </smpl> > > Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> > > --- > drivers/nvmem/rockchip-efuse.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/nvmem/rockchip-efuse.c b/drivers/nvmem/rockchip-efuse.c > index f552134..811c73c 100644 > --- a/drivers/nvmem/rockchip-efuse.c > +++ b/drivers/nvmem/rockchip-efuse.c > @@ -136,8 +136,8 @@ static int rockchip_efuse_probe(struct platform_device *pdev) > > context = devm_kzalloc(dev, sizeof(struct rockchip_efuse_context), > GFP_KERNEL); > - if (IS_ERR(context)) > - return PTR_ERR(context); > + if (!context) > + return -ENOMEM; Fixed in this patch[0]. patch[0]: https://patchwork.kernel.org/patch/7842821/ Thanks, Caesar > > clk = devm_clk_get(dev, "pclk_efuse"); > if (IS_ERR(clk)) > > > _______________________________________________ > Linux-rockchip mailing list > Linux-rockchip@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-rockchip -- To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-12-20 2:22 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-12-19 21:19 [PATCH] nvmem: delete unneeded IS_ERR test Julia Lawall 2015-12-19 21:19 ` Julia Lawall 2015-12-19 21:19 ` Julia Lawall 2015-12-20 2:21 ` Caesar Wang 2015-12-20 2:21 ` Caesar Wang 2015-12-20 2:21 ` Caesar Wang 2015-12-20 2:21 ` Caesar Wang
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.