Re: [PATCH v1] ASoC: tas2781: Add calibration kcontrols for TAS2573

kernel test robot <[email protected]>
Newsgroups gmane.linux.alsa.devel
Message-ID <[email protected]>
Hi Shenghao,

kernel test robot noticed the following build errors:

[auto build test ERROR on v7.2-rc4]
[also build test ERROR on linus/master next-20260805]
[cannot apply to broonie-sound/for-next tiwai-sound/for-next tiwai-sound/for-linus v7.2-rc6 v7.2-rc5]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Shenghao-Ding/ASoC-tas2781-Add-calibration-kcontrols-for-TAS2573/20260805-132520
base:   v7.2-rc4
patch link:    https://lore.kernel.org/r/20260717073927.181-1-shenghao-ding%40ti.com
patch subject: [PATCH v1] ASoC: tas2781: Add calibration kcontrols for TAS2573
config: s390-randconfig-002-20260806 (https://download.01.org/0day-ci/archive/20260806/[email protected]/config)
compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project bacfe2950f8218268fcc0a8765644ea0c15f0360)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260806/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

>> sound/soc/codecs/tas2781-i2c.c:1774:3: error: cannot jump from this goto statement to its label
    1774 |                 goto exit;
         |                 ^
   sound/soc/codecs/tas2781-i2c.c:1779:2: note: jump bypasses initialization of variable with __attribute__((cleanup))
    1779 |         guard(mutex)(&priv->codec_lock);
         |         ^
   include/linux/cleanup.h:423:2: note: expanded from macro 'guard'
     423 |         CLASS(_name, __UNIQUE_ID(guard))
         |         ^
   include/linux/cleanup.h:303:3: note: expanded from macro 'CLASS'
     303 |                 class_##_name##_constructor
         |                 ^
   <scratch space>:102:1: note: expanded from here
     102 | class_mutex_constructor
         | ^
   note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/compiler_types.h:16:23: note: expanded from macro '__PASTE'
      16 | #define __PASTE(a, b) ___PASTE(a, b)
         |                       ^
   include/linux/compiler_types.h:15:24: note: expanded from macro '___PASTE'
      15 | #define ___PASTE(a, b) a##b
         |                        ^
   <scratch space>:108:1: note: expanded from here
     108 | __UNIQUE_ID_unlock_565
         | ^
   sound/soc/codecs/tas2781-i2c.c:1779:2: note: jump bypasses initialization of variable with __attribute__((cleanup))
   include/linux/cleanup.h:423:15: note: expanded from macro 'guard'
     423 |         CLASS(_name, __UNIQUE_ID(guard))
         |                      ^
   include/linux/compiler.h:165:2: note: expanded from macro '__UNIQUE_ID'
     165 |         __PASTE(__UNIQUE_ID_,                                   \
         |         ^
   include/linux/compiler_types.h:16:23: note: expanded from macro '__PASTE'
      16 | #define __PASTE(a, b) ___PASTE(a, b)
         |                       ^
   include/linux/compiler_types.h:15:24: note: expanded from macro '___PASTE'
      15 | #define ___PASTE(a, b) a##b
         |                        ^
   <scratch space>:96:1: note: expanded from here
      96 | __UNIQUE_ID_guard_564
         | ^
   sound/soc/codecs/tas2781-i2c.c:1763:3: error: cannot jump from this goto statement to its label
    1763 |                 goto exit;
         |                 ^
   sound/soc/codecs/tas2781-i2c.c:1779:2: note: jump bypasses initialization of variable with __attribute__((cleanup))
    1779 |         guard(mutex)(&priv->codec_lock);
         |         ^
   include/linux/cleanup.h:423:2: note: expanded from macro 'guard'
     423 |         CLASS(_name, __UNIQUE_ID(guard))
         |         ^
   include/linux/cleanup.h:303:3: note: expanded from macro 'CLASS'
     303 |                 class_##_name##_constructor
         |                 ^
   <scratch space>:102:1: note: expanded from here
     102 | class_mutex_constructor
         | ^
   note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/compiler_types.h:16:23: note: expanded from macro '__PASTE'
      16 | #define __PASTE(a, b) ___PASTE(a, b)
         |                       ^
   include/linux/compiler_types.h:15:24: note: expanded from macro '___PASTE'
      15 | #define ___PASTE(a, b) a##b
         |                        ^
   <scratch space>:108:1: note: expanded from here
     108 | __UNIQUE_ID_unlock_565
         | ^
   sound/soc/codecs/tas2781-i2c.c:1779:2: note: jump bypasses initialization of variable with __attribute__((cleanup))
   include/linux/cleanup.h:423:15: note: expanded from macro 'guard'
     423 |         CLASS(_name, __UNIQUE_ID(guard))
         |                      ^
   include/linux/compiler.h:165:2: note: expanded from macro '__UNIQUE_ID'
     165 |         __PASTE(__UNIQUE_ID_,                                   \
         |         ^
   include/linux/compiler_types.h:16:23: note: expanded from macro '__PASTE'
      16 | #define __PASTE(a, b) ___PASTE(a, b)
         |                       ^
   include/linux/compiler_types.h:15:24: note: expanded from macro '___PASTE'
      15 | #define ___PASTE(a, b) a##b
         |                        ^
   <scratch space>:96:1: note: expanded from here
      96 | __UNIQUE_ID_guard_564
         | ^
   sound/soc/codecs/tas2781-i2c.c:1757:3: error: cannot jump from this goto statement to its label
    1757 |                 goto exit;
         |                 ^
   sound/soc/codecs/tas2781-i2c.c:1779:2: note: jump bypasses initialization of variable with __attribute__((cleanup))
    1779 |         guard(mutex)(&priv->codec_lock);
         |         ^
   include/linux/cleanup.h:423:2: note: expanded from macro 'guard'
     423 |         CLASS(_name, __UNIQUE_ID(guard))
         |         ^
   include/linux/cleanup.h:303:3: note: expanded from macro 'CLASS'
     303 |                 class_##_name##_constructor
         |                 ^
   <scratch space>:102:1: note: expanded from here
     102 | class_mutex_constructor
         | ^
   note: (skipping 3 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/compiler_types.h:16:23: note: expanded from macro '__PASTE'
      16 | #define __PASTE(a, b) ___PASTE(a, b)
         |                       ^


vim +1774 sound/soc/codecs/tas2781-i2c.c

d75d38dc460452c Shenghao Ding  2025-05-07  1715  
d75d38dc460452c Shenghao Ding  2025-05-07  1716  static ssize_t acoustic_ctl_write(struct file *file,
d75d38dc460452c Shenghao Ding  2025-05-07  1717  	const char __user *from, size_t count, loff_t *ppos)
d75d38dc460452c Shenghao Ding  2025-05-07  1718  {
d75d38dc460452c Shenghao Ding  2025-05-07  1719  	struct snd_soc_component *comp = file->private_data;
d75d38dc460452c Shenghao Ding  2025-05-07  1720  	struct tasdevice_priv *priv = snd_soc_component_get_drvdata(comp);
d75d38dc460452c Shenghao Ding  2025-05-07  1721  	struct acoustic_data *p = &priv->acou_data;
d75d38dc460452c Shenghao Ding  2025-05-07  1722  	unsigned int max_pkg_len = sizeof(*p);
d75d38dc460452c Shenghao Ding  2025-05-07  1723  	unsigned char *src;
d75d38dc460452c Shenghao Ding  2025-05-07  1724  	int j, len, reg, val;
d75d38dc460452c Shenghao Ding  2025-05-07  1725  	unsigned short chn;
d75d38dc460452c Shenghao Ding  2025-05-07  1726  	int ret = -1;
d75d38dc460452c Shenghao Ding  2025-05-07  1727  
d75d38dc460452c Shenghao Ding  2025-05-07  1728  	if (count > sizeof(*p)) {
d75d38dc460452c Shenghao Ding  2025-05-07  1729  		dev_err(priv->dev, "count(%u) is larger than max(%u).\n",
d75d38dc460452c Shenghao Ding  2025-05-07  1730  			(unsigned int)count, max_pkg_len);
d75d38dc460452c Shenghao Ding  2025-05-07  1731  		return ret;
d75d38dc460452c Shenghao Ding  2025-05-07  1732  	}
d75d38dc460452c Shenghao Ding  2025-05-07  1733  
d75d38dc460452c Shenghao Ding  2025-05-07  1734  	src = memdup_user(from, count);
d75d38dc460452c Shenghao Ding  2025-05-07  1735  	if (IS_ERR(src))
d75d38dc460452c Shenghao Ding  2025-05-07  1736  		return PTR_ERR(src);
d75d38dc460452c Shenghao Ding  2025-05-07  1737  
d75d38dc460452c Shenghao Ding  2025-05-07  1738  	if (src[0] > max_pkg_len && src[0] != count) {
b11f2a9745401d9 Colin Ian King 2025-08-08  1739  		dev_err(priv->dev, "pkg(%u), max(%u), count(%u) mismatch.\n",
d75d38dc460452c Shenghao Ding  2025-05-07  1740  			src[0], max_pkg_len, (unsigned int)count);
d75d38dc460452c Shenghao Ding  2025-05-07  1741  		ret = 0;
d75d38dc460452c Shenghao Ding  2025-05-07  1742  		goto exit;
d75d38dc460452c Shenghao Ding  2025-05-07  1743  	}
d75d38dc460452c Shenghao Ding  2025-05-07  1744  
d75d38dc460452c Shenghao Ding  2025-05-07  1745  	switch (src[1]) {
d75d38dc460452c Shenghao Ding  2025-05-07  1746  	case 'r':
d75d38dc460452c Shenghao Ding  2025-05-07  1747  		/* length of data to read */
d75d38dc460452c Shenghao Ding  2025-05-07  1748  		len = src[6];
d75d38dc460452c Shenghao Ding  2025-05-07  1749  		break;
d75d38dc460452c Shenghao Ding  2025-05-07  1750  	case 'w':
d75d38dc460452c Shenghao Ding  2025-05-07  1751  		/* Skip 6 bytes for package type and register address */
d75d38dc460452c Shenghao Ding  2025-05-07  1752  		len = src[0] - 6;
d75d38dc460452c Shenghao Ding  2025-05-07  1753  		break;
d75d38dc460452c Shenghao Ding  2025-05-07  1754  	default:
d75d38dc460452c Shenghao Ding  2025-05-07  1755  		dev_err(priv->dev, "%s Wrong code %02x.\n", __func__, src[1]);
d75d38dc460452c Shenghao Ding  2025-05-07  1756  		ret = 0;
d75d38dc460452c Shenghao Ding  2025-05-07  1757  		goto exit;
d75d38dc460452c Shenghao Ding  2025-05-07  1758  	}
d75d38dc460452c Shenghao Ding  2025-05-07  1759  
d75d38dc460452c Shenghao Ding  2025-05-07  1760  	if (len < 1) {
d75d38dc460452c Shenghao Ding  2025-05-07  1761  		dev_err(priv->dev, "pkg fmt invalid %02x.\n", len);
d75d38dc460452c Shenghao Ding  2025-05-07  1762  		ret = 0;
d75d38dc460452c Shenghao Ding  2025-05-07  1763  		goto exit;
d75d38dc460452c Shenghao Ding  2025-05-07  1764  	}
d75d38dc460452c Shenghao Ding  2025-05-07  1765  
d75d38dc460452c Shenghao Ding  2025-05-07  1766  	for (j = 0; j < priv->ndev; j++)
d75d38dc460452c Shenghao Ding  2025-05-07  1767  		if (src[2] == priv->tasdevice[j].dev_addr) {
d75d38dc460452c Shenghao Ding  2025-05-07  1768  			chn = j;
d75d38dc460452c Shenghao Ding  2025-05-07  1769  			break;
d75d38dc460452c Shenghao Ding  2025-05-07  1770  		}
d75d38dc460452c Shenghao Ding  2025-05-07  1771  	if (j >= priv->ndev) {
d75d38dc460452c Shenghao Ding  2025-05-07  1772  		dev_err(priv->dev, "no such device 0x%02x.\n", src[2]);
d75d38dc460452c Shenghao Ding  2025-05-07  1773  		ret = 0;
d75d38dc460452c Shenghao Ding  2025-05-07 @1774  		goto exit;
d75d38dc460452c Shenghao Ding  2025-05-07  1775  	}
d75d38dc460452c Shenghao Ding  2025-05-07  1776  
d75d38dc460452c Shenghao Ding  2025-05-07  1777  	reg = TASDEVICE_REG(src[3], src[4], src[5]);
d75d38dc460452c Shenghao Ding  2025-05-07  1778  
d75d38dc460452c Shenghao Ding  2025-05-07  1779  	guard(mutex)(&priv->codec_lock);
d75d38dc460452c Shenghao Ding  2025-05-07  1780  
d75d38dc460452c Shenghao Ding  2025-05-07  1781  	if (src[1] == 'w') {
d75d38dc460452c Shenghao Ding  2025-05-07  1782  		if (len > 1)
d75d38dc460452c Shenghao Ding  2025-05-07  1783  			ret = tasdevice_dev_bulk_write(priv, chn, reg,
d75d38dc460452c Shenghao Ding  2025-05-07  1784  				 &src[6], len);
d75d38dc460452c Shenghao Ding  2025-05-07  1785  		else
d75d38dc460452c Shenghao Ding  2025-05-07  1786  			ret = tasdevice_dev_write(priv, chn, reg, src[6]);
d75d38dc460452c Shenghao Ding  2025-05-07  1787  	} else {
d75d38dc460452c Shenghao Ding  2025-05-07  1788  		struct acoustic_data *p = &priv->acou_data;
d75d38dc460452c Shenghao Ding  2025-05-07  1789  
d75d38dc460452c Shenghao Ding  2025-05-07  1790  		memcpy(p, src, 6);
d75d38dc460452c Shenghao Ding  2025-05-07  1791  		if (len > 1) {
d75d38dc460452c Shenghao Ding  2025-05-07  1792  			ret = tasdevice_dev_bulk_read(priv, chn, reg,
d75d38dc460452c Shenghao Ding  2025-05-07  1793  				p->data, len);
d75d38dc460452c Shenghao Ding  2025-05-07  1794  		} else {
d75d38dc460452c Shenghao Ding  2025-05-07  1795  			ret = tasdevice_dev_read(priv, chn, reg, &val);
d75d38dc460452c Shenghao Ding  2025-05-07  1796  			p->data[0] = val;
d75d38dc460452c Shenghao Ding  2025-05-07  1797  		}
d75d38dc460452c Shenghao Ding  2025-05-07  1798  		p->len = len + 6;
d75d38dc460452c Shenghao Ding  2025-05-07  1799  	}
d75d38dc460452c Shenghao Ding  2025-05-07  1800  
d75d38dc460452c Shenghao Ding  2025-05-07  1801  	if (ret)
d75d38dc460452c Shenghao Ding  2025-05-07  1802  		dev_err(priv->dev, "i2c communication error.\n");
d75d38dc460452c Shenghao Ding  2025-05-07  1803  	else
d75d38dc460452c Shenghao Ding  2025-05-07  1804  		ret = count;
d75d38dc460452c Shenghao Ding  2025-05-07  1805  exit:
d75d38dc460452c Shenghao Ding  2025-05-07  1806  	kfree(src);
d75d38dc460452c Shenghao Ding  2025-05-07  1807  	return ret;
d75d38dc460452c Shenghao Ding  2025-05-07  1808  }
d75d38dc460452c Shenghao Ding  2025-05-07  1809  

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.