Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1412560pxk; Fri, 4 Sep 2020 08:46:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4oY4mC/qRvcPlk9P5HUL2dsqC+Vo/mCNsPxplz3sX46MFcxz/H+ldaOvPX5aDkqeoM22/ X-Received: by 2002:a17:906:1756:: with SMTP id d22mr7947177eje.29.1599234397478; Fri, 04 Sep 2020 08:46:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599234397; cv=none; d=google.com; s=arc-20160816; b=eKgh1sW8p2mZ4Q6kyZAp575eVhrIohVvto3OK7HTcWljPHEp/46zT/BWdNfK1HCJrB vwyfFzOSbltjHdhTg9Q6WRWKrR3t6kEbgZuDBsZUOy/6SzFwsXSoNcZmkRrmzQTbZ83r sFN5BBE1spYRl+op6nyMZzepCdCVdi9nao+1AQYPHhlbzOImNKz136qoP9KrO7cWrBK7 7+/TkKyFkZTN43iKyl2zjDEXltDiJVcl6LIOKy3+n2ilvO97exD+kiHE3LlPVx5MEgNU mmB7WBDzt5NuBgnccFnCPVwY4FuD5NwO3ePjXU2AykysyNeMLeh/CUI43x+G1ijxd7Ph snig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=VMqTGjL4kKzi7jmztgA4JEXaWUBhgkQR8WYr0H/I7mI=; b=uxVMkk1D2Lsi4e1OP3xKn6I4DeIL7VSeIDTkTXu1niOUnM7t1aSwc4rf56zya4KaYX 5TqJwwEWBpXNIDMh81/eAu1FY0uQ5chwJ4v43ZJEOsHz/at4cCjcXa3hns92oU1mKFIM Ln1Xn6QIgomWiEJoBsOls5Mj891cA9HnvJFJXxk2hYLX40PceMLJ3lcZjThuk83thVRW sDGsQzWKbE/B1qw5Q8avWQ147rj81AT1ND4YOubzmNvUc9VVlv75a8t9NhUCPnduGtTO 3NGRcBLQAKy2dYyt2oWE9VLjNbhVRhVvnyNZCmIr1Z4fT6VYcDEG6+fkEXGKyTSzFXcs wgPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=lxSjsu4J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d20si4346200edn.317.2020.09.04.08.46.13; Fri, 04 Sep 2020 08:46:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=lxSjsu4J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726267AbgIDPpV (ORCPT + 99 others); Fri, 4 Sep 2020 11:45:21 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:50492 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726005AbgIDPpR (ORCPT ); Fri, 4 Sep 2020 11:45:17 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 084FiqR4092216; Fri, 4 Sep 2020 10:44:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1599234292; bh=VMqTGjL4kKzi7jmztgA4JEXaWUBhgkQR8WYr0H/I7mI=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=lxSjsu4JmAjAg0vZflqKAZIvrbSitOutL8rmv4vVTYvi5LLVONym2+l8XxGHXxtBj K0vTqc4YCNj0p/hOj+d4jy6B+mETTyhistNWGbWz9WiBapzL9+ghUgWlA8QgWdzxGF J0hYeqzDEceIuz8mMSirPPsiPNhGEmeav+U9MKhE= Received: from DLEE105.ent.ti.com (dlee105.ent.ti.com [157.170.170.35]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTP id 084Fiq8Q116315; Fri, 4 Sep 2020 10:44:52 -0500 Received: from DLEE111.ent.ti.com (157.170.170.22) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Fri, 4 Sep 2020 10:44:52 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DLEE111.ent.ti.com (157.170.170.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Fri, 4 Sep 2020 10:44:52 -0500 Received: from [10.250.71.39] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 084Fipsu125901; Fri, 4 Sep 2020 10:44:51 -0500 Subject: Re: [PATCH -next] remoteproc: k3-dsp: Fix return value check in k3_dsp_rproc_of_get_memories() To: Mathieu Poirier , YueHaibing CC: , , , References: <20200902140614.28636-1-yuehaibing@huawei.com> <20200902165904.GB280378@xps15> From: Suman Anna Message-ID: <70ad695c-4200-7927-7274-dc4d5bd32920@ti.com> Date: Fri, 4 Sep 2020 10:44:51 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200902165904.GB280378@xps15> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/2/20 11:59 AM, Mathieu Poirier wrote: > On Wed, Sep 02, 2020 at 10:06:14PM +0800, YueHaibing wrote: >> In case of error, the function devm_ioremap_wc() returns NULL pointer >> not ERR_PTR(). The IS_ERR() test in the return value check should be >> replaced with NULL test. >> >> Fixes: 87218f96c21a ("remoteproc: k3-dsp: Add support for C71x DSPs") >> Signed-off-by: YueHaibing >> --- >> drivers/remoteproc/ti_k3_dsp_remoteproc.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/remoteproc/ti_k3_dsp_remoteproc.c b/drivers/remoteproc/ti_k3_dsp_remoteproc.c >> index 9011e477290c..f373df35d7d0 100644 >> --- a/drivers/remoteproc/ti_k3_dsp_remoteproc.c >> +++ b/drivers/remoteproc/ti_k3_dsp_remoteproc.c >> @@ -445,10 +445,10 @@ static int k3_dsp_rproc_of_get_memories(struct platform_device *pdev, >> >> kproc->mem[i].cpu_addr = devm_ioremap_wc(dev, res->start, >> resource_size(res)); >> - if (IS_ERR(kproc->mem[i].cpu_addr)) { >> + if (!kproc->mem[i].cpu_addr) { >> dev_err(dev, "failed to map %s memory\n", >> data->mems[i].name); >> - return PTR_ERR(kproc->mem[i].cpu_addr); >> + return -EBUSY; > > Shouldn't this be -ENOMEM? Indeed, thanks for catching it. I will fix these same issues on the K3 R5F driver for v4. regards Suman > >> } >> kproc->mem[i].bus_addr = res->start; >> kproc->mem[i].dev_addr = data->mems[i].dev_addr; >> -- >> 2.17.1 >> >>