Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1449443iob; Thu, 19 May 2022 06:58:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxBWPJV+BthHX9MeRFJ7QE+2tCij1jbf4ZTYND8eG23DBQfrHsGjaAMlZj6EEY/TAxKtzX X-Received: by 2002:a05:6402:3686:b0:42b:764:60c6 with SMTP id ej6-20020a056402368600b0042b076460c6mr2281441edb.384.1652968681428; Thu, 19 May 2022 06:58:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652968681; cv=none; d=google.com; s=arc-20160816; b=HEK+oUBecQJHoOZq0mQBrm2WYvIfW1JgtEXoD2PWMFAlFsLFSDAs8WvdbQUNDvPT2A YSU14RFWYwHlc5ZbrrNXfoSm8YMIHC/38I/S0bZdEhufwtH0/mTCVo0ox8323N0JLzIx 01o5xG8OmLw8rWODk26kl2Vkm0CJZjO3ooWKd462dcLNfsvZm4v1Bc3d2SrgLz/oL6bD x4BcDGVKV68k/LEByGAQbR64WzR/LYYreP1nskSfhQoosK2cYMYAzaqjq1Pw2ufwhOLV g9lUX40r729VJLlLnoQQL8zhcDzYPeze35OAokIYwdVtjCiKfNvM1yQ2mJ5FMR8FPxTM +y+Q== 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 :message-id:date:subject:cc:to:from; bh=aWG0iWLicq5PhopLJOZHGOPlwAnrwXjqK8B4d5NVQv4=; b=EXrK+P+9J3G62p0KzNy5xV8xd7OqoExOmFOgOheQd+U+B1U1Iyx9NqS2hGw6xpJKpA qqYwt5XouF/4v3YnsRzRx4pYyiPH37Hm/mr4VaaNFBHFUPa9tLEKo+pQ89UnKvu8Kxy/ JDxqXwYASW0xnd0iq6h6COS5mHvYrtQ2VYosniZKXWwz4/AypmStGXHBrjIP4eE7/jXr S5+WKcFvktNqjz/Lx8nQ1MXw9j6xOjA/j5XjXcAJYgZZzPac0ZWPWuEMNPfrU8J31AbU JwF2zPMerrTA0AQx2PZc9J+hnFrXrq6Xzqh57pwkIUgDm9pgb1h1z60S3Um+CO+77+R/ /xDw== 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 di4-20020a170906730400b006f3be6cce60si6011391ejc.786.2022.05.19.06.57.31; Thu, 19 May 2022 06:58:01 -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 S234981AbiESHnY (ORCPT + 99 others); Thu, 19 May 2022 03:43:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235009AbiESHnO (ORCPT ); Thu, 19 May 2022 03:43:14 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 666EFAE263 for ; Thu, 19 May 2022 00:43:04 -0700 (PDT) Received: from dggpemm500023.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4L3hXt70QNzCsjD; Thu, 19 May 2022 15:38:06 +0800 (CST) Received: from dggpemm500018.china.huawei.com (7.185.36.111) by dggpemm500023.china.huawei.com (7.185.36.83) 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:02 +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:02 +0800 From: keliu To: , , , CC: keliu Subject: [PATCH 1/2] drivers/perf: Directly use ida_alloc()/free() Date: Thu, 19 May 2022 08:01:26 +0000 Message-ID: <20220519080127.147030-1-liuke94@huawei.com> X-Mailer: git-send-email 2.25.1 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/fsl_imx8_ddr_perf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/perf/fsl_imx8_ddr_perf.c b/drivers/perf/fsl_imx8_ddr_perf.c index b1b2a55de77f..8e058e08fe81 100644 --- a/drivers/perf/fsl_imx8_ddr_perf.c +++ b/drivers/perf/fsl_imx8_ddr_perf.c @@ -611,7 +611,7 @@ static int ddr_perf_init(struct ddr_pmu *pmu, void __iomem *base, .dev = dev, }; - pmu->id = ida_simple_get(&ddr_ida, 0, 0, GFP_KERNEL); + pmu->id = ida_alloc(&ddr_ida, GFP_KERNEL); return pmu->id; } @@ -765,7 +765,7 @@ static int ddr_perf_probe(struct platform_device *pdev) cpuhp_instance_err: cpuhp_remove_multi_state(pmu->cpuhp_state); cpuhp_state_err: - ida_simple_remove(&ddr_ida, pmu->id); + ida_free(&ddr_ida, pmu->id); dev_warn(&pdev->dev, "i.MX8 DDR Perf PMU failed (%d), disabled\n", ret); return ret; } @@ -779,7 +779,7 @@ static int ddr_perf_remove(struct platform_device *pdev) perf_pmu_unregister(&pmu->pmu); - ida_simple_remove(&ddr_ida, pmu->id); + ida_free(&ddr_ida, pmu->id); return 0; } -- 2.25.1