From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E6DBC433E0 for ; Sat, 13 Mar 2021 00:10:34 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2B42464F70 for ; Sat, 13 Mar 2021 00:10:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2B42464F70 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=s8DKAFgG85O2kJONUsJCHRkdBIR4MUjz5G1dO3U2CxQ=; b=hzmXHnzBoi+YvEqfiuV8xAt7k tmQTjy9TfvJ2domNdf5DTpmmp2hI+dHjbhe+ePo7eHp16c7HVnTMmD0kZL4DmGXbPFtNeOaSj4TsN /IndMsWBF7cG7Gr1Ad7HNyQWqU49fliVMI1vXNw3/GPOVQljAgGAMZItVHQbC5YxYa3tZpaLIHxnW 1EGVvGwKXlunEZkezk7OOPZBScPMWbsXxFC2uauzl0Bm3Gj483eV5WslVZ+EdeUOeRRoHAvRPU7IB jc/lNKCS4QVhJ4uc7ajhZQdJ502/6FqzHZ+YUKf4aOLYVoWWBWSmA/vEfdegPNfXk8IM6GjG7GAWn Hq1pIo3Gg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lKrpb-00Cahi-D8; Sat, 13 Mar 2021 00:08:35 +0000 Received: from mail-ot1-x332.google.com ([2607:f8b0:4864:20::332]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lKrpR-00Cago-UD for linux-arm-kernel@lists.infradead.org; Sat, 13 Mar 2021 00:08:28 +0000 Received: by mail-ot1-x332.google.com with SMTP id p24so4339049ota.11 for ; Fri, 12 Mar 2021 16:08:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=tskbPV38ZQ+dCuIiAy+hlftEgTtSwQTfVcXEgTZ53LE=; b=syl4IVzUqcCzG/X8KX1ZmIvAcK9joYMmYIC+1NdCcNUvAK4hsCQRfjLe3q2XDMS7SU W/zyY841KjSLXs9ZJ+D/CmDuMvAx/HLrFmye7Fq+7PzNN9k6Dyro9d51DU6f2jTU2Ael X/dlLqIf5rsgXTRaQdogOkMCeG1OBu2m9eBrGMLMQalQBcK6bNzHCpjxbjIY5N060OBd KtH7uDPPjMkEPJjJtq4J+/wgRBVKelDfarY40aqTNR+X0+OBfLoo8ZzHz+Altj1igtlZ 8fZUIXh5t3Fop96VnnhbjGohAlwPJ+bbjhj3phYEbIUhUGyfZrC9CMOnBAvyuFwrtmaE iCdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=tskbPV38ZQ+dCuIiAy+hlftEgTtSwQTfVcXEgTZ53LE=; b=ASQPksrMkNtDulqbVz3Myw3VZfsjS0hyhQcQMNt4F4Ql9gvC9qp3eij/VtTFyUl+Vu v3TOHYFQ1qWL/epf2E2kZ2IWZOEoq9/hBg/Y1rHev1wWYskiUroYN1N2hef0Q4IoCCPP 58eQrbtvXhJtjfar1oHAQ8WG2PrJcwVRPbreleV0uJDgcGlSFtVYQmy0fygQfrlhEct4 suDGdOC1mggjVW4O2+KfZJxXDlauO4SJP5jZFW7ELJTX4e5gPNRLXuji/jMB+Q/DMf1G Idaxz+eo+MAhSNuz+hwx3aMReqI5A7WoO60X851IBmwvfIiZjrwo0Dq8CRX4Ee8bspw6 73xw== X-Gm-Message-State: AOAM533xqiwhAQkcChhH3uIAAudJRqsnrIpU/Qwwi0EZ4S/QzeKhZOzA p9HnvVL48Zt8nw9GyY/lurl+Ww== X-Google-Smtp-Source: ABdhPJx1Tgg6tgSb0mIivL8DCU2RQ7YRolkf5fIw2kxWEPXAgogJMSu1wzkCApV9yRUqgxNJtmfnFQ== X-Received: by 2002:a9d:6c88:: with SMTP id c8mr5390359otr.87.1615594103626; Fri, 12 Mar 2021 16:08:23 -0800 (PST) Received: from builder.lan (104-57-184-186.lightspeed.austtx.sbcglobal.net. [104.57.184.186]) by smtp.gmail.com with ESMTPSA id k24sm2123198oic.51.2021.03.12.16.08.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 16:08:23 -0800 (PST) Date: Fri, 12 Mar 2021 18:08:21 -0600 From: Bjorn Andersson To: 'Wei Yongjun Cc: Ohad Ben-Cohen , Mathieu Poirier , Shawn Guo , Sascha Hauer , Peng Fan , linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-janitors@vger.kernel.org, Hulk Robot Subject: Re: [PATCH -next] remoteproc: imx_rproc: fix return value check in imx_rproc_addr_init() Message-ID: References: <20210312080420.277151-1-weiyongjun1@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210312080420.277151-1-weiyongjun1@huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210313_000826_236570_99618A9F X-CRM114-Status: GOOD ( 20.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri 12 Mar 02:04 CST 2021, 'Wei Yongjun wrote: > From: Wei Yongjun > > In case of error, the function devm_ioremap() returns NULL pointer > not ERR_PTR(). The IS_ERR() test in the return value check should > be replaced with NULL test. > > Fixes: ecadcc47492c ("remoteproc: imx_rproc: use devm_ioremap") > Reported-by: Hulk Robot > Signed-off-by: Wei Yongjun > --- > drivers/remoteproc/imx_rproc.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c > index 5ebb9f57d3e0..3ba4b6ba47aa 100644 > --- a/drivers/remoteproc/imx_rproc.c > +++ b/drivers/remoteproc/imx_rproc.c > @@ -464,9 +464,9 @@ static int imx_rproc_addr_init(struct imx_rproc *priv, > > /* Not use resource version, because we might share region */ > priv->mem[b].cpu_addr = devm_ioremap(&pdev->dev, res.start, resource_size(&res)); > - if (IS_ERR(priv->mem[b].cpu_addr)) { > + if (!priv->mem[b].cpu_addr) { > dev_err(dev, "failed to remap %pr\n", &res); > - err = PTR_ERR(priv->mem[b].cpu_addr); > + err = -ENOMEM; > return err; Took the liberty of changing this to return -ENOMEM, as I applied the patch. Thank you, Bjorn > } > priv->mem[b].sys_addr = res.start; > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel