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=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_MUTT 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 CBDBCC31E51 for ; Tue, 18 Jun 2019 11:54:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A0F562070B for ; Tue, 18 Jun 2019 11:54:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="d9gd1o7h" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729797AbfFRLy3 (ORCPT ); Tue, 18 Jun 2019 07:54:29 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:42324 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729110AbfFRLy2 (ORCPT ); Tue, 18 Jun 2019 07:54:28 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x5IBmlPb069443; Tue, 18 Jun 2019 11:54:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type : in-reply-to; s=corp-2018-07-02; bh=9gsdLFMf2r5ChS58kjStnd5HOdzpIyd2OcNY/w49Mns=; b=d9gd1o7hmjUYTxOGP40zHRruXHPYmZtIlcGTGDP394sD2WlPaUrTZOtUVk3LaWPHg2TJ mjMxCZ7gVBlInmpHmAWWmfMbYWUGhlaTXLAZWNF4F+9x18BkHI+3BLnSivxT4ijuvCKB envHXGJqKYpo+Cuwloeu9prnK1h0TDKikLu6WqWAe/U96zUJqpPMBzbjBhDJll+06PV8 hVzqfdWmEJcbakNk09MnyJZ/rkIJT2UpjnQPIFpOQmLilqueJr0pfRt4WDqYWVSlVkIu 7o8Fu/1x93/SNk1MzCJYzjFafVqvf6HXmbRbSmG3chxkR42oyksGPSofzuF9lZvOj+WU yQ== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2120.oracle.com with ESMTP id 2t4rmp3xyb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2019 11:54:20 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x5IBrYNU137368; Tue, 18 Jun 2019 11:54:20 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3030.oracle.com with ESMTP id 2t59gdsdsx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 18 Jun 2019 11:54:20 +0000 Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x5IBsHW4022840; Tue, 18 Jun 2019 11:54:17 GMT Received: from kadam (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 18 Jun 2019 04:54:17 -0700 Date: Tue, 18 Jun 2019 14:54:10 +0300 From: Dan Carpenter To: arm@kernel.org Cc: Krzysztof Halasa , Linus Walleij , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] soc: ixp4xx: npe: Fix an IS_ERR() vs NULL check in probe Message-ID: <20190618115410.GE18776@kadam> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9291 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906180098 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9291 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906180098 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The devm_ioremap_resource() function doesn't return NULL, it returns error pointers. Fixes: 0b458d7b10f8 ("soc: ixp4xx: npe: Pass addresses as resources") Signed-off-by: Dan Carpenter Reviewed-by: Linus Walleij --- drivers/soc/ixp4xx/ixp4xx-npe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soc/ixp4xx/ixp4xx-npe.c b/drivers/soc/ixp4xx/ixp4xx-npe.c index bc10e3194809..ec90b44fa0cd 100644 --- a/drivers/soc/ixp4xx/ixp4xx-npe.c +++ b/drivers/soc/ixp4xx/ixp4xx-npe.c @@ -695,8 +695,8 @@ static int ixp4xx_npe_probe(struct platform_device *pdev) continue; /* NPE already disabled or not present */ } npe->regs = devm_ioremap_resource(dev, res); - if (!npe->regs) - return -ENOMEM; + if (IS_ERR(npe->regs)) + return PTR_ERR(npe->regs); if (npe_reset(npe)) { dev_info(dev, "NPE%d at 0x%08x-0x%08x does not reset\n", -- 2.20.1 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Carpenter Date: Tue, 18 Jun 2019 11:54:10 +0000 Subject: [PATCH] soc: ixp4xx: npe: Fix an IS_ERR() vs NULL check in probe Message-Id: <20190618115410.GE18776@kadam> List-Id: In-Reply-To: References: <20190613070201.GH16334@mwanda> In-Reply-To: <20190613070201.GH16334@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: arm@kernel.org Cc: Krzysztof Halasa , Linus Walleij , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org The devm_ioremap_resource() function doesn't return NULL, it returns error pointers. Fixes: 0b458d7b10f8 ("soc: ixp4xx: npe: Pass addresses as resources") Signed-off-by: Dan Carpenter Reviewed-by: Linus Walleij --- drivers/soc/ixp4xx/ixp4xx-npe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soc/ixp4xx/ixp4xx-npe.c b/drivers/soc/ixp4xx/ixp4xx-npe.c index bc10e3194809..ec90b44fa0cd 100644 --- a/drivers/soc/ixp4xx/ixp4xx-npe.c +++ b/drivers/soc/ixp4xx/ixp4xx-npe.c @@ -695,8 +695,8 @@ static int ixp4xx_npe_probe(struct platform_device *pdev) continue; /* NPE already disabled or not present */ } npe->regs = devm_ioremap_resource(dev, res); - if (!npe->regs) - return -ENOMEM; + if (IS_ERR(npe->regs)) + return PTR_ERR(npe->regs); if (npe_reset(npe)) { dev_info(dev, "NPE%d at 0x%08x-0x%08x does not reset\n", -- 2.20.1