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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C7C2AECAAD8 for ; Fri, 16 Sep 2022 10:11:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231216AbiIPKLF (ORCPT ); Fri, 16 Sep 2022 06:11:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231160AbiIPKKC (ORCPT ); Fri, 16 Sep 2022 06:10:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC174AB43A; Fri, 16 Sep 2022 03:08:45 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3C6D8629F2; Fri, 16 Sep 2022 10:08:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2A2B9C433C1; Fri, 16 Sep 2022 10:08:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663322924; bh=tSXfzAbEEGzejCMYQW03tijt0WD8X9cB7zVT+7xfYmY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BtvdqGUT9pl1ccV7U1/bv06dWN3fBFX0utCJsk0G0iH4tjdrVgZvM+9BQ2YBeuAzf /eXycH3ioTgPUWbwNoLCnm86ERxqCimfmvPGSWf1ZmqSTRfTkF9QO+d0/gk5JIS2+1 +TX/8h9gUUyMEiO5hWHFMULxKRMqSLNG3OnJ76jc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yu Zhe , Will Deacon , Sasha Levin Subject: [PATCH 4.19 06/11] perf/arm_pmu_platform: fix tests for platform_get_irq() failure Date: Fri, 16 Sep 2022 12:08:02 +0200 Message-Id: <20220916100442.972317619@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220916100442.662955946@linuxfoundation.org> References: <20220916100442.662955946@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yu Zhe [ Upstream commit 6bb0d64c100091e131cd16710b62fda3319cd0af ] The platform_get_irq() returns negative error codes. It can't actually return zero. Signed-off-by: Yu Zhe Link: https://lore.kernel.org/r/20220825011844.8536-1-yuzhe@nfschina.com Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- drivers/perf/arm_pmu_platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/perf/arm_pmu_platform.c b/drivers/perf/arm_pmu_platform.c index 199293450acfc..0ffa4f45a8391 100644 --- a/drivers/perf/arm_pmu_platform.c +++ b/drivers/perf/arm_pmu_platform.c @@ -118,7 +118,7 @@ static int pmu_parse_irqs(struct arm_pmu *pmu) if (num_irqs == 1) { int irq = platform_get_irq(pdev, 0); - if (irq && irq_is_percpu_devid(irq)) + if ((irq > 0) && irq_is_percpu_devid(irq)) return pmu_parse_percpu_irq(pmu, irq); } -- 2.35.1