Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp3492663pxb; Fri, 4 Feb 2022 09:37:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJzI/uuQxf+GLVXZBlXKnQoYAe4CtExWc34iycGbyZa2FUx2tYj78C7DsEKoP30NfrYFu7o7 X-Received: by 2002:a63:5262:: with SMTP id s34mr40830pgl.601.1643996221527; Fri, 04 Feb 2022 09:37:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643996221; cv=none; d=google.com; s=arc-20160816; b=TcBU3kIbPItxH4yiVNQ3GJSnYeCyhkq3/tCEbQ18E4rmXk95SK7/qlDbdpiMZZLUmD /Pw3Pe0Cs6zpafnWr0zKobZk1nvDkpE5jO0iBGutJWL9wk5FqCPDpL0e5VrLHYZf79Ed YglP2ObrZa7g6SxyRybtL7p/CFcYLG3SG7rsurrQyS93trgwxf6XaqILu9dBR56RwnnR pcqIxkGECJDKe+ns+2+I1ERugnE9zM5fXekiWYAY4Fj67b01Uw3rp0L3pBmqslYEpD6y SHWtPjPn9LsbHBsYf3m23x/fstV13nyb9EKJKdDTdvcGi3g94GIYHuE6FAmFBmp3ESx7 DRIQ== 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 :dkim-signature; bh=yn8zIxo8jyjO0ELBYvTuGmQzkeFiyQ40SLBI74VyhvY=; b=U2qbUZgnOIBYzvXVLRVUMtBW4RAVo1AORaYpzVv83Iy3HWhZKAnceCiaKoHYWNYXZN AaDJp8UHwhEKUIRaZ9VsEXpgqDMmW5IMAFkQvNh/cW8xaQkkIfjpTnMWces1fs0cbG5/ Vc/IL0wWyOicL3OxbLtLKK7iZuNdABE0w18YoHbjQm+7F9qBSNakJbJSwOaXFCAdmysJ LiyL1fxvsE/nwAdYX/9E87vHNpUA3+F/5XNAZoV0uJlLhQl4H5pjYSOa+Pr8uozMkvHC Oha92JkdeJcDdzAm2oXd+KrnvxrQBsqa8mNmO7N+d1ciBIM2uPE6hkCygmrvKe5RpYSd MpgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=s8mMzmsS; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a19si2372629pld.341.2022.02.04.09.36.49; Fri, 04 Feb 2022 09:37:01 -0800 (PST) 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; dkim=pass header.i=@linaro.org header.s=google header.b=s8mMzmsS; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345401AbiBDJeR (ORCPT + 99 others); Fri, 4 Feb 2022 04:34:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239763AbiBDJeO (ORCPT ); Fri, 4 Feb 2022 04:34:14 -0500 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A06FC061401 for ; Fri, 4 Feb 2022 01:34:13 -0800 (PST) Received: by mail-lf1-x130.google.com with SMTP id z4so11508441lft.3 for ; Fri, 04 Feb 2022 01:34:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yn8zIxo8jyjO0ELBYvTuGmQzkeFiyQ40SLBI74VyhvY=; b=s8mMzmsSA1dE4oUddbq1qzNko2vK6jKtLdXrTc1toAkzT32q1UgpuZJv2X8EwvoO4w dBsTSDQBnPTt8XL5ySsufegkKwWtIwvMEmAlF7abJdOnfGVxb3sBkdaS4z+Za07vYJ/Z 5eCKgE6NqAk+UqYhX/2rOOeeIuSK63PFJRwHrKV5WGqu8biGmSlhGSwugJ+vq1nG1gy1 GpVGbRsX8+h8F0w5hsHD6NNUP97omkr4blgPyaR2xAMmKv67blb0dkMOj8Ikap4Gbtm8 FZ+krYmAxA/DlGSxWraANCrQpgSFpmZXtqCRqNIfJjaOIxYbLD/KvpyeyfSiCQvMlOso +ZDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yn8zIxo8jyjO0ELBYvTuGmQzkeFiyQ40SLBI74VyhvY=; b=JQj5OwxLVumLqEjpueKGHguqtseDlE6pY/Cs2LbgpEA/BWmnKPA4t/24TfMUvQG1+C SpQ0roJwfHdtb+gxFCccUeBEduK1vmqQQWFEL6opaNNDq8fz+mTqbszombldbxZYOH6Z 0l6zUE04KixAdh7OpbAh2BiSPlgNL/KIr9GkMZEypYQarkpclVMgpAcES+R22qS6Ch9Q YnaDGpRttim2W4noBbE6ol7orZ0sIHlS1K4fpWMJBkY1Ev1e6tn7l8lVJg0zBAy/odn9 iQYBIiYnr6AShCVnoS/eSNcvuiXN9Ujdu9oFwdSVZYOPV+057lnIF1mz2CynGBkKTopV u7xg== X-Gm-Message-State: AOAM531sOyn9xmAvwnzVz+g75cK5Gokp4gK2iJinrLdeOtG5Sr6nEvoH btG81H1QsE6rvi+qWBHgzlMYdv7Z/I5qJg== X-Received: by 2002:a05:6512:234f:: with SMTP id p15mr1775788lfu.606.1643967251531; Fri, 04 Feb 2022 01:34:11 -0800 (PST) Received: from jade.urgonet (h-94-254-48-165.A175.priv.bahnhof.se. [94.254.48.165]) by smtp.gmail.com with ESMTPSA id u28sm230550lfl.160.2022.02.04.01.34.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Feb 2022 01:34:11 -0800 (PST) From: Jens Wiklander To: linux-kernel@vger.kernel.org, op-tee@lists.trustedfirmware.org Cc: Sumit Garg , Herbert Xu , Devaraj Rangasamy , Rijo Thomas , David Howells , Tyler Hicks , Jens Wiklander Subject: [PATCH v4 02/10] tee: remove unused tee_shm_pool_alloc_res_mem() Date: Fri, 4 Feb 2022 10:33:51 +0100 Message-Id: <20220204093359.359059-3-jens.wiklander@linaro.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220204093359.359059-1-jens.wiklander@linaro.org> References: <20220204093359.359059-1-jens.wiklander@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org None of the drivers in the TEE subsystem uses tee_shm_pool_alloc_res_mem() so remove the function. Reviewed-by: Sumit Garg Signed-off-by: Jens Wiklander --- drivers/tee/tee_shm_pool.c | 56 -------------------------------------- include/linux/tee_drv.h | 30 -------------------- 2 files changed, 86 deletions(-) diff --git a/drivers/tee/tee_shm_pool.c b/drivers/tee/tee_shm_pool.c index fcbb461fc59c..a9f9d50fd181 100644 --- a/drivers/tee/tee_shm_pool.c +++ b/drivers/tee/tee_shm_pool.c @@ -47,62 +47,6 @@ static const struct tee_shm_pool_mgr_ops pool_ops_generic = { .destroy_poolmgr = pool_op_gen_destroy_poolmgr, }; -/** - * tee_shm_pool_alloc_res_mem() - Create a shared memory pool from reserved - * memory range - * @priv_info: Information for driver private shared memory pool - * @dmabuf_info: Information for dma-buf shared memory pool - * - * Start and end of pools will must be page aligned. - * - * Allocation with the flag TEE_SHM_DMA_BUF set will use the range supplied - * in @dmabuf, others will use the range provided by @priv. - * - * @returns pointer to a 'struct tee_shm_pool' or an ERR_PTR on failure. - */ -struct tee_shm_pool * -tee_shm_pool_alloc_res_mem(struct tee_shm_pool_mem_info *priv_info, - struct tee_shm_pool_mem_info *dmabuf_info) -{ - struct tee_shm_pool_mgr *priv_mgr; - struct tee_shm_pool_mgr *dmabuf_mgr; - void *rc; - - /* - * Create the pool for driver private shared memory - */ - rc = tee_shm_pool_mgr_alloc_res_mem(priv_info->vaddr, priv_info->paddr, - priv_info->size, - 3 /* 8 byte aligned */); - if (IS_ERR(rc)) - return rc; - priv_mgr = rc; - - /* - * Create the pool for dma_buf shared memory - */ - rc = tee_shm_pool_mgr_alloc_res_mem(dmabuf_info->vaddr, - dmabuf_info->paddr, - dmabuf_info->size, PAGE_SHIFT); - if (IS_ERR(rc)) - goto err_free_priv_mgr; - dmabuf_mgr = rc; - - rc = tee_shm_pool_alloc(priv_mgr, dmabuf_mgr); - if (IS_ERR(rc)) - goto err_free_dmabuf_mgr; - - return rc; - -err_free_dmabuf_mgr: - tee_shm_pool_mgr_destroy(dmabuf_mgr); -err_free_priv_mgr: - tee_shm_pool_mgr_destroy(priv_mgr); - - return rc; -} -EXPORT_SYMBOL_GPL(tee_shm_pool_alloc_res_mem); - struct tee_shm_pool_mgr *tee_shm_pool_mgr_alloc_res_mem(unsigned long vaddr, phys_addr_t paddr, size_t size, diff --git a/include/linux/tee_drv.h b/include/linux/tee_drv.h index 5e1533ee3785..6b0f0d01ebdf 100644 --- a/include/linux/tee_drv.h +++ b/include/linux/tee_drv.h @@ -278,36 +278,6 @@ static inline void tee_shm_pool_mgr_destroy(struct tee_shm_pool_mgr *poolm) poolm->ops->destroy_poolmgr(poolm); } -/** - * struct tee_shm_pool_mem_info - holds information needed to create a shared - * memory pool - * @vaddr: Virtual address of start of pool - * @paddr: Physical address of start of pool - * @size: Size in bytes of the pool - */ -struct tee_shm_pool_mem_info { - unsigned long vaddr; - phys_addr_t paddr; - size_t size; -}; - -/** - * tee_shm_pool_alloc_res_mem() - Create a shared memory pool from reserved - * memory range - * @priv_info: Information for driver private shared memory pool - * @dmabuf_info: Information for dma-buf shared memory pool - * - * Start and end of pools will must be page aligned. - * - * Allocation with the flag TEE_SHM_DMA_BUF set will use the range supplied - * in @dmabuf, others will use the range provided by @priv. - * - * @returns pointer to a 'struct tee_shm_pool' or an ERR_PTR on failure. - */ -struct tee_shm_pool * -tee_shm_pool_alloc_res_mem(struct tee_shm_pool_mem_info *priv_info, - struct tee_shm_pool_mem_info *dmabuf_info); - /** * tee_shm_pool_free() - Free a shared memory pool * @pool: The shared memory pool to free -- 2.31.1