[krzk-github:n/sm8450 44/54] sound/soc/qcom/qdsp6/audioreach.c:440:13: warning: variable 'graph_id' set but not used
From: kernel test robot
Date: Tue Oct 25 2022 - 12:58:38 EST
tree: https://github.com/krzk/linux n/sm8450
head: 4362bc5a775e83575c8b9206ec07286f590bcb62
commit: a5fec2296aef6819a29e32dc26c142f7ee689194 [44/54] ASoC: qdsp6: audioreach: Simplify handing FE and BE graph connections
config: loongarch-allyesconfig (attached as .config)
compiler: loongarch64-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/krzk/linux/commit/a5fec2296aef6819a29e32dc26c142f7ee689194
git remote add krzk-github https://github.com/krzk/linux
git fetch --no-tags krzk-github n/sm8450
git checkout a5fec2296aef6819a29e32dc26c142f7ee689194
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=loongarch SHELL=/bin/bash sound/soc/qcom/qdsp6/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
All warnings (new ones prefixed by >>):
sound/soc/qcom/qdsp6/audioreach.c: In function 'audioreach_alloc_graph_pkt':
>> sound/soc/qcom/qdsp6/audioreach.c:440:13: warning: variable 'graph_id' set but not used [-Wunused-but-set-variable]
440 | int graph_id;
| ^~~~~~~~
vim +/graph_id +440 sound/soc/qcom/qdsp6/audioreach.c
418
419 void *audioreach_alloc_graph_pkt(struct q6apm *apm, struct audioreach_graph_info *info)
420 {
421 int payload_size, sg_sz, cont_sz, ml_sz, mp_sz, mc_sz;
422 struct apm_module_param_data *param_data;
423 struct apm_container_params *cont_params;
424 struct audioreach_container *container;
425 struct apm_sub_graph_params *sg_params;
426 struct apm_mod_conn_list_params *mcon;
427 struct apm_graph_open_params params;
428 struct apm_prop_list_params *mprop;
429 struct audioreach_module *module;
430 struct audioreach_sub_graph *sgs;
431 struct apm_mod_list_obj *mlobj;
432 struct list_head *sg_list;
433 int num_modules_per_list;
434 int num_connections = 0;
435 int num_containers = 0;
436 int num_sub_graphs = 0;
437 int num_modules = 0;
438 int num_modules_list;
439 struct gpr_pkt *pkt;
> 440 int graph_id;
441 void *p;
442
443 graph_id = info->id;
444 sg_list = &info->sg_list;
445 ml_sz = 0;
446
447 /* add FE-BE connections */
448 if (info->dst_mod_inst_id && info->src_mod_inst_id)
449 num_connections++;
450
451 list_for_each_entry(sgs, sg_list, node) {
452 num_sub_graphs++;
453 list_for_each_entry(container, &sgs->container_list, node) {
454 num_containers++;
455 num_modules += container->num_modules;
456 list_for_each_entry(module, &container->modules_list, node) {
457 if (module->src_mod_inst_id)
458 num_connections++;
459 }
460 }
461 }
462
463 num_modules_list = num_containers;
464 num_modules_per_list = num_modules/num_containers;
465 sg_sz = APM_SUB_GRAPH_PSIZE(sg_params, num_sub_graphs);
466 cont_sz = APM_CONTAINER_PSIZE(cont_params, num_containers);
467 ml_sz = ALIGN(sizeof(struct apm_module_list_params) +
468 num_modules_list * APM_MOD_LIST_OBJ_PSIZE(mlobj, num_modules_per_list), 8);
469 mp_sz = APM_MOD_PROP_PSIZE(mprop, num_modules);
470 mc_sz = APM_MOD_CONN_PSIZE(mcon, num_connections);
471
472 payload_size = sg_sz + cont_sz + ml_sz + mp_sz + mc_sz;
473 pkt = audioreach_alloc_apm_cmd_pkt(payload_size, APM_CMD_GRAPH_OPEN, 0);
474 if (IS_ERR(pkt))
475 return pkt;
476
477 p = (void *)pkt + GPR_HDR_SIZE + APM_CMD_HDR_SIZE;
478
479 /* SubGraph */
480 params.sg_data = p;
481 param_data = ¶ms.sg_data->param_data;
482 param_data->module_instance_id = APM_MODULE_INSTANCE_ID;
483 param_data->param_id = APM_PARAM_ID_SUB_GRAPH_CONFIG;
484 param_data->param_size = sg_sz - APM_MODULE_PARAM_DATA_SIZE;
485 params.sg_data->num_sub_graphs = num_sub_graphs;
486 p += sg_sz;
487
488 /* Container */
489 params.cont_data = p;
490 param_data = ¶ms.cont_data->param_data;
491 param_data->module_instance_id = APM_MODULE_INSTANCE_ID;
492 param_data->param_id = APM_PARAM_ID_CONTAINER_CONFIG;
493 param_data->param_size = cont_sz - APM_MODULE_PARAM_DATA_SIZE;
494 params.cont_data->num_containers = num_containers;
495 p += cont_sz;
496
497 /* Module List*/
498 params.mod_list_data = p;
499 param_data = ¶ms.mod_list_data->param_data;
500 param_data->module_instance_id = APM_MODULE_INSTANCE_ID;
501 param_data->param_id = APM_PARAM_ID_MODULE_LIST;
502 param_data->param_size = ml_sz - APM_MODULE_PARAM_DATA_SIZE;
503 params.mod_list_data->num_modules_list = num_sub_graphs;
504 p += ml_sz;
505
506 /* Module Properties */
507 params.mod_prop_data = p;
508 param_data = ¶ms.mod_prop_data->param_data;
509 param_data->module_instance_id = APM_MODULE_INSTANCE_ID;
510 param_data->param_id = APM_PARAM_ID_MODULE_PROP;
511 param_data->param_size = mp_sz - APM_MODULE_PARAM_DATA_SIZE;
512 params.mod_prop_data->num_modules_prop_cfg = num_modules;
513 p += mp_sz;
514
515 /* Module Connections */
516 params.mod_conn_list_data = p;
517 param_data = ¶ms.mod_conn_list_data->param_data;
518 param_data->module_instance_id = APM_MODULE_INSTANCE_ID;
519 param_data->param_id = APM_PARAM_ID_MODULE_CONN;
520 param_data->param_size = mc_sz - APM_MODULE_PARAM_DATA_SIZE;
521 params.mod_conn_list_data->num_connections = num_connections;
522 p += mc_sz;
523
524 audioreach_populate_graph(apm, info, ¶ms, sg_list, num_sub_graphs);
525
526 return pkt;
527 }
528 EXPORT_SYMBOL_GPL(audioreach_alloc_graph_pkt);
529
--
0-DAY CI Kernel Test Service
https://01.org/lkp
Attachment:
.config.gz
Description: application/gzip