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 65CCCECAAD8 for ; Fri, 16 Sep 2022 10:26:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232060AbiIPK0J (ORCPT ); Fri, 16 Sep 2022 06:26:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231681AbiIPKWk (ORCPT ); Fri, 16 Sep 2022 06:22:40 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D067B0B2D; Fri, 16 Sep 2022 03:14:09 -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 ams.source.kernel.org (Postfix) with ESMTPS id 212E4B82543; Fri, 16 Sep 2022 10:13:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8BE12C433D6; Fri, 16 Sep 2022 10:13:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663323190; bh=lzvI08HxbeT3BDrPTiftpAaZxUwRATnxFpRa2DlgBPg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZrfL5bxoR9S2x3IjgoYO+ARseslOrVH+3EraKNV9jgWtiTAqFrdxZhP5TwlppxzHv k6GucQ7bqgeibdo1iX2Ooe14hHPh5GfIGylw2Q+ziKjcp2HwLV0N0Io55ZupdDWR0n daKefSj7/NSHy4Imc9d94AdTHm201tLLFrhl518Q= 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 5.15 27/35] perf/arm_pmu_platform: fix tests for platform_get_irq() failure Date: Fri, 16 Sep 2022 12:08:50 +0200 Message-Id: <20220916100448.086413293@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220916100446.916515275@linuxfoundation.org> References: <20220916100446.916515275@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 513de1f54e2d7..933b96e243b84 100644 --- a/drivers/perf/arm_pmu_platform.c +++ b/drivers/perf/arm_pmu_platform.c @@ -117,7 +117,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