[alsa-devel] [asoc:topic/cs43130 1/2] sound/soc/codecs/cs43130.c:2089:18: warning: 'hpload_seq' may be used uninitialized in this function

kbuild test robot fengguang.wu at intel.com
Fri Sep 1 15:02:48 CEST 2017


tree:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git topic/cs43130
head:   465c925695593b43695e2396f7279879a72275eb
commit: 8f1e5bf9b4408e91942b94c76583eaf098f19382 [1/2] ASoC: cs43130: Add support for CS43130 codec
config: i386-allmodconfig (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        git checkout 8f1e5bf9b4408e91942b94c76583eaf098f19382
        # save the attached .config to linux build tree
        make ARCH=i386 

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   sound/soc/codecs/cs43130.c: In function 'cs43130_imp_meas':
>> sound/soc/codecs/cs43130.c:2089:18: warning: 'hpload_seq' may be used uninitialized in this function [-Wmaybe-uninitialized]
           hpload_seq[i].msk, ac_idx);
                     ^

vim +/hpload_seq +2089 sound/soc/codecs/cs43130.c

  2042	
  2043	static void cs43130_imp_meas(struct work_struct *wk)
  2044	{
  2045		unsigned int reg, seq_size;
  2046		int i, ret, ac_idx;
  2047		struct cs43130_private *cs43130;
  2048		struct snd_soc_codec *codec;
  2049		struct reg_sequences *hpload_seq;
  2050	
  2051		cs43130 = container_of(wk, struct cs43130_private, work);
  2052		codec = cs43130->codec;
  2053	
  2054		if (!cs43130->mclk)
  2055			return;
  2056	
  2057		cs43130->hpload_done = false;
  2058	
  2059		mutex_lock(&cs43130->clk_mutex);
  2060		if (!cs43130->clk_req) {
  2061			/* clk not in use */
  2062			cs43130_set_pll(codec, 0, 0, cs43130->mclk, CS43130_MCLK_22M);
  2063			if (cs43130->pll_bypass)
  2064				cs43130_change_clksrc(codec, CS43130_MCLK_SRC_EXT);
  2065			else
  2066				cs43130_change_clksrc(codec, CS43130_MCLK_SRC_PLL);
  2067		}
  2068	
  2069		cs43130->clk_req++;
  2070		mutex_unlock(&cs43130->clk_mutex);
  2071	
  2072		regmap_read(cs43130->regmap, CS43130_INT_STATUS_4, &reg);
  2073	
  2074		switch (cs43130->dev_id) {
  2075		case CS43130_CHIP_ID:
  2076			hpload_seq = hpload_seq1;
  2077			seq_size = ARRAY_SIZE(hpload_seq1);
  2078			break;
  2079		case CS43131_CHIP_ID:
  2080			hpload_seq = hpload_seq2;
  2081			seq_size = ARRAY_SIZE(hpload_seq2);
  2082		}
  2083	
  2084		i = 0;
  2085		ac_idx = 0;
  2086		while (i < seq_size) {
  2087			ret = cs43130_hpload_proc(cs43130, hpload_seq[i].seq,
  2088						  hpload_seq[i].size,
> 2089						  hpload_seq[i].msk, ac_idx);
  2090			if (ret < 0)
  2091				goto exit;
  2092	
  2093			cs43130_update_hpload(hpload_seq[i].msk, ac_idx, cs43130);
  2094	
  2095			if (cs43130->ac_meas &&
  2096			    hpload_seq[i].msk == CS43130_HPLOAD_AC_INT &&
  2097			    ac_idx < CS43130_AC_FREQ - 1) {
  2098				ac_idx++;
  2099			} else {
  2100				ac_idx = 0;
  2101				i++;
  2102			}
  2103		}
  2104		cs43130->hpload_done = true;
  2105	
  2106		if (cs43130->hpload_dc[HP_LEFT] >= CS43130_LINEOUT_LOAD)
  2107			snd_soc_jack_report(&cs43130->jack, CS43130_JACK_LINEOUT,
  2108					    CS43130_JACK_MASK);
  2109		else
  2110			snd_soc_jack_report(&cs43130->jack, CS43130_JACK_HEADPHONE,
  2111					    CS43130_JACK_MASK);
  2112	
  2113		dev_dbg(codec->dev, "Set HP output control. DC threshold\n");
  2114		for (i = 0; i < CS43130_DC_THRESHOLD; i++)
  2115			dev_dbg(codec->dev, "DC threshold[%d]: %u.\n", i,
  2116				cs43130->dc_threshold[i]);
  2117	
  2118		cs43130_set_hv(cs43130->regmap, cs43130->hpload_dc[HP_LEFT],
  2119			       cs43130->dc_threshold);
  2120	
  2121	exit:
  2122		switch (cs43130->dev_id) {
  2123		case CS43130_CHIP_ID:
  2124			cs43130_hpload_proc(cs43130, hp_dis_cal_seq,
  2125					    ARRAY_SIZE(hp_dis_cal_seq),
  2126					    CS43130_HPLOAD_OFF_INT, ac_idx);
  2127			break;
  2128		case CS43131_CHIP_ID:
  2129			cs43130_hpload_proc(cs43130, hp_dis_cal_seq2,
  2130					    ARRAY_SIZE(hp_dis_cal_seq2),
  2131					    CS43130_HPLOAD_OFF_INT, ac_idx);
  2132		}
  2133	
  2134		regmap_multi_reg_write(cs43130->regmap, hp_cln_seq,
  2135				       ARRAY_SIZE(hp_cln_seq));
  2136	
  2137		mutex_lock(&cs43130->clk_mutex);
  2138		cs43130->clk_req--;
  2139		/* clk not in use */
  2140		if (!cs43130->clk_req)
  2141			cs43130_change_clksrc(codec, CS43130_MCLK_SRC_RCO);
  2142		mutex_unlock(&cs43130->clk_mutex);
  2143	}
  2144	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 61084 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20170901/b6aed87d/attachment-0001.bin>


More information about the Alsa-devel mailing list