All of lore.kernel.org
 help / color / mirror / Atom feed
* [morimoto:2022-01-25-v1 14/14] sound/soc/codecs/ak4613.c:368:22: warning: variable 'mode' set but not used
@ 2022-01-25 13:00 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-01-25 13:00 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 5635 bytes --]

tree:   https://github.com/morimoto/linux 2022-01-25-v1
head:   017a564213d399374d186cdb1e80233243ad113a
commit: 017a564213d399374d186cdb1e80233243ad113a [14/14] hog
config: alpha-allmodconfig (https://download.01.org/0day-ci/archive/20220125/202201252035.TZSfGzJd-lkp(a)intel.com/config)
compiler: alpha-linux-gcc (GCC) 11.2.0
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
        # https://github.com/morimoto/linux/commit/017a564213d399374d186cdb1e80233243ad113a
        git remote add morimoto https://github.com/morimoto/linux
        git fetch --no-tags morimoto 2022-01-25-v1
        git checkout 017a564213d399374d186cdb1e80233243ad113a
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=alpha SHELL=/bin/bash sound/soc/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   sound/soc/codecs/ak4613.c: In function 'ak4613_hw_constraints':
>> sound/soc/codecs/ak4613.c:368:22: warning: variable 'mode' set but not used [-Wunused-but-set-variable]
     368 |         unsigned int mode;
         |                      ^~~~


vim +/mode +368 sound/soc/codecs/ak4613.c

   340	
   341	static void ak4613_hw_constraints(struct snd_soc_component *component,
   342					  struct snd_pcm_substream *substream)
   343	{
   344		struct ak4613_priv *priv = snd_soc_component_get_drvdata(component);
   345		struct snd_pcm_runtime *runtime = substream->runtime;
   346		static const unsigned int ak4613_rates[] = {
   347			 32000,
   348			 44100,
   349			 48000,
   350			 64000,
   351			 88200,
   352			 96000,
   353			176400,
   354			192000,
   355		};
   356	#define AK4613_CHANNEL_2	0
   357	#define AK4613_CHANNEL_4	1
   358	#define AK4613_CHANNEL_8	2
   359	#define AK4613_CHANNEL_12	3
   360		static const unsigned int ak4613_channels[] = {
   361			[AK4613_CHANNEL_2]  =  2,
   362			[AK4613_CHANNEL_4]  =  4,
   363			[AK4613_CHANNEL_8]  =  8,
   364			[AK4613_CHANNEL_12] = 12,
   365		};
   366		struct snd_pcm_hw_constraint_list *constraint;
   367		unsigned int mask;
 > 368		unsigned int mode;
   369		unsigned int fs;
   370		int is_play = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
   371		int i;
   372	
   373		constraint = &priv->constraint_rates;
   374		constraint->list	= ak4613_rates;
   375		constraint->mask	= 0;
   376		constraint->count	= 0;
   377	
   378		/*
   379		 * Slave Mode
   380		 *	Normal: [32kHz, 48kHz] : 256fs,384fs or 512fs
   381		 *	Double: [64kHz, 96kHz] : 256fs
   382		 *	Quad  : [128kHz,192kHz]: 128fs
   383		 *
   384		 * Master mode
   385		 *	Normal: [32kHz, 48kHz] : 256fs or 512fs
   386		 *	Double: [64kHz, 96kHz] : 256fs
   387		 *	Quad  : [128kHz,192kHz]: 128fs
   388		 */
   389		for (i = 0; i < ARRAY_SIZE(ak4613_rates); i++) {
   390			/* minimum fs on each range */
   391			fs = (ak4613_rates[i] <= 96000) ? 256 : 128;
   392	
   393			if (priv->sysclk >= ak4613_rates[i] * fs)
   394				constraint->count = i + 1;
   395		}
   396	
   397		snd_pcm_hw_constraint_list(runtime, 0,
   398					SNDRV_PCM_HW_PARAM_RATE, constraint);
   399	
   400		mode = 0;
   401		if (AK4613_CONFIG_GET(priv, MODE) == AK4613_CONFIG_MODE_STEREO) {
   402			/*
   403			 * If board supports STEREO only
   404			 */
   405			mode = mask = (1 << AK4613_CHANNEL_2);
   406		} else {
   407			/*
   408			 * If board supports TDM
   409			 */
   410			unsigned int mode = 0;
   411			int sdti_num = AK4613_CONFIG_SDTI_num(priv);
   412	
   413			if (priv->cnt) {
   414				/*
   415				 * If it was already working,
   416				 * the constraint is same as working setting.
   417				 */
   418				mode = AK4613_INTERFACE_MODE(priv);
   419				mask = 0; /* no default */
   420			} else {
   421				/*
   422				 * It is not yet working,
   423				 * the constraint is based on board configs.
   424				 */
   425				mode = AK4613_CONFIG_GET(priv, MODE);
   426				mask = (1 << AK4613_CHANNEL_2); /* STEREO is default */
   427			}
   428	
   429			/* FIXME: not yet full support */
   430			switch(mode) {
   431			case AK4613_CONFIG_MODE_STEREO:
   432				mask |= (1 << AK4613_CHANNEL_2);
   433				break;
   434			case AK4613_CONFIG_MODE_TDM256:
   435				if (is_play) {
   436					switch (sdti_num) {
   437					case 1:
   438						mask |= (1 << AK4613_CHANNEL_8);
   439						break;
   440					case 2:
   441						/* NOT TESTED */
   442						mask |= (1 << AK4613_CHANNEL_12);
   443						WARN_ON(1);
   444						break;
   445					default:
   446						BUG();
   447						break;
   448					}
   449				} else {
   450					mask |= (1 << AK4613_CHANNEL_4);
   451				}
   452				break;
   453			/* NOT SUPPORTED */
   454			case AK4613_CONFIG_MODE_TDM512:
   455			case AK4613_CONFIG_MODE_TDM128:
   456			default:
   457				BUG();
   458			}
   459		}
   460	
   461		constraint = &priv->constraint_channels;
   462	
   463		constraint->list	= ak4613_channels;
   464		constraint->mask	= mask;
   465		constraint->count	= sizeof(ak4613_channels);
   466		snd_pcm_hw_constraint_list(runtime, 0,
   467					   SNDRV_PCM_HW_PARAM_CHANNELS, constraint);
   468	}
   469	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-25 13:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-25 13:00 [morimoto:2022-01-25-v1 14/14] sound/soc/codecs/ak4613.c:368:22: warning: variable 'mode' set but not used kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.