[Cbe-oss-dev] [PATCH 07/11]MARS: Remove api argument params structs

Kazunori Asayama asayama at sm.sony.co.jp
Fri Sep 12 18:28:01 EST 2008


Yuji Mano wrote:
> This removes the mars_params and mars_task_params structure previously passed
> into the mars context and mars task APIs.
> 
> Parameter arguments are now passed in directly.
> 
> Signed-off-by: Yuji Mano <yuji.mano at am.sony.com>
> 
> ---
>  include/host/mars/mars_context.h |   23 +++-----------------
>  include/host/mars/mars_task.h    |   32 +++++++---------------------
>  src/host/lib/mars_context.c      |   44 +++++++++++++++------------------------
>  src/host/lib/mars_task.c         |   34 +++++++++++++-----------------
>  4 files changed, 46 insertions(+), 87 deletions(-)
> 

(snip)

> -int mars_initialize(struct mars_context *mars, struct mars_params *params)
> +int mars_initialize(struct mars_context *mars, uint32_t num_mpus)
>  {
>  	MARS_CHECK_RET(mars, MARS_ERROR_NULL);
> +	MARS_CHECK_RET(num_mpus_max() > 0, MARS_ERROR_INTERNAL);
> +	MARS_CHECK_RET(num_mpus_max() >= num_mpus, MARS_ERROR_PARAMS);

The num_mpus_max() is called repeatedly in this function. Instead, I
think the return value should be cached. (The spe_cpu_info_get() checks
sysfs, so it's not lightweight.)

-- 
(ASAYAMA Kazunori
  (asayama at sm.sony.co.jp))
t



More information about the cbe-oss-dev mailing list