lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170929005029.7kf5vros6yavrgtn@yury-thinkpad>
Date:   Fri, 29 Sep 2017 03:50:29 +0300
From:   Yury Norov <ynorov@...iumnetworks.com>
To:     Volodymyr Babchuk <volodymyr_babchuk@...m.com>
Cc:     linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        tee-dev@...ts.linaro.org,
        Jens Wiklander <jens.wiklander@...aro.org>,
        Volodymyr Babchuk <vlad.babchuk@...il.com>
Subject: Re: [PATCH v1 14/14] tee: shm: inline tee_shm getter functions

On Thu, Sep 28, 2017 at 09:04:11PM +0300, Volodymyr Babchuk wrote:
> From: Volodymyr Babchuk <vlad.babchuk@...il.com>
> 
> Now, when struct tee_shm is defined in public header,
> we can inline small getter functions.

struct tee_shm is moved to public header in first patch of series,
so you can put tee_shm_is_registered() in proper place at once, right?

> 
> Signed-off-by: Volodymyr Babchuk <vlad.babchuk@...il.com>
> ---
>  drivers/tee/tee_shm.c   | 17 -----------------
>  include/linux/tee_drv.h | 10 ++++++++--
>  2 files changed, 8 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/tee/tee_shm.c b/drivers/tee/tee_shm.c
> index 5176c83..453700a 100644
> --- a/drivers/tee/tee_shm.c
> +++ b/drivers/tee/tee_shm.c
> @@ -494,23 +494,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
> diff --git a/include/linux/tee_drv.h b/include/linux/tee_drv.h
> index 6aaef65..2ae0286 100644
> --- a/include/linux/tee_drv.h
> +++ b/include/linux/tee_drv.h
> @@ -429,7 +429,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
> @@ -445,6 +448,9 @@ struct tee_shm *tee_shm_get_from_id(struct tee_context *ctx, int id);
>   * @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);
> +}
>  
>  #endif /*__TEE_DRV_H*/
> -- 
> 2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ