Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754042AbbLTCWF (ORCPT ); Sat, 19 Dec 2015 21:22:05 -0500 Received: from mail-wm0-f44.google.com ([74.125.82.44]:36189 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750746AbbLTCWD (ORCPT ); Sat, 19 Dec 2015 21:22:03 -0500 Message-ID: <567610BE.8010706@gmail.com> Date: Sun, 20 Dec 2015 10:21:50 +0800 From: Caesar Wang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Julia Lawall , Srinivas Kandagatla CC: Heiko Stuebner , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Maxime Ripard , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] nvmem: delete unneeded IS_ERR test References: <1450559973-9067-1-git-send-email-Julia.Lawall@lip6.fr> In-Reply-To: <1450559973-9067-1-git-send-email-Julia.Lawall@lip6.fr> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1619 Lines: 62 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/) > > // > @@ > expression x,e; > @@ > > * x = devm_kzalloc(...) > ... when != x = e > * IS_ERR(x) > // > > Signed-off-by: Julia Lawall > > --- > 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 linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/