Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1390535iob; Thu, 19 May 2022 05:47:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzapXD0Kocfkx2rL0NH6GnyTC/IwLvnCN03vkQl/UMY4C8F5C5ywY7ycFMBE0FYK6p1eSBv X-Received: by 2002:a17:903:228f:b0:15e:be12:a181 with SMTP id b15-20020a170903228f00b0015ebe12a181mr4696685plh.21.1652964476568; Thu, 19 May 2022 05:47:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652964476; cv=none; d=google.com; s=arc-20160816; b=lx6Yz9oVj8TZC9N2tb1I0HsQVHo3qAWTFyFPxeZtcZz533sa9ppPUY02ubKWTo7aSM u0JTAmaVj8A5ilcMCyM91Be0SjAQc8m9u1IWJMMaE8YHM4+tdQDgf8u4crbj0NisJKtk UNn1zjnV+vJCO4rqE+ak9LiO3YBGir9xNosieKy05qMqSDg4EzWPsTp2nDZgHT8iLAC4 xcAPSypOFu8j8qKowZusgvPc8a6fAiYyxrNTip6wnYXmu4kVTLpv4lixuUP8p+0kYw5t jTDRjnbp2KB1VHCgWh/7Dj0bL1DrrPodWz7g2BghXHX/yLnyeBJgRvfUnJQKHLDW5pgh HghA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=TztmVqtpLHYQQjNmVAQhD5XJzwYKsR8xLCTrfFJUp80=; b=i0nYi7idLZWlfMHBMmAZxNS7P3E57p7b3mBVeyWSf69j5o09BBHjdQSSLJAyGgfOk7 gL83MIQARSdvBsfvFcdf+tmtiVSqNHGfJ81E8b/lyFhUSBaa6nptl2fWiw9Cxoo9qIUH qV2SFnVJRdSjOyf7t1bEvaaSbCxGbQp8HaGyZ0n6F6WqmRAWoWH2DhtTXV8VisMxl0X8 kvf/lBNLnmgLP+U5EUol5pAfZQWQrFFWUo5ljHzUvQck+u0FIqTmT2FjhksIRHjx41pq Kcn+ErARNMphXWs9o1Y+0pjwMoYpukzexT2egXIUIrU3oOLSGrk0FTh35mOhVSVLgaFG BA2w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g6-20020a056a001a0600b0050e09a93a5fsi7498575pfv.34.2022.05.19.05.47.44; Thu, 19 May 2022 05:47:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230056AbiESHnT (ORCPT + 99 others); Thu, 19 May 2022 03:43:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235012AbiESHnO (ORCPT ); Thu, 19 May 2022 03:43:14 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16853A88A7 for ; Thu, 19 May 2022 00:43:06 -0700 (PDT) Received: from dggpemm500024.china.huawei.com (unknown [172.30.72.55]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4L3hd20JtHz1JC2l; Thu, 19 May 2022 15:41:42 +0800 (CST) Received: from dggpemm500018.china.huawei.com (7.185.36.111) by dggpemm500024.china.huawei.com (7.185.36.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 19 May 2022 15:43:04 +0800 Received: from localhost.localdomain (10.175.112.125) by dggpemm500018.china.huawei.com (7.185.36.111) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 19 May 2022 15:43:04 +0800 From: keliu To: , , , CC: keliu Subject: [PATCH 2/2] drivers/perf:Directly use ida_alloc()/free() Date: Thu, 19 May 2022 08:01:27 +0000 Message-ID: <20220519080127.147030-2-liuke94@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220519080127.147030-1-liuke94@huawei.com> References: <20220519080127.147030-1-liuke94@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500018.china.huawei.com (7.185.36.111) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use ida_alloc()/ida_free() instead of deprecated ida_simple_get()/ida_simple_remove() . Signed-off-by: keliu --- drivers/perf/arm-ccn.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/perf/arm-ccn.c b/drivers/perf/arm-ccn.c index 40b352e8aa7f..728d13d8e98a 100644 --- a/drivers/perf/arm-ccn.c +++ b/drivers/perf/arm-ccn.c @@ -1250,7 +1250,7 @@ static int arm_ccn_pmu_init(struct arm_ccn *ccn) ccn->dt.cmp_mask[CCN_IDX_MASK_OPCODE].h = ~(0x1f << 9); /* Get a convenient /sys/event_source/devices/ name */ - ccn->dt.id = ida_simple_get(&arm_ccn_pmu_ida, 0, 0, GFP_KERNEL); + ccn->dt.id = ida_alloc(&arm_ccn_pmu_ida, GFP_KERNEL); if (ccn->dt.id == 0) { name = "ccn"; } else { @@ -1312,7 +1312,7 @@ static int arm_ccn_pmu_init(struct arm_ccn *ccn) &ccn->dt.node); error_set_affinity: error_choose_name: - ida_simple_remove(&arm_ccn_pmu_ida, ccn->dt.id); + ida_free(&arm_ccn_pmu_ida, ccn->dt.id); for (i = 0; i < ccn->num_xps; i++) writel(0, ccn->xp[i].base + CCN_XP_DT_CONTROL); writel(0, ccn->dt.base + CCN_DT_PMCR); @@ -1329,7 +1329,7 @@ static void arm_ccn_pmu_cleanup(struct arm_ccn *ccn) writel(0, ccn->xp[i].base + CCN_XP_DT_CONTROL); writel(0, ccn->dt.base + CCN_DT_PMCR); perf_pmu_unregister(&ccn->dt.pmu); - ida_simple_remove(&arm_ccn_pmu_ida, ccn->dt.id); + ida_free(&arm_ccn_pmu_ida, ccn->dt.id); } static int arm_ccn_for_each_valid_region(struct arm_ccn *ccn, -- 2.25.1