[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <c206cc39-27ad-4a4d-8703-220dc0bf7dab@moroto.mountain>
Date: Tue, 2 Apr 2024 17:35:40 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: oe-kbuild@...ts.linux.dev, Shenghao Ding <shenghao-ding@...com>,
linux-kernel@...r.kernel.org
Cc: lkp@...el.com, oe-kbuild-all@...ts.linux.dev, lgirdwood@...il.com,
broonie@...nel.org, robh+dt@...nel.org,
krzysztof.kozlowski+dt@...aro.org, conor+dt@...nel.org,
linux-sound@...r.kernel.org, devicetree@...r.kernel.org,
perex@...ex.cz, tiwai@...e.com, 13916275206@....com,
mohit.chawla@...com, soyer@....hu, jkhuang3@...com, tiwai@...e.de,
pdjuandi@...com, manisha.agrawal@...com, s-hari@...com,
aviel@...com, hnagalla@...com, praneeth@...com, Baojun.Xu@....com,
Shenghao Ding <shenghao-ding@...com>
Subject: Re: [PATCH v7 3/4] ASoc: PCM6240: Add compile item for PCM6240
Family driver
Hi Shenghao,
kernel test robot noticed the following build warnings:
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Shenghao-Ding/ASoc-PCM6240-Create-PCM6240-Family-driver-code/20240331-102303
base: v6.9-rc1
patch link: https://lore.kernel.org/r/20240331021835.1470-4-shenghao-ding%40ti.com
patch subject: [PATCH v7 3/4] ASoc: PCM6240: Add compile item for PCM6240 Family driver
config: um-randconfig-r081-20240402 (https://download.01.org/0day-ci/archive/20240402/202404021225.mx5KlUlV-lkp@intel.com/config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
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 <lkp@...el.com>
| Reported-by: Dan Carpenter <dan.carpenter@...aro.org>
| Closes: https://lore.kernel.org/r/202404021225.mx5KlUlV-lkp@intel.com/
smatch warnings:
sound/soc/codecs/pcm6240.c:1715 pcmdevice_process_block() warn: inconsistent indenting
vim +/fw_entry +1577 sound/soc/codecs/pcm6240.c
051d749b6eaeb0 Shenghao Ding 2024-03-31 1619 static int pcmdevice_process_block(void *ctxt, unsigned char *data,
051d749b6eaeb0 Shenghao Ding 2024-03-31 1620 unsigned char dev_idx, int sublocksize)
051d749b6eaeb0 Shenghao Ding 2024-03-31 1621 {
051d749b6eaeb0 Shenghao Ding 2024-03-31 1622 struct pcmdevice_priv *pcm_dev = (struct pcmdevice_priv *)ctxt;
051d749b6eaeb0 Shenghao Ding 2024-03-31 1623 int subblk_offset = 2, chn, chnend, ret;
051d749b6eaeb0 Shenghao Ding 2024-03-31 1624 unsigned char subblk_typ = data[1];
051d749b6eaeb0 Shenghao Ding 2024-03-31 1625
051d749b6eaeb0 Shenghao Ding 2024-03-31 1626 if (dev_idx) {
051d749b6eaeb0 Shenghao Ding 2024-03-31 1627 chn = dev_idx - 1;
051d749b6eaeb0 Shenghao Ding 2024-03-31 1628 chnend = dev_idx;
051d749b6eaeb0 Shenghao Ding 2024-03-31 1629 } else {
051d749b6eaeb0 Shenghao Ding 2024-03-31 1630 chn = 0;
051d749b6eaeb0 Shenghao Ding 2024-03-31 1631 chnend = pcm_dev->ndev;
051d749b6eaeb0 Shenghao Ding 2024-03-31 1632 }
051d749b6eaeb0 Shenghao Ding 2024-03-31 1633
051d749b6eaeb0 Shenghao Ding 2024-03-31 1634 for (; chn < chnend; chn++) {
051d749b6eaeb0 Shenghao Ding 2024-03-31 1635 switch (subblk_typ) {
051d749b6eaeb0 Shenghao Ding 2024-03-31 1636 case PCMDEVICE_CMD_SING_W: {
051d749b6eaeb0 Shenghao Ding 2024-03-31 1637 unsigned short len = get_unaligned_be16(&data[2]);
051d749b6eaeb0 Shenghao Ding 2024-03-31 1638 int i = 0;
051d749b6eaeb0 Shenghao Ding 2024-03-31 1639
051d749b6eaeb0 Shenghao Ding 2024-03-31 1640 subblk_offset += 2;
051d749b6eaeb0 Shenghao Ding 2024-03-31 1641 if (subblk_offset + 4 * len > sublocksize) {
051d749b6eaeb0 Shenghao Ding 2024-03-31 1642 dev_err(pcm_dev->dev,
051d749b6eaeb0 Shenghao Ding 2024-03-31 1643 "%s: byt wr out of boundary\n",
051d749b6eaeb0 Shenghao Ding 2024-03-31 1644 __func__);
051d749b6eaeb0 Shenghao Ding 2024-03-31 1645 break;
051d749b6eaeb0 Shenghao Ding 2024-03-31 1646 }
051d749b6eaeb0 Shenghao Ding 2024-03-31 1647
051d749b6eaeb0 Shenghao Ding 2024-03-31 1648 for (i = 0; i < len; i++) {
051d749b6eaeb0 Shenghao Ding 2024-03-31 1649 ret = pcmdev_dev_write(pcm_dev, chn,
051d749b6eaeb0 Shenghao Ding 2024-03-31 1650 PCMDEVICE_REG(data[subblk_offset + 1],
051d749b6eaeb0 Shenghao Ding 2024-03-31 1651 data[subblk_offset + 2]),
051d749b6eaeb0 Shenghao Ding 2024-03-31 1652 data[subblk_offset + 3]);
051d749b6eaeb0 Shenghao Ding 2024-03-31 1653 if (ret < 0)
051d749b6eaeb0 Shenghao Ding 2024-03-31 1654 dev_err(pcm_dev->dev,
051d749b6eaeb0 Shenghao Ding 2024-03-31 1655 "%s: single write error\n",
051d749b6eaeb0 Shenghao Ding 2024-03-31 1656 __func__);
051d749b6eaeb0 Shenghao Ding 2024-03-31 1657
051d749b6eaeb0 Shenghao Ding 2024-03-31 1658 subblk_offset += 4;
051d749b6eaeb0 Shenghao Ding 2024-03-31 1659 }
051d749b6eaeb0 Shenghao Ding 2024-03-31 1660 }
051d749b6eaeb0 Shenghao Ding 2024-03-31 1661 break;
051d749b6eaeb0 Shenghao Ding 2024-03-31 1662 case PCMDEVICE_CMD_BURST: {
051d749b6eaeb0 Shenghao Ding 2024-03-31 1663 unsigned short len = get_unaligned_be16(&data[2]);
051d749b6eaeb0 Shenghao Ding 2024-03-31 1664
051d749b6eaeb0 Shenghao Ding 2024-03-31 1665 subblk_offset += 2;
051d749b6eaeb0 Shenghao Ding 2024-03-31 1666 if (subblk_offset + 4 + len > sublocksize) {
051d749b6eaeb0 Shenghao Ding 2024-03-31 1667 dev_err(pcm_dev->dev,
051d749b6eaeb0 Shenghao Ding 2024-03-31 1668 "%s: burst Out of boundary\n",
051d749b6eaeb0 Shenghao Ding 2024-03-31 1669 __func__);
051d749b6eaeb0 Shenghao Ding 2024-03-31 1670 break;
051d749b6eaeb0 Shenghao Ding 2024-03-31 1671 }
051d749b6eaeb0 Shenghao Ding 2024-03-31 1672 if (len % 4) {
051d749b6eaeb0 Shenghao Ding 2024-03-31 1673 dev_err(pcm_dev->dev,
051d749b6eaeb0 Shenghao Ding 2024-03-31 1674 "%s: burst-len(%u) not div by 4\n",
051d749b6eaeb0 Shenghao Ding 2024-03-31 1675 __func__, len);
051d749b6eaeb0 Shenghao Ding 2024-03-31 1676 break;
051d749b6eaeb0 Shenghao Ding 2024-03-31 1677 }
051d749b6eaeb0 Shenghao Ding 2024-03-31 1678 ret = pcmdev_dev_bulk_write(pcm_dev, chn,
051d749b6eaeb0 Shenghao Ding 2024-03-31 1679 PCMDEVICE_REG(data[subblk_offset + 1],
051d749b6eaeb0 Shenghao Ding 2024-03-31 1680 data[subblk_offset + 2]),
051d749b6eaeb0 Shenghao Ding 2024-03-31 1681 &(data[subblk_offset + 4]), len);
051d749b6eaeb0 Shenghao Ding 2024-03-31 1682 if (ret < 0)
051d749b6eaeb0 Shenghao Ding 2024-03-31 1683 dev_err(pcm_dev->dev,
051d749b6eaeb0 Shenghao Ding 2024-03-31 1684 "%s: bulk_write err = %d\n",
051d749b6eaeb0 Shenghao Ding 2024-03-31 1685 __func__, ret);
051d749b6eaeb0 Shenghao Ding 2024-03-31 1686
051d749b6eaeb0 Shenghao Ding 2024-03-31 1687 subblk_offset += (len + 4);
051d749b6eaeb0 Shenghao Ding 2024-03-31 1688 }
051d749b6eaeb0 Shenghao Ding 2024-03-31 1689 break;
051d749b6eaeb0 Shenghao Ding 2024-03-31 1690 case PCMDEVICE_CMD_DELAY: {
051d749b6eaeb0 Shenghao Ding 2024-03-31 1691 unsigned int delay_time = 0;
051d749b6eaeb0 Shenghao Ding 2024-03-31 1692
051d749b6eaeb0 Shenghao Ding 2024-03-31 1693 if (subblk_offset + 2 > sublocksize) {
051d749b6eaeb0 Shenghao Ding 2024-03-31 1694 dev_err(pcm_dev->dev,
051d749b6eaeb0 Shenghao Ding 2024-03-31 1695 "%s: deley out of boundary\n",
051d749b6eaeb0 Shenghao Ding 2024-03-31 1696 __func__);
051d749b6eaeb0 Shenghao Ding 2024-03-31 1697 break;
051d749b6eaeb0 Shenghao Ding 2024-03-31 1698 }
051d749b6eaeb0 Shenghao Ding 2024-03-31 1699 delay_time = get_unaligned_be16(&data[2]) * 1000;
051d749b6eaeb0 Shenghao Ding 2024-03-31 1700 usleep_range(delay_time, delay_time + 50);
051d749b6eaeb0 Shenghao Ding 2024-03-31 1701 subblk_offset += 2;
051d749b6eaeb0 Shenghao Ding 2024-03-31 1702 }
051d749b6eaeb0 Shenghao Ding 2024-03-31 1703 break;
051d749b6eaeb0 Shenghao Ding 2024-03-31 1704 case PCMDEVICE_CMD_FIELD_W:
051d749b6eaeb0 Shenghao Ding 2024-03-31 1705 if (subblk_offset + 6 > sublocksize) {
051d749b6eaeb0 Shenghao Ding 2024-03-31 1706 dev_err(pcm_dev->dev,
051d749b6eaeb0 Shenghao Ding 2024-03-31 1707 "%s: bit write out of memory\n", __func__);
051d749b6eaeb0 Shenghao Ding 2024-03-31 1708 break;
051d749b6eaeb0 Shenghao Ding 2024-03-31 1709 }
051d749b6eaeb0 Shenghao Ding 2024-03-31 1710 ret = pcmdev_dev_update_bits(pcm_dev, chn,
051d749b6eaeb0 Shenghao Ding 2024-03-31 1711 PCMDEVICE_REG(data[subblk_offset + 3],
051d749b6eaeb0 Shenghao Ding 2024-03-31 1712 data[subblk_offset + 4]),
051d749b6eaeb0 Shenghao Ding 2024-03-31 1713 data[subblk_offset + 1],
051d749b6eaeb0 Shenghao Ding 2024-03-31 1714 data[subblk_offset + 5]);
This line is indented too far.
051d749b6eaeb0 Shenghao Ding 2024-03-31 @1715 if (ret < 0)
051d749b6eaeb0 Shenghao Ding 2024-03-31 1716 dev_err(pcm_dev->dev, "%s: update_bits err = %d\n",
051d749b6eaeb0 Shenghao Ding 2024-03-31 1717 __func__, ret);
051d749b6eaeb0 Shenghao Ding 2024-03-31 1718
051d749b6eaeb0 Shenghao Ding 2024-03-31 1719 subblk_offset += 6;
051d749b6eaeb0 Shenghao Ding 2024-03-31 1720 break;
051d749b6eaeb0 Shenghao Ding 2024-03-31 1721 default:
051d749b6eaeb0 Shenghao Ding 2024-03-31 1722 break;
051d749b6eaeb0 Shenghao Ding 2024-03-31 1723 }
051d749b6eaeb0 Shenghao Ding 2024-03-31 1724 }
051d749b6eaeb0 Shenghao Ding 2024-03-31 1725
051d749b6eaeb0 Shenghao Ding 2024-03-31 1726 return subblk_offset;
051d749b6eaeb0 Shenghao Ding 2024-03-31 1727 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists