Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tee: remove linked list of struct tee_shm

Removes list_shm from struct tee_context since the linked list isn't used
any longer.

Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>

+1 -15
-1
drivers/tee/tee_core.c
··· 44 44 45 45 kref_init(&ctx->refcount); 46 46 ctx->teedev = teedev; 47 - INIT_LIST_HEAD(&ctx->list_shm); 48 47 rc = teedev->desc->ops->open(ctx); 49 48 if (rc) 50 49 goto err;
+1 -11
drivers/tee/tee_shm.c
··· 17 17 18 18 mutex_lock(&teedev->mutex); 19 19 idr_remove(&teedev->idr, shm->id); 20 - if (shm->ctx) 21 - list_del(&shm->link); 22 20 mutex_unlock(&teedev->mutex); 23 21 24 22 if (shm->flags & TEE_SHM_POOL) { ··· 166 168 } 167 169 } 168 170 169 - if (ctx) { 171 + if (ctx) 170 172 teedev_ctx_get(ctx); 171 - mutex_lock(&teedev->mutex); 172 - list_add_tail(&shm->link, &ctx->list_shm); 173 - mutex_unlock(&teedev->mutex); 174 - } 175 173 176 174 return shm; 177 175 err_rem: ··· 294 300 goto err; 295 301 } 296 302 } 297 - 298 - mutex_lock(&teedev->mutex); 299 - list_add_tail(&shm->link, &ctx->list_shm); 300 - mutex_unlock(&teedev->mutex); 301 303 302 304 return shm; 303 305 err:
-3
include/linux/tee_drv.h
··· 49 49 */ 50 50 struct tee_context { 51 51 struct tee_device *teedev; 52 - struct list_head list_shm; 53 52 void *data; 54 53 struct kref refcount; 55 54 bool releasing; ··· 169 170 * struct tee_shm - shared memory object 170 171 * @teedev: device used to allocate the object 171 172 * @ctx: context using the object, if NULL the context is gone 172 - * @link link element 173 173 * @paddr: physical address of the shared memory 174 174 * @kaddr: virtual address of the shared memory 175 175 * @size: size of shared memory ··· 185 187 struct tee_shm { 186 188 struct tee_device *teedev; 187 189 struct tee_context *ctx; 188 - struct list_head link; 189 190 phys_addr_t paddr; 190 191 void *kaddr; 191 192 size_t size;