CC: llvm(a)lists.linux.dev CC: kbuild-all(a)lists.01.org CC: linux-kernel(a)vger.kernel.org TO: Viorel Suman CC: Mark Brown tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 64b4fc45bea6f4faa843d2f97ff51665280efee1 commit: 28564486866fa889b78264360022c94836fa8072 ASoC: fsl_xcvr: Add XCVR ASoC CPU DAI driver date: 10 months ago :::::: branch date: 14 hours ago :::::: commit date: 10 months ago config: arm-randconfig-c002-20210816 (attached as .config) compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 44d0a99a12ec7ead4d2f5ef649ba05b40f6d463d) 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 arm cross compiling tool for clang build # apt-get install binutils-arm-linux-gnueabi # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=28564486866fa889b78264360022c94836fa8072 git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git git fetch --no-tags linus master git checkout 28564486866fa889b78264360022c94836fa8072 # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm clang-analyzer If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot clang-analyzer warnings: (new ones prefixed by >>) 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. 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. 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 (3 in non-user code, 1 with check filters). Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well. 6 warnings generated. Suppressed 6 warnings (6 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. 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. 14 warnings generated. Suppressed 14 warnings (4 in non-user code, 10 with check filters). 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. 9 warnings generated. sound/soc/codecs/cs42l42.c:575:8: warning: Excessive padding in 'struct cs42l42_pll_params' (5 padding bytes, where 1 is optimal). Optimal fields order: sclk, pll_div_frac, mclk_int, mclk_div, mclk_src_sel, sclk_prediv, pll_div_int, pll_mode, pll_divout, pll_cal_ratio, consider reordering the fields or adding explicit padding members [clang-analyzer-optin.performance.Padding] struct cs42l42_pll_params { ~~~~~~~^~~~~~~~~~~~~~~~~~~~ sound/soc/codecs/cs42l42.c:575:8: note: Excessive padding in 'struct cs42l42_pll_params' (5 padding bytes, where 1 is optimal). Optimal fields order: sclk, pll_div_frac, mclk_int, mclk_div, mclk_src_sel, sclk_prediv, pll_div_int, pll_mode, pll_divout, pll_cal_ratio, consider reordering the fields or adding explicit padding members struct cs42l42_pll_params { ~~~~~~~^~~~~~~~~~~~~~~~~~~~ sound/soc/codecs/cs42l42.c:1338:28: warning: Value stored to 'component' during its initialization is never read [clang-analyzer-deadcode.DeadStores] struct snd_soc_component *component = cs42l42->component; ^~~~~~~~~ ~~~~~~~~~~~~~~~~~~ sound/soc/codecs/cs42l42.c:1338:28: note: Value stored to 'component' during its initialization is never read struct snd_soc_component *component = cs42l42->component; ^~~~~~~~~ ~~~~~~~~~~~~~~~~~~ sound/soc/codecs/cs42l42.c:1818:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores] ret = regmap_read(cs42l42->regmap, CS42L42_DEVID_AB, ®); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sound/soc/codecs/cs42l42.c:1818:2: note: Value stored to 'ret' is never read ret = regmap_read(cs42l42->regmap, CS42L42_DEVID_AB, ®); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sound/soc/codecs/cs42l42.c:1821:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores] ret = regmap_read(cs42l42->regmap, CS42L42_DEVID_CD, ®); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sound/soc/codecs/cs42l42.c:1821:2: note: Value stored to 'ret' is never read ret = regmap_read(cs42l42->regmap, CS42L42_DEVID_CD, ®); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sound/soc/codecs/cs42l42.c:1824:2: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores] ret = regmap_read(cs42l42->regmap, CS42L42_DEVID_E, ®); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sound/soc/codecs/cs42l42.c:1824:2: note: Value stored to 'ret' is never read ret = regmap_read(cs42l42->regmap, CS42L42_DEVID_E, ®); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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/fsl/fsl_xcvr.c:1048:17: warning: Value stored to 'dev' during its initialization is never read [clang-analyzer-deadcode.DeadStores] struct device *dev = &xcvr->pdev->dev; ^~~ ~~~~~~~~~~~~~~~~ sound/soc/fsl/fsl_xcvr.c:1048:17: note: Value stored to 'dev' during its initialization is never read struct device *dev = &xcvr->pdev->dev; ^~~ ~~~~~~~~~~~~~~~~ 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. 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. 8 warnings generated. drivers/media/i2c/st-mipid02.c:623:21: warning: Value stored to 'client' during its initialization is never read [clang-analyzer-deadcode.DeadStores] struct i2c_client *client = bridge->i2c_client; ^~~~~~ ~~~~~~~~~~~~~~~~~~ drivers/media/i2c/st-mipid02.c:623:21: note: Value stored to 'client' during its initialization is never read struct i2c_client *client = bridge->i2c_client; ^~~~~~ ~~~~~~~~~~~~~~~~~~ drivers/media/i2c/st-mipid02.c:679:21: warning: Value stored to 'client' during its initialization is never read [clang-analyzer-deadcode.DeadStores] struct i2c_client *client = bridge->i2c_client; ^~~~~~ ~~~~~~~~~~~~~~~~~~ drivers/media/i2c/st-mipid02.c:679:21: note: Value stored to 'client' during its initialization is never read struct i2c_client *client = bridge->i2c_client; ^~~~~~ ~~~~~~~~~~~~~~~~~~ drivers/media/i2c/st-mipid02.c:747:21: warning: Value stored to 'client' during its initialization is never read [clang-analyzer-deadcode.DeadStores] struct i2c_client *client = bridge->i2c_client; ^~~~~~ ~~~~~~~~~~~~~~~~~~ drivers/media/i2c/st-mipid02.c:747:21: note: Value stored to 'client' during its initialization is never read struct i2c_client *client = bridge->i2c_client; ^~~~~~ ~~~~~~~~~~~~~~~~~~ drivers/media/i2c/st-mipid02.c:919:3: warning: Value stored to 'ret' is never read [clang-analyzer-deadcode.DeadStores] ret = -EINVAL; ^ ~~~~~~~ drivers/media/i2c/st-mipid02.c:919:3: note: Value stored to 'ret' is never read ret = -EINVAL; ^ ~~~~~~~ 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. drivers/media/tuners/tuner-xc2028.c:1037:3: warning: Value stored to 'rc' is never read [clang-analyzer-deadcode.DeadStores] rc = send_seq(priv, {0x00, 0x00}); ^ drivers/media/tuners/tuner-xc2028.c:1037:3: note: Value stored to 'rc' is never read 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. 6 warnings generated. kernel/kallsyms.c:369:3: warning: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy] strcpy(buffer, name); ^~~~~~ kernel/kallsyms.c:369:3: note: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 strcpy(buffer, name); ^~~~~~ Suppressed 5 warnings (4 in non-user code, 1 with check filters). 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. 5 warnings generated. drivers/mmc/core/core.c:2010:19: warning: Value stored to 'host' during its initialization is never read [clang-analyzer-deadcode.DeadStores] struct mmc_host *host = card->host; ^~~~ ~~~~~~~~~~ drivers/mmc/core/core.c:2010:19: note: Value stored to 'host' during its initialization is never read vim +/dev +1048 sound/soc/fsl/fsl_xcvr.c 28564486866fa8 Viorel Suman 2020-10-13 1044 28564486866fa8 Viorel Suman 2020-10-13 1045 static irqreturn_t irq0_isr(int irq, void *devid) 28564486866fa8 Viorel Suman 2020-10-13 1046 { 28564486866fa8 Viorel Suman 2020-10-13 1047 struct fsl_xcvr *xcvr = (struct fsl_xcvr *)devid; 28564486866fa8 Viorel Suman 2020-10-13 @1048 struct device *dev = &xcvr->pdev->dev; 28564486866fa8 Viorel Suman 2020-10-13 1049 struct regmap *regmap = xcvr->regmap; 28564486866fa8 Viorel Suman 2020-10-13 1050 void __iomem *reg_ctrl, *reg_buff; 28564486866fa8 Viorel Suman 2020-10-13 1051 u32 isr, isr_clr = 0, val, i; 28564486866fa8 Viorel Suman 2020-10-13 1052 28564486866fa8 Viorel Suman 2020-10-13 1053 regmap_read(regmap, FSL_XCVR_EXT_ISR, &isr); 28564486866fa8 Viorel Suman 2020-10-13 1054 28564486866fa8 Viorel Suman 2020-10-13 1055 if (isr & FSL_XCVR_IRQ_NEW_CS) { 28564486866fa8 Viorel Suman 2020-10-13 1056 dev_dbg(dev, "Received new CS block\n"); 28564486866fa8 Viorel Suman 2020-10-13 1057 isr_clr |= FSL_XCVR_IRQ_NEW_CS; 28564486866fa8 Viorel Suman 2020-10-13 1058 /* Data RAM is 4KiB, last two pages: 8 and 9. Select page 8. */ 28564486866fa8 Viorel Suman 2020-10-13 1059 regmap_update_bits(xcvr->regmap, FSL_XCVR_EXT_CTRL, 28564486866fa8 Viorel Suman 2020-10-13 1060 FSL_XCVR_EXT_CTRL_PAGE_MASK, 28564486866fa8 Viorel Suman 2020-10-13 1061 FSL_XCVR_EXT_CTRL_PAGE(8)); 28564486866fa8 Viorel Suman 2020-10-13 1062 28564486866fa8 Viorel Suman 2020-10-13 1063 /* Find updated CS buffer */ 28564486866fa8 Viorel Suman 2020-10-13 1064 reg_ctrl = xcvr->ram_addr + FSL_XCVR_RX_CS_CTRL_0; 28564486866fa8 Viorel Suman 2020-10-13 1065 reg_buff = xcvr->ram_addr + FSL_XCVR_RX_CS_BUFF_0; 28564486866fa8 Viorel Suman 2020-10-13 1066 memcpy_fromio(&val, reg_ctrl, sizeof(val)); 28564486866fa8 Viorel Suman 2020-10-13 1067 if (!val) { 28564486866fa8 Viorel Suman 2020-10-13 1068 reg_ctrl = xcvr->ram_addr + FSL_XCVR_RX_CS_CTRL_1; 28564486866fa8 Viorel Suman 2020-10-13 1069 reg_buff = xcvr->ram_addr + FSL_XCVR_RX_CS_BUFF_1; 28564486866fa8 Viorel Suman 2020-10-13 1070 memcpy_fromio(&val, reg_ctrl, sizeof(val)); 28564486866fa8 Viorel Suman 2020-10-13 1071 } 28564486866fa8 Viorel Suman 2020-10-13 1072 28564486866fa8 Viorel Suman 2020-10-13 1073 if (val) { 28564486866fa8 Viorel Suman 2020-10-13 1074 /* copy CS buffer */ 28564486866fa8 Viorel Suman 2020-10-13 1075 memcpy_fromio(&xcvr->rx_iec958.status, reg_buff, 28564486866fa8 Viorel Suman 2020-10-13 1076 sizeof(xcvr->rx_iec958.status)); 28564486866fa8 Viorel Suman 2020-10-13 1077 for (i = 0; i < 6; i++) { 28564486866fa8 Viorel Suman 2020-10-13 1078 val = *(u32 *)(xcvr->rx_iec958.status + i*4); 28564486866fa8 Viorel Suman 2020-10-13 1079 *(u32 *)(xcvr->rx_iec958.status + i*4) = 28564486866fa8 Viorel Suman 2020-10-13 1080 bitrev32(val); 28564486866fa8 Viorel Suman 2020-10-13 1081 } 28564486866fa8 Viorel Suman 2020-10-13 1082 /* clear CS control register */ 28564486866fa8 Viorel Suman 2020-10-13 1083 memset_io(reg_ctrl, 0, sizeof(val)); 28564486866fa8 Viorel Suman 2020-10-13 1084 } 28564486866fa8 Viorel Suman 2020-10-13 1085 } 28564486866fa8 Viorel Suman 2020-10-13 1086 if (isr & FSL_XCVR_IRQ_NEW_UD) { 28564486866fa8 Viorel Suman 2020-10-13 1087 dev_dbg(dev, "Received new UD block\n"); 28564486866fa8 Viorel Suman 2020-10-13 1088 isr_clr |= FSL_XCVR_IRQ_NEW_UD; 28564486866fa8 Viorel Suman 2020-10-13 1089 } 28564486866fa8 Viorel Suman 2020-10-13 1090 if (isr & FSL_XCVR_IRQ_MUTE) { 28564486866fa8 Viorel Suman 2020-10-13 1091 dev_dbg(dev, "HW mute bit detected\n"); 28564486866fa8 Viorel Suman 2020-10-13 1092 isr_clr |= FSL_XCVR_IRQ_MUTE; 28564486866fa8 Viorel Suman 2020-10-13 1093 } 28564486866fa8 Viorel Suman 2020-10-13 1094 if (isr & FSL_XCVR_IRQ_FIFO_UOFL_ERR) { 28564486866fa8 Viorel Suman 2020-10-13 1095 dev_dbg(dev, "RX/TX FIFO full/empty\n"); 28564486866fa8 Viorel Suman 2020-10-13 1096 isr_clr |= FSL_XCVR_IRQ_FIFO_UOFL_ERR; 28564486866fa8 Viorel Suman 2020-10-13 1097 } 28564486866fa8 Viorel Suman 2020-10-13 1098 if (isr & FSL_XCVR_IRQ_ARC_MODE) { 28564486866fa8 Viorel Suman 2020-10-13 1099 dev_dbg(dev, "CMDC SM falls out of eARC mode\n"); 28564486866fa8 Viorel Suman 2020-10-13 1100 isr_clr |= FSL_XCVR_IRQ_ARC_MODE; 28564486866fa8 Viorel Suman 2020-10-13 1101 } 28564486866fa8 Viorel Suman 2020-10-13 1102 if (isr & FSL_XCVR_IRQ_DMA_RD_REQ) { 28564486866fa8 Viorel Suman 2020-10-13 1103 dev_dbg(dev, "DMA read request\n"); 28564486866fa8 Viorel Suman 2020-10-13 1104 isr_clr |= FSL_XCVR_IRQ_DMA_RD_REQ; 28564486866fa8 Viorel Suman 2020-10-13 1105 } 28564486866fa8 Viorel Suman 2020-10-13 1106 if (isr & FSL_XCVR_IRQ_DMA_WR_REQ) { 28564486866fa8 Viorel Suman 2020-10-13 1107 dev_dbg(dev, "DMA write request\n"); 28564486866fa8 Viorel Suman 2020-10-13 1108 isr_clr |= FSL_XCVR_IRQ_DMA_WR_REQ; 28564486866fa8 Viorel Suman 2020-10-13 1109 } 28564486866fa8 Viorel Suman 2020-10-13 1110 28564486866fa8 Viorel Suman 2020-10-13 1111 if (isr_clr) { 28564486866fa8 Viorel Suman 2020-10-13 1112 regmap_write(regmap, FSL_XCVR_EXT_ISR_CLR, isr_clr); 28564486866fa8 Viorel Suman 2020-10-13 1113 return IRQ_HANDLED; 28564486866fa8 Viorel Suman 2020-10-13 1114 } 28564486866fa8 Viorel Suman 2020-10-13 1115 28564486866fa8 Viorel Suman 2020-10-13 1116 return IRQ_NONE; 28564486866fa8 Viorel Suman 2020-10-13 1117 } 28564486866fa8 Viorel Suman 2020-10-13 1118 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org