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: <5528f5e7-86fe-f53e-d8db-db91cdd25adb@linux.intel.com>
Date:   Fri, 21 Oct 2022 12:13:07 -0500
From:   Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
To:     Srinivas Kandagatla <srinivas.kandagatla@...aro.org>,
        broonie@...nel.org
Cc:     alsa-devel@...a-project.org, linux-arm-msm@...r.kernel.org,
        tiwai@...e.com, lgirdwood@...il.com, bgoswami@...cinc.com,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 5/9] ASoC: qdsp6: audioreach: simplify module_list sz
 calculation



On 10/21/22 11:52, Srinivas Kandagatla wrote:
> Simplify module_list size calcuation by doing inside modules loop.

typo: calculation.

> 
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
> ---
>  sound/soc/qcom/qdsp6/audioreach.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/sound/soc/qcom/qdsp6/audioreach.c b/sound/soc/qcom/qdsp6/audioreach.c
> index 0015ec89d90b..87a3fd1f8107 100644
> --- a/sound/soc/qcom/qdsp6/audioreach.c
> +++ b/sound/soc/qcom/qdsp6/audioreach.c
> @@ -430,7 +430,6 @@ void *audioreach_alloc_graph_pkt(struct q6apm *apm, struct audioreach_graph_info
>  	struct audioreach_sub_graph *sgs;
>  	struct apm_mod_list_obj *mlobj;
>  	struct list_head *sg_list;
> -	int num_modules_per_list;
>  	int num_connections = 0;
>  	int num_containers = 0;
>  	int num_sub_graphs = 0;
> @@ -451,6 +450,9 @@ void *audioreach_alloc_graph_pkt(struct q6apm *apm, struct audioreach_graph_info
>  		list_for_each_entry(container, &sgs->container_list, node) {
>  			num_containers++;
>  			num_modules += container->num_modules;
> +			ml_sz = ml_sz + sizeof(struct apm_module_list_params) +
> +				APM_MOD_LIST_OBJ_PSIZE(mlobj, container->num_modules);
> +
>  			list_for_each_entry(module, &container->modules_list, node) {
>  				if (module->src_mod_inst_id)
>  					num_connections++;
> @@ -459,11 +461,11 @@ void *audioreach_alloc_graph_pkt(struct q6apm *apm, struct audioreach_graph_info
>  	}
>  
>  	num_modules_list = num_containers;
> -	num_modules_per_list = num_modules/num_containers;
>  	sg_sz = APM_SUB_GRAPH_PSIZE(sg_params, num_sub_graphs);
>  	cont_sz = APM_CONTAINER_PSIZE(cont_params, num_containers);
> -	ml_sz =	ALIGN(sizeof(struct apm_module_list_params) +
> -		num_modules_list * APM_MOD_LIST_OBJ_PSIZE(mlobj,  num_modules_per_list), 8);
> +
> +	ml_sz = ALIGN(ml_sz, 8);
> +
>  	mp_sz = APM_MOD_PROP_PSIZE(mprop, num_modules);
>  	mc_sz =	APM_MOD_CONN_PSIZE(mcon, num_connections);
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ