Skip to content

Commit

Permalink
[NEW SHM]tee: shm: inline tee_shm getter functions
Browse files Browse the repository at this point in the history
Now, when struct tee_shm is defined in public header,
we can inline small getter functions.

Signed-off-by: Volodymyr Babchuk <[email protected]>
  • Loading branch information
lorc authored and jenswi-linaro committed Oct 27, 2017
1 parent 8862a5d commit c7f82a0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 19 deletions.
17 changes: 0 additions & 17 deletions drivers/tee/tee_shm.c
Original file line number Diff line number Diff line change
Expand Up @@ -606,23 +606,6 @@ struct tee_shm *tee_shm_get_from_id(struct tee_context *ctx, int id)
}
EXPORT_SYMBOL_GPL(tee_shm_get_from_id);

bool tee_shm_is_registered(struct tee_shm *shm)
{
return shm && (shm->flags & TEE_SHM_REGISTER);
}
EXPORT_SYMBOL_GPL(tee_shm_is_registered);

/**
* tee_shm_get_id() - Get id of a shared memory object
* @shm: Shared memory handle
* @returns id
*/
int tee_shm_get_id(struct tee_shm *shm)
{
return shm->id;
}
EXPORT_SYMBOL_GPL(tee_shm_get_id);

/**
* tee_shm_put() - Decrease reference count on a shared memory handle
* @shm: Shared memory handle
Expand Down
10 changes: 8 additions & 2 deletions include/linux/tee_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,10 @@ static inline size_t tee_shm_get_page_offset(struct tee_shm *shm)
* @shm: Shared memory handle
* @returns id
*/
int tee_shm_get_id(struct tee_shm *shm);
static inline int tee_shm_get_id(struct tee_shm *shm)
{
return shm->id;
}

/**
* tee_shm_get_from_id() - Find shared memory object and increase reference
Expand Down Expand Up @@ -467,7 +470,10 @@ static inline bool tee_param_is_memref(struct tee_param *param)
* @shm: Shared memory handle
* @returns true if object is registered in TEE
*/
bool tee_shm_is_registered(struct tee_shm *shm);
static inline bool tee_shm_is_registered(struct tee_shm *shm)
{
return shm && (shm->flags & TEE_SHM_REGISTER);
}

/**
* tee_client_open_context() - Open a TEE context
Expand Down

0 comments on commit c7f82a0

Please sign in to comment.