CC: [email protected]
TO: Peter Ujfalusi <[email protected]>
CC: Kai Vehmanen <[email protected]>

tree:   https://github.com/plbossart/sound merge/sound-upstream-20210726
head:   2ae2cb25898106cd8d67d797300b219a7ddcf2f9
commit: 7c60d06634530437de78a92ef8c6cd4782d72440 [3819/4059] ASoC: 
soc-topology: Move template info print soc_tplg_dapm_widget_create()
:::::: branch date: 13 hours ago
:::::: commit date: 5 weeks ago
config: x86_64-randconfig-c001-20210726 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 
c63dbd850182797bc4b76124d08e1c320ab2365d)
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
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # 
https://github.com/plbossart/sound/commit/7c60d06634530437de78a92ef8c6cd4782d72440
        git remote add plbossart-sound https://github.com/plbossart/sound
        git fetch --no-tags plbossart-sound merge/sound-upstream-20210726
        git checkout 7c60d06634530437de78a92ef8c6cd4782d72440
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 
clang-analyzer 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>


clang-analyzer warnings: (new ones prefixed by >>)
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   5 warnings generated.
   drivers/iio/frequency/adf4350.c:33:8: warning: Excessive padding in 'struct 
adf4350_state' (116 padding bytes, where 52 is optimal). 
   Optimal fields order: 
   val, 
   r0_fract, 
   spi, 
   reg, 
   lock_detect_gpiod, 
   pdata, 
   clk, 
   clkin, 
   chspc, 
   fpfd, 
   min_out_freq, 
   freq_req, 
   regs, 
   regs_hw, 
   lock, 
   r0_int, 
   r1_mod, 
   r4_rf_div_sel, 
   consider reordering the fields or adding explicit padding members 
[clang-analyzer-optin.performance.Padding]
   struct adf4350_state {
   ~~~~~~~^~~~~~~~~~~~~~~
   drivers/iio/frequency/adf4350.c:33:8: note: Excessive padding in 'struct 
adf4350_state' (116 padding bytes, where 52 is optimal). Optimal fields order: 
val, r0_fract, spi, reg, lock_detect_gpiod, pdata, clk, clkin, chspc, fpfd, 
min_out_freq, freq_req, regs, regs_hw, lock, r0_int, r1_mod, r4_rf_div_sel, 
consider reordering the fields or adding explicit padding members
   struct adf4350_state {
   ~~~~~~~^~~~~~~~~~~~~~~
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
>> sound/soc/soc-topology.c:1480:2: warning: Value stored to 'control_hdr' is 
>> never read [clang-analyzer-deadcode.DeadStores]
           control_hdr = (struct snd_soc_tplg_ctl_hdr *)tplg->pos;
           ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/soc-topology.c:1480:2: note: Value stored to 'control_hdr' is 
never read
           control_hdr = (struct snd_soc_tplg_ctl_hdr *)tplg->pos;
           ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   4 warnings generated.
   sound/soc/sof/pcm.c:505:2: warning: Value stored to 'dai' is never read 
[clang-analyzer-deadcode.DeadStores]
           dai = bytes_to_frames(substream->runtime,
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/sof/pcm.c:505:2: note: Value stored to 'dai' is never read
           dai = bytes_to_frames(substream->runtime,
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   5 warnings generated.
   Suppressed 5 warnings (5 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   4 warnings generated.
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.

vim +/control_hdr +1480 sound/soc/soc-topology.c

8a9782346dccd8 Liam Girdwood        2015-05-29  1419  
8a9782346dccd8 Liam Girdwood        2015-05-29  1420  static int 
soc_tplg_dapm_widget_create(struct soc_tplg *tplg,
8a9782346dccd8 Liam Girdwood        2015-05-29  1421    struct 
snd_soc_tplg_dapm_widget *w)
8a9782346dccd8 Liam Girdwood        2015-05-29  1422  {
8a9782346dccd8 Liam Girdwood        2015-05-29  1423    struct 
snd_soc_dapm_context *dapm = &tplg->comp->dapm;
8a9782346dccd8 Liam Girdwood        2015-05-29  1424    struct 
snd_soc_dapm_widget template, *widget;
8a9782346dccd8 Liam Girdwood        2015-05-29  1425    struct 
snd_soc_tplg_ctl_hdr *control_hdr;
8a9782346dccd8 Liam Girdwood        2015-05-29  1426    struct snd_soc_card 
*card = tplg->comp->card;
b9c035aa43b8c0 Jaska Uimonen        2021-05-19  1427    unsigned int 
*kcontrol_type = NULL;
434aeb3af21570 Jaska Uimonen        2020-09-08  1428    struct snd_kcontrol_new 
*kc;
434aeb3af21570 Jaska Uimonen        2020-09-08  1429    int mixer_count = 0;
434aeb3af21570 Jaska Uimonen        2020-09-08  1430    int bytes_count = 0;
434aeb3af21570 Jaska Uimonen        2020-09-08  1431    int enum_count = 0;
8a9782346dccd8 Liam Girdwood        2015-05-29  1432    int ret = 0;
434aeb3af21570 Jaska Uimonen        2020-09-08  1433    int i;
8a9782346dccd8 Liam Girdwood        2015-05-29  1434  
8a9782346dccd8 Liam Girdwood        2015-05-29  1435    if (strnlen(w->name, 
SNDRV_CTL_ELEM_ID_NAME_MAXLEN) ==
8a9782346dccd8 Liam Girdwood        2015-05-29  1436            
SNDRV_CTL_ELEM_ID_NAME_MAXLEN)
8a9782346dccd8 Liam Girdwood        2015-05-29  1437            return -EINVAL;
8a9782346dccd8 Liam Girdwood        2015-05-29  1438    if (strnlen(w->sname, 
SNDRV_CTL_ELEM_ID_NAME_MAXLEN) ==
8a9782346dccd8 Liam Girdwood        2015-05-29  1439            
SNDRV_CTL_ELEM_ID_NAME_MAXLEN)
8a9782346dccd8 Liam Girdwood        2015-05-29  1440            return -EINVAL;
8a9782346dccd8 Liam Girdwood        2015-05-29  1441  
8a9782346dccd8 Liam Girdwood        2015-05-29  1442    dev_dbg(tplg->dev, 
"ASoC: creating DAPM widget %s id %d\n",
8a9782346dccd8 Liam Girdwood        2015-05-29  1443            w->name, w->id);
8a9782346dccd8 Liam Girdwood        2015-05-29  1444  
8a9782346dccd8 Liam Girdwood        2015-05-29  1445    memset(&template, 0, 
sizeof(template));
8a9782346dccd8 Liam Girdwood        2015-05-29  1446  
8a9782346dccd8 Liam Girdwood        2015-05-29  1447    /* map user to kernel 
widget ID */
5aebe7c7f9c20e Pierre-Louis Bossart 2019-04-04  1448    template.id = 
get_widget_id(le32_to_cpu(w->id));
752c938a5c14b8 Dan Carpenter        2019-09-25  1449    if ((int)template.id < 
0)
8a9782346dccd8 Liam Girdwood        2015-05-29  1450            return 
template.id;
8a9782346dccd8 Liam Girdwood        2015-05-29  1451  
c3421a6a65abc6 Liam Girdwood        2017-06-06  1452    /* strings are 
allocated here, but used and freed by the widget */
8a9782346dccd8 Liam Girdwood        2015-05-29  1453    template.name = 
kstrdup(w->name, GFP_KERNEL);
8a9782346dccd8 Liam Girdwood        2015-05-29  1454    if (!template.name)
8a9782346dccd8 Liam Girdwood        2015-05-29  1455            return -ENOMEM;
8a9782346dccd8 Liam Girdwood        2015-05-29  1456    template.sname = 
kstrdup(w->sname, GFP_KERNEL);
8a9782346dccd8 Liam Girdwood        2015-05-29  1457    if (!template.sname) {
8a9782346dccd8 Liam Girdwood        2015-05-29  1458            ret = -ENOMEM;
8a9782346dccd8 Liam Girdwood        2015-05-29  1459            goto err;
8a9782346dccd8 Liam Girdwood        2015-05-29  1460    }
5aebe7c7f9c20e Pierre-Louis Bossart 2019-04-04  1461    template.reg = 
le32_to_cpu(w->reg);
5aebe7c7f9c20e Pierre-Louis Bossart 2019-04-04  1462    template.shift = 
le32_to_cpu(w->shift);
5aebe7c7f9c20e Pierre-Louis Bossart 2019-04-04  1463    template.mask = 
le32_to_cpu(w->mask);
5aebe7c7f9c20e Pierre-Louis Bossart 2019-04-04  1464    template.subseq = 
le32_to_cpu(w->subseq);
8a9782346dccd8 Liam Girdwood        2015-05-29  1465    template.on_val = 
w->invert ? 0 : 1;
8a9782346dccd8 Liam Girdwood        2015-05-29  1466    template.off_val = 
w->invert ? 1 : 0;
5aebe7c7f9c20e Pierre-Louis Bossart 2019-04-04  1467    template.ignore_suspend 
= le32_to_cpu(w->ignore_suspend);
5aebe7c7f9c20e Pierre-Louis Bossart 2019-04-04  1468    template.event_flags = 
le16_to_cpu(w->event_flags);
8a9782346dccd8 Liam Girdwood        2015-05-29  1469    template.dobj.index = 
tplg->index;
8a9782346dccd8 Liam Girdwood        2015-05-29  1470  
8a9782346dccd8 Liam Girdwood        2015-05-29  1471    tplg->pos +=
5aebe7c7f9c20e Pierre-Louis Bossart 2019-04-04  1472            (sizeof(struct 
snd_soc_tplg_dapm_widget) +
5aebe7c7f9c20e Pierre-Louis Bossart 2019-04-04  1473             
le32_to_cpu(w->priv.size));
5aebe7c7f9c20e Pierre-Louis Bossart 2019-04-04  1474  
8a9782346dccd8 Liam Girdwood        2015-05-29  1475    if (w->num_kcontrols == 
0) {
8a9782346dccd8 Liam Girdwood        2015-05-29  1476            
template.num_kcontrols = 0;
8a9782346dccd8 Liam Girdwood        2015-05-29  1477            goto widget;
8a9782346dccd8 Liam Girdwood        2015-05-29  1478    }
8a9782346dccd8 Liam Girdwood        2015-05-29  1479  
8a9782346dccd8 Liam Girdwood        2015-05-29 @1480    control_hdr = (struct 
snd_soc_tplg_ctl_hdr *)tplg->pos;
8a9782346dccd8 Liam Girdwood        2015-05-29  1481  
434aeb3af21570 Jaska Uimonen        2020-09-08  1482    template.num_kcontrols 
= le32_to_cpu(w->num_kcontrols);
d29d41e28eea65 Jaska Uimonen        2021-05-07  1483    kc = 
devm_kcalloc(tplg->dev, le32_to_cpu(w->num_kcontrols), sizeof(*kc), GFP_KERNEL);
434aeb3af21570 Jaska Uimonen        2020-09-08  1484    if (!kc)
434aeb3af21570 Jaska Uimonen        2020-09-08  1485            goto err;
434aeb3af21570 Jaska Uimonen        2020-09-08  1486  
d29d41e28eea65 Jaska Uimonen        2021-05-07  1487    kcontrol_type = 
devm_kcalloc(tplg->dev, le32_to_cpu(w->num_kcontrols), sizeof(unsigned int),
d29d41e28eea65 Jaska Uimonen        2021-05-07  1488                            
     GFP_KERNEL);
434aeb3af21570 Jaska Uimonen        2020-09-08  1489    if (!kcontrol_type)
434aeb3af21570 Jaska Uimonen        2020-09-08  1490            goto err;
434aeb3af21570 Jaska Uimonen        2020-09-08  1491  
434aeb3af21570 Jaska Uimonen        2020-09-08  1492    for (i = 0; i < 
w->num_kcontrols; i++) {
434aeb3af21570 Jaska Uimonen        2020-09-08  1493            control_hdr = 
(struct snd_soc_tplg_ctl_hdr *)tplg->pos;
5aebe7c7f9c20e Pierre-Louis Bossart 2019-04-04  1494            switch 
(le32_to_cpu(control_hdr->ops.info)) {
8a9782346dccd8 Liam Girdwood        2015-05-29  1495            case 
SND_SOC_TPLG_CTL_VOLSW:
8a9782346dccd8 Liam Girdwood        2015-05-29  1496            case 
SND_SOC_TPLG_CTL_STROBE:
8a9782346dccd8 Liam Girdwood        2015-05-29  1497            case 
SND_SOC_TPLG_CTL_VOLSW_SX:
8a9782346dccd8 Liam Girdwood        2015-05-29  1498            case 
SND_SOC_TPLG_CTL_VOLSW_XR_SX:
8a9782346dccd8 Liam Girdwood        2015-05-29  1499            case 
SND_SOC_TPLG_CTL_RANGE:
8a9782346dccd8 Liam Girdwood        2015-05-29  1500            case 
SND_SOC_TPLG_DAPM_CTL_VOLSW:
434aeb3af21570 Jaska Uimonen        2020-09-08  1501                    /* 
volume mixer */
434aeb3af21570 Jaska Uimonen        2020-09-08  1502                    
kc[i].index = mixer_count;
434aeb3af21570 Jaska Uimonen        2020-09-08  1503                    
kcontrol_type[i] = SND_SOC_TPLG_TYPE_MIXER;
434aeb3af21570 Jaska Uimonen        2020-09-08  1504                    
mixer_count++;
434aeb3af21570 Jaska Uimonen        2020-09-08  1505                    ret = 
soc_tplg_dapm_widget_dmixer_create(tplg, &kc[i]);
434aeb3af21570 Jaska Uimonen        2020-09-08  1506                    if (ret 
< 0)
8a9782346dccd8 Liam Girdwood        2015-05-29  1507                            
goto hdr_err;
8a9782346dccd8 Liam Girdwood        2015-05-29  1508                    break;
8a9782346dccd8 Liam Girdwood        2015-05-29  1509            case 
SND_SOC_TPLG_CTL_ENUM:
8a9782346dccd8 Liam Girdwood        2015-05-29  1510            case 
SND_SOC_TPLG_CTL_ENUM_VALUE:
8a9782346dccd8 Liam Girdwood        2015-05-29  1511            case 
SND_SOC_TPLG_DAPM_CTL_ENUM_DOUBLE:
8a9782346dccd8 Liam Girdwood        2015-05-29  1512            case 
SND_SOC_TPLG_DAPM_CTL_ENUM_VIRT:
8a9782346dccd8 Liam Girdwood        2015-05-29  1513            case 
SND_SOC_TPLG_DAPM_CTL_ENUM_VALUE:
434aeb3af21570 Jaska Uimonen        2020-09-08  1514                    /* 
enumerated mixer */
434aeb3af21570 Jaska Uimonen        2020-09-08  1515                    
kc[i].index = enum_count;
434aeb3af21570 Jaska Uimonen        2020-09-08  1516                    
kcontrol_type[i] = SND_SOC_TPLG_TYPE_ENUM;
434aeb3af21570 Jaska Uimonen        2020-09-08  1517                    
enum_count++;
434aeb3af21570 Jaska Uimonen        2020-09-08  1518                    ret = 
soc_tplg_dapm_widget_denum_create(tplg, &kc[i]);
434aeb3af21570 Jaska Uimonen        2020-09-08  1519                    if (ret 
< 0)
8a9782346dccd8 Liam Girdwood        2015-05-29  1520                            
goto hdr_err;
8a9782346dccd8 Liam Girdwood        2015-05-29  1521                    break;
8a9782346dccd8 Liam Girdwood        2015-05-29  1522            case 
SND_SOC_TPLG_CTL_BYTES:
434aeb3af21570 Jaska Uimonen        2020-09-08  1523                    /* 
bytes control */
434aeb3af21570 Jaska Uimonen        2020-09-08  1524                    
kc[i].index = bytes_count;
434aeb3af21570 Jaska Uimonen        2020-09-08  1525                    
kcontrol_type[i] = SND_SOC_TPLG_TYPE_BYTES;
434aeb3af21570 Jaska Uimonen        2020-09-08  1526                    
bytes_count++;
434aeb3af21570 Jaska Uimonen        2020-09-08  1527                    ret = 
soc_tplg_dapm_widget_dbytes_create(tplg, &kc[i]);
434aeb3af21570 Jaska Uimonen        2020-09-08  1528                    if (ret 
< 0)
8a9782346dccd8 Liam Girdwood        2015-05-29  1529                            
goto hdr_err;
8a9782346dccd8 Liam Girdwood        2015-05-29  1530                    break;
8a9782346dccd8 Liam Girdwood        2015-05-29  1531            default:
8a9782346dccd8 Liam Girdwood        2015-05-29  1532                    
dev_err(tplg->dev, "ASoC: invalid widget control type %d:%d:%d\n",
8a9782346dccd8 Liam Girdwood        2015-05-29  1533                            
control_hdr->ops.get, control_hdr->ops.put,
5aebe7c7f9c20e Pierre-Louis Bossart 2019-04-04  1534                            
le32_to_cpu(control_hdr->ops.info));
8a9782346dccd8 Liam Girdwood        2015-05-29  1535                    ret = 
-EINVAL;
8a9782346dccd8 Liam Girdwood        2015-05-29  1536                    goto 
hdr_err;
8a9782346dccd8 Liam Girdwood        2015-05-29  1537            }
434aeb3af21570 Jaska Uimonen        2020-09-08  1538    }
434aeb3af21570 Jaska Uimonen        2020-09-08  1539  
434aeb3af21570 Jaska Uimonen        2020-09-08  1540    template.kcontrol_news 
= kc;
7c60d066345304 Peter Ujfalusi       2021-06-11  1541    dev_dbg(tplg->dev, 
"ASoC: template %s with %d/%d/%d (mixer/enum/bytes) control\n",
7c60d066345304 Peter Ujfalusi       2021-06-11  1542            w->name, 
mixer_count, enum_count, bytes_count);
8a9782346dccd8 Liam Girdwood        2015-05-29  1543  
8a9782346dccd8 Liam Girdwood        2015-05-29  1544  widget:
8a9782346dccd8 Liam Girdwood        2015-05-29  1545    ret = 
soc_tplg_widget_load(tplg, &template, w);
8a9782346dccd8 Liam Girdwood        2015-05-29  1546    if (ret < 0)
8a9782346dccd8 Liam Girdwood        2015-05-29  1547            goto hdr_err;
8a9782346dccd8 Liam Girdwood        2015-05-29  1548  
8a9782346dccd8 Liam Girdwood        2015-05-29  1549    /* card dapm mutex is 
held by the core if we are loading topology
8a9782346dccd8 Liam Girdwood        2015-05-29  1550     * data during sound 
card init. */
8a9782346dccd8 Liam Girdwood        2015-05-29  1551    if (card->instantiated)
8a9782346dccd8 Liam Girdwood        2015-05-29  1552            widget = 
snd_soc_dapm_new_control(dapm, &template);
8a9782346dccd8 Liam Girdwood        2015-05-29  1553    else
8a9782346dccd8 Liam Girdwood        2015-05-29  1554            widget = 
snd_soc_dapm_new_control_unlocked(dapm, &template);
37e1df8c95e2c8 Linus Walleij        2017-01-13  1555    if (IS_ERR(widget)) {
37e1df8c95e2c8 Linus Walleij        2017-01-13  1556            ret = 
PTR_ERR(widget);
8a9782346dccd8 Liam Girdwood        2015-05-29  1557            goto hdr_err;
8a9782346dccd8 Liam Girdwood        2015-05-29  1558    }
8a9782346dccd8 Liam Girdwood        2015-05-29  1559  
8a9782346dccd8 Liam Girdwood        2015-05-29  1560    widget->dobj.type = 
SND_SOC_DOBJ_WIDGET;
eea3dd4f1247aa Mengdong Lin         2016-11-25  1561    
widget->dobj.widget.kcontrol_type = kcontrol_type;
8a9782346dccd8 Liam Girdwood        2015-05-29  1562    widget->dobj.ops = 
tplg->ops;
8a9782346dccd8 Liam Girdwood        2015-05-29  1563    widget->dobj.index = 
tplg->index;
8a9782346dccd8 Liam Girdwood        2015-05-29  1564    
list_add(&widget->dobj.list, &tplg->comp->dobj_list);
ebd259d33a900b Liam Girdwood        2017-06-09  1565  
ebd259d33a900b Liam Girdwood        2017-06-09  1566    ret = 
soc_tplg_widget_ready(tplg, widget, w);
ebd259d33a900b Liam Girdwood        2017-06-09  1567    if (ret < 0)
ebd259d33a900b Liam Girdwood        2017-06-09  1568            goto ready_err;
ebd259d33a900b Liam Girdwood        2017-06-09  1569  
7620fe9161cec2 Bard liao            2019-01-25  1570    kfree(template.sname);
7620fe9161cec2 Bard liao            2019-01-25  1571    kfree(template.name);
7620fe9161cec2 Bard liao            2019-01-25  1572  
8a9782346dccd8 Liam Girdwood        2015-05-29  1573    return 0;
8a9782346dccd8 Liam Girdwood        2015-05-29  1574  
ebd259d33a900b Liam Girdwood        2017-06-09  1575  ready_err:
841fb1096713bd Amadeusz Sławiński   2020-10-30  1576    
remove_widget(widget->dapm->component, &widget->dobj, SOC_TPLG_PASS_WIDGET);
ebd259d33a900b Liam Girdwood        2017-06-09  1577    
snd_soc_dapm_free_widget(widget);
8a9782346dccd8 Liam Girdwood        2015-05-29  1578  hdr_err:
8a9782346dccd8 Liam Girdwood        2015-05-29  1579    kfree(template.sname);
8a9782346dccd8 Liam Girdwood        2015-05-29  1580  err:
8a9782346dccd8 Liam Girdwood        2015-05-29  1581    kfree(template.name);
8a9782346dccd8 Liam Girdwood        2015-05-29  1582    return ret;
8a9782346dccd8 Liam Girdwood        2015-05-29  1583  }
8a9782346dccd8 Liam Girdwood        2015-05-29  1584  

:::::: The code at line 1480 was first introduced by commit
:::::: 8a9782346dccd82cf912552735bda619de4efd8c ASoC: topology: Add topology 
core

:::::: TO: Liam Girdwood <[email protected]>
:::::: CC: Mark Brown <[email protected]>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to