Received: by 10.223.164.202 with SMTP id h10csp3613048wrb; Tue, 28 Nov 2017 14:18:00 -0800 (PST) X-Google-Smtp-Source: AGs4zMbuVetzpx08sT884XCOxtlwYV/hk4qN234bYHNeC1NEAam3+neKjvKiV01SUR7GEcQv9jQi X-Received: by 10.99.167.6 with SMTP id d6mr648983pgf.100.1511907480086; Tue, 28 Nov 2017 14:18:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511907480; cv=none; d=google.com; s=arc-20160816; b=l413aCPdhtSfo6+4gld9LXQ59/2cqiLBzBFaxGs71H66+cvGSdl0I/et9HK1UlzmmW mopDeezclnrnxJxIZaA3Wg7PH1uP1cEW6qjrPL5qJFGmMTGFNMKXKMyCgEveE4wMWxcr SBxsxPUXwtfKYJpcxQAEbNJAJ+ysSEWr3bIkFKnUvSMhFMdD7t0Z8Im05/XPxQgbyA6v C5136DpSN8Af/YKeEyrTuAziJXAvAvijnPlmzZGHoKYE1DbG/qKLN1cxnfUK25rvcD5T Tv95Wn0/kfZ5esdxqetFLtfl73Jwag9xGK56VLz3wyAoSPkZgjpb7OZZokZY4SJBlw2b Kw8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=Z/WHS6oJmPrFZXBU0AHylXmY4I72dVT+FiWsopW61go=; b=kaD4sALg65wpaoc2p0hKfFOaqbg2uDYC+zMh2qYOab9OFkEWfr/+FFzx1/ckkm0KTw lQzW48U2sToaK2Jp7tzGyHudmcAO6D9aNssUL04qkQ7L5kl0vtZrIumqjbR4cgLmFINb arTQ8F0LPmqtWxOHzs8w46oBBkbU6l4yiM43P0CyQbkwTv/Aita4nCB2vWp14FAQgABp kNOUoUBJ9yWTsH0n9kHIPhuA6gYcoiPc1wR5Lgg0aEWIYBeMtRj6+dwQaWD4GmryganB y/hMGW887Epm+Yuk5wOXRGvf/7qeKvKnlFV48cvKG1GImc9nkTgzjZjDI+JOfmPQA16L +Xjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=X1Ipe/Ts; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f10si137945plm.88.2017.11.28.14.17.49; Tue, 28 Nov 2017 14:18:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=X1Ipe/Ts; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752129AbdK1WRH (ORCPT + 70 others); Tue, 28 Nov 2017 17:17:07 -0500 Received: from mail-lf0-f68.google.com ([209.85.215.68]:33564 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750904AbdK1WRG (ORCPT ); Tue, 28 Nov 2017 17:17:06 -0500 Received: by mail-lf0-f68.google.com with SMTP id 74so1629812lfs.0 for ; Tue, 28 Nov 2017 14:17:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Z/WHS6oJmPrFZXBU0AHylXmY4I72dVT+FiWsopW61go=; b=X1Ipe/TsBjjG4e44c4lBO+tEfw6JOrBAY9PaQzH9tc4L6ARyJStQLxCCKD/o6fv8XX cD7o2mAM61dvT6dpWM9mbz3kd5aN3HOGHnxiLZS8VsX8ODSUfsMrcxcDYfYMcaAZEHGN QP0YgSc1mO6XF4XoxEVI6ddsFTk8DNNQu5oW9c30esbtywuYaePI+O9L/f79iL/FNond WLV0ZJo0geviCCQskWzWzrQcfRRxqFJhy6eeoSHVgDlOhcigGzPoTqEm+dF0ERxTlcMB pAewairRnjJzmmShMsGTyOFjl0lOpvN736W72intTrOSKpOlNrinzvvGBfVPCjP8T7jm 97Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Z/WHS6oJmPrFZXBU0AHylXmY4I72dVT+FiWsopW61go=; b=bifLskHjyl1XdltFQcQ36+zxINpoRvLa2HM973+nH91dQrQ1zy9QPzK0olNBuxcBu4 pBq/n0pcI3yqgvnhV4sFZKRZXDMGFZ513kCJDK+CSic3YzTMqvrLYhGiaeE1tRhOwkd6 TUt2kWPG+mk4A7EmlbYPwsXxNh6F80i6XwsfB9giqoQGzLPzT9Zf+/oOSphN2BNsfdcY PQ7UiFYouK4oVEhCxqnBdmwmfY+vN+33pIYfDfYqmWOEsNVO0kSmfDjkjaN0VklRhmRA cPikQ/R78ZHt6yCOLYR1GkoNauhr9bLAzNsE9jGPATdVYFOH6mARonbPMDlRmj7AS1eA GZSQ== X-Gm-Message-State: AJaThX6w8SjHqGvJ8cBtum0ZK5c9yTwzMKqgBXMedp50Zc3/SqgiacZR BEjnlJthF8E/TimebfB57Bg= X-Received: by 10.46.77.10 with SMTP id a10mr274922ljb.180.1511907425051; Tue, 28 Nov 2017 14:17:05 -0800 (PST) Received: from localhost.localdomain ([195.254.138.66]) by smtp.gmail.com with ESMTPSA id s132sm42712lja.46.2017.11.28.14.17.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Nov 2017 14:17:04 -0800 (PST) From: Vasyl Gomonovych To: mathieu.poirier@linaro.org, linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, gomonovych@gmail.com Subject: [PATCH] coresight: Use PTR_ERR_OR_ZERO() Date: Tue, 28 Nov 2017 23:16:54 +0100 Message-Id: <1511907414-8909-1-git-send-email-gomonovych@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix ptr_ret.cocci warnings: drivers/hwtracing/coresight/coresight-tpiu.c:163:1-3: WARNING: PTR_ERR_OR_ZERO can be used drivers/hwtracing/coresight/coresight-funnel.c:217:1-3: WARNING: PTR_ERR_OR_ZERO can be used drivers/hwtracing/coresight/coresight-dynamic-replicator.c:166:1-3: WARNING: PTR_ERR_OR_ZERO can be used Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR Generated by: scripts/coccinelle/api/ptr_ret.cocci Signed-off-by: Vasyl Gomonovych --- drivers/hwtracing/coresight/coresight-dynamic-replicator.c | 4 +--- drivers/hwtracing/coresight/coresight-funnel.c | 4 +--- drivers/hwtracing/coresight/coresight-tpiu.c | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-dynamic-replicator.c b/drivers/hwtracing/coresight/coresight-dynamic-replicator.c index 8f4357e2626c..043da86b0fe9 100644 --- a/drivers/hwtracing/coresight/coresight-dynamic-replicator.c +++ b/drivers/hwtracing/coresight/coresight-dynamic-replicator.c @@ -163,10 +163,8 @@ static int replicator_probe(struct amba_device *adev, const struct amba_id *id) desc.dev = &adev->dev; desc.groups = replicator_groups; drvdata->csdev = coresight_register(&desc); - if (IS_ERR(drvdata->csdev)) - return PTR_ERR(drvdata->csdev); - return 0; + return PTR_ERR_OR_ZERO(drvdata->csdev); } #ifdef CONFIG_PM diff --git a/drivers/hwtracing/coresight/coresight-funnel.c b/drivers/hwtracing/coresight/coresight-funnel.c index fd3c396717f6..9f8ac0bef853 100644 --- a/drivers/hwtracing/coresight/coresight-funnel.c +++ b/drivers/hwtracing/coresight/coresight-funnel.c @@ -214,10 +214,8 @@ static int funnel_probe(struct amba_device *adev, const struct amba_id *id) desc.dev = dev; desc.groups = coresight_funnel_groups; drvdata->csdev = coresight_register(&desc); - if (IS_ERR(drvdata->csdev)) - return PTR_ERR(drvdata->csdev); - return 0; + return PTR_ERR_OR_ZERO(drvdata->csdev); } #ifdef CONFIG_PM diff --git a/drivers/hwtracing/coresight/coresight-tpiu.c b/drivers/hwtracing/coresight/coresight-tpiu.c index bef49a3a5ca7..76ea1b8d4db5 100644 --- a/drivers/hwtracing/coresight/coresight-tpiu.c +++ b/drivers/hwtracing/coresight/coresight-tpiu.c @@ -160,10 +160,8 @@ static int tpiu_probe(struct amba_device *adev, const struct amba_id *id) desc.pdata = pdata; desc.dev = dev; drvdata->csdev = coresight_register(&desc); - if (IS_ERR(drvdata->csdev)) - return PTR_ERR(drvdata->csdev); - return 0; + return PTR_ERR_OR_ZERO(drvdata->csdev); } #ifdef CONFIG_PM -- 1.9.1 From 1586773613865673528@xxx Thu Dec 14 15:27:21 +0000 2017 X-GM-THRID: 1586080664865926237 X-Gmail-Labels: Inbox,Category Forums