From patchwork Tue Nov 28 22:16:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasyl Gomonovych X-Patchwork-Id: 10081185 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7F481602BC for ; Tue, 28 Nov 2017 22:17:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 712B5280CF for ; Tue, 28 Nov 2017 22:17:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 647D429711; Tue, 28 Nov 2017 22:17:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DD6AA280CF for ; Tue, 28 Nov 2017 22:17:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=h53EtWkhwkU9XielDmtl1kto3wGItmf+CZ6bHV0ISMo=; b=K6o UzohvsVbNJQSo/E5e1kCs5pQB6jc6PLMGXsPvVVbqtoUVN5Y2DCAIY4VFXOeksA2u02/dwlzkiM1/ 5KrSit24+lYDZOOZGdRC+pVom//cV6F5XAd8JbqsP7tyvLooQSdGMXOb+wUizdVoj1tJ4GPjJbFim HpBoe3ur6RVs2PH5zQAWLOb1a+xhMtHoEZeuAbM9KLvXgp5OdLx7N6sQADnIMOy/JwTWNEnTbYllW gRCIlXYHmGO/TxPxXWa77FvW5pkUmY7n8r9LOgbhpTAuZ9758Qj2+ceHY5prizxnrBDXG3zzP1Ee4 3ujkBEKeTyBs60cCPZyLe99voWzKmAw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eJoC2-0007rO-Hs; Tue, 28 Nov 2017 22:17:30 +0000 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eJoBz-0007pS-AF for linux-arm-kernel@lists.infradead.org; Tue, 28 Nov 2017 22:17:29 +0000 Received: by mail-lf0-x243.google.com with SMTP id r143so1574935lfe.13 for ; Tue, 28 Nov 2017 14:17:06 -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=jmfRfuuJIRbUNgVRmN6JjAtr0KtMRuasIhm7m4k1xMZ7AvFT9hwiSNipgw38bWO73o i1XdY4oetUzII4BEkDjWNxmJRVsBtuwIQmKpMTPWwXjrOJKnoOY4gpk10PCG73mYejfi AfoLnQlB/soVeiGNKnI8GnyTM9zFqnDAYOkwBYGS0MmYh/kb5mhIYdZUXaNKJTFafHHm OuSLI9ZNZY1bsugd/Os6Ps+PumR5vUk7UWvKtEQAJ7Hw40iQCGKDybvBQGfIE2tOvQDa s8W4yiDESTPF+98rXaJAnHqdrzWwshjSyGoAbpyrVl8mchgyGKlpfn2UYSMab/8a+a8O ezYQ== X-Gm-Message-State: AJaThX6hDPceFspZ7KZD5jNwO8wW3HytoPQarHgVYSy0yJircLN2xLUp QYnpIkjMru+jQD3NIWeiLl8= X-Google-Smtp-Source: AGs4zMaTaOqve8fEE7UL50L02YSsWshPyN0zsf/hlOT9OGaKXCpaic0HH63vy1tn9uWArsc9QJ2ZTg== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171128_141727_588035_46EFC6B3 X-CRM114-Status: GOOD ( 11.27 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: gomonovych@gmail.com, linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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