From patchwork Thu Oct 13 18:09:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tai Nguyen X-Patchwork-Id: 9375601 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 8C62E60487 for ; Thu, 13 Oct 2016 18:15:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 80D01287C7 for ; Thu, 13 Oct 2016 18:15:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7242C29FD3; Thu, 13 Oct 2016 18:15:48 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2A627287C7 for ; Thu, 13 Oct 2016 18:15:46 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bukVy-0000KF-Va; Thu, 13 Oct 2016 18:13:58 +0000 Received: from mail-pf0-x22f.google.com ([2607:f8b0:400e:c00::22f]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bukVu-0000IU-Pu for linux-arm-kernel@lists.infradead.org; Thu, 13 Oct 2016 18:13:55 +0000 Received: by mail-pf0-x22f.google.com with SMTP id s8so38240612pfj.2 for ; Thu, 13 Oct 2016 11:13:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apm.com; s=apm; h=from:to:cc:subject:date:message-id; bh=CZ/cGugMxk47aO5wShV94i6U/+o+hVQOqKvBW19+zDE=; b=KAldbKngPIiJe1Edh3T5YUin104s/HxmWi/ais6IwFdffrGJpM4RWPG/ATnQbFpV3x xrOR7n+DZBGDbobhDP3MNi659Vk7YaTmVim2buADjhzNOocSHwTfecDishCXRHePcaAw Vk9iDeW/ixcAWrCS/aV/ca44pMJRdOxQC6Ne8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=CZ/cGugMxk47aO5wShV94i6U/+o+hVQOqKvBW19+zDE=; b=UhKLDXV8sgYVyHuqQXscgEgTa4Sop8YjsXmPNWOnZqicFBsvD0MB5QZi2mSCbNCS1F uQval2lDJ3jW0qi7r2E1XAToKcfhoWbKXv+gulEtLw6Bd9V6yl9TALMhpu+Pz53OcjVf PPYjF9E+dkhQdWeNQIVI/bDQpEMyyOZgvOA2aQ2jd/dAuzYeuHGg3b6U6sFbukqGS38X BExP4+lQ7XhcP0exWYpurNVjw9gvgkK2McJNElqKcCjv9MKaKxBuTOQRNz/ExqvWb36T 4muepL7ClRM2JMuKBL/fOi0lNQUOn8VYa1boUJ0hwUfazVPAN/OmXEL2CyQaXI03J1FE 3i1w== X-Gm-Message-State: AA6/9Rl1b4JhBKetnlB4ck9ybCrXLQ908AgPyvwnhD0bFaLl1PNHzjK+Pi4jgEbiwY7lfVfM X-Received: by 10.98.204.145 with SMTP id j17mr11826460pfk.83.1476382412904; Thu, 13 Oct 2016 11:13:32 -0700 (PDT) Received: from ttnguyen-Ubuntu.amcc.com ([206.80.4.98]) by smtp.gmail.com with ESMTPSA id yi2sm21328829pab.17.2016.10.13.11.13.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 13 Oct 2016 11:13:32 -0700 (PDT) From: Tai Nguyen To: mark.rutland@arm.com, dan.carpenter@oracle.com, will.deacon@arm.com Subject: [PATCH v2] perf: xgene: Remove bogus IS_ERR() check Date: Thu, 13 Oct 2016 11:09:16 -0700 Message-Id: <1476382156-11641-1-git-send-email-ttnguyen@apm.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-20161013_111354_915325_F93961DC X-CRM114-Status: GOOD ( 10.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Tai Nguyen 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 In acpi_get_pmu_hw_inf we pass the address of a local variable to IS_ERR(), which doesn't make sense, as the pointer must be a real, valid pointer. This doesn't cause a functional problem, as IS_ERR() will evaluate as false, but the check is bogus and causes static checkers to complain. Remove the bogus check. The bug is reported by Dan Carpenter in [1] [1] https://www.spinics.net/lists/arm-kernel/msg535957.html Signed-off-by: Tai Nguyen Acked-by: Mark Rutland --- v2: Add more problem description in the commit message Add Acked-by: Mark Rutland drivers/perf/xgene_pmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/perf/xgene_pmu.c b/drivers/perf/xgene_pmu.c index c2ac764..a8ac4bc 100644 --- a/drivers/perf/xgene_pmu.c +++ b/drivers/perf/xgene_pmu.c @@ -1011,7 +1011,7 @@ xgene_pmu_dev_ctx *acpi_get_pmu_hw_inf(struct xgene_pmu *xgene_pmu, rc = acpi_dev_get_resources(adev, &resource_list, acpi_pmu_dev_add_resource, &res); acpi_dev_free_resource_list(&resource_list); - if (rc < 0 || IS_ERR(&res)) { + if (rc < 0) { dev_err(dev, "PMU type %d: No resource address found\n", type); goto err; }