From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============7363789685311187577==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: [morimoto:2022-01-25-v1 14/14] sound/soc/codecs/ak4613.c:368:22: warning: variable 'mode' set but not used Date: Tue, 25 Jan 2022 21:00:34 +0800 Message-ID: <202201252035.TZSfGzJd-lkp@intel.com> List-Id: --===============7363789685311187577== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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/2022012= 5/202201252035.TZSfGzJd-lkp(a)intel.com/config) compiler: alpha-linux-gcc (GCC) 11.2.0 reproduce (this is a W=3D1 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/017a564213d399374d186cdb= 1e80233243ad113a 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=3D$HOME/0day COMPILER=3Dgcc-11.2.0 make.cross= O=3Dbuild_dir ARCH=3Dalpha SHELL=3D/bin/bash sound/soc/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot 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 u= sed [-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 *componen= t, 342 struct snd_pcm_substream *substream) 343 { 344 struct ak4613_priv *priv =3D snd_soc_component_get_drvdata(componen= t); 345 struct snd_pcm_runtime *runtime =3D substream->runtime; 346 static const unsigned int ak4613_rates[] =3D { 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[] =3D { 361 [AK4613_CHANNEL_2] =3D 2, 362 [AK4613_CHANNEL_4] =3D 4, 363 [AK4613_CHANNEL_8] =3D 8, 364 [AK4613_CHANNEL_12] =3D 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 =3D substream->stream =3D=3D SNDRV_PCM_STREAM_PLAYBACK; 371 int i; 372 = 373 constraint =3D &priv->constraint_rates; 374 constraint->list =3D ak4613_rates; 375 constraint->mask =3D 0; 376 constraint->count =3D 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 =3D 0; i < ARRAY_SIZE(ak4613_rates); i++) { 390 /* minimum fs on each range */ 391 fs =3D (ak4613_rates[i] <=3D 96000) ? 256 : 128; 392 = 393 if (priv->sysclk >=3D ak4613_rates[i] * fs) 394 constraint->count =3D i + 1; 395 } 396 = 397 snd_pcm_hw_constraint_list(runtime, 0, 398 SNDRV_PCM_HW_PARAM_RATE, constraint); 399 = 400 mode =3D 0; 401 if (AK4613_CONFIG_GET(priv, MODE) =3D=3D AK4613_CONFIG_MODE_STEREO)= { 402 /* 403 * If board supports STEREO only 404 */ 405 mode =3D mask =3D (1 << AK4613_CHANNEL_2); 406 } else { 407 /* 408 * If board supports TDM 409 */ 410 unsigned int mode =3D 0; 411 int sdti_num =3D 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 =3D AK4613_INTERFACE_MODE(priv); 419 mask =3D 0; /* no default */ 420 } else { 421 /* 422 * It is not yet working, 423 * the constraint is based on board configs. 424 */ 425 mode =3D AK4613_CONFIG_GET(priv, MODE); 426 mask =3D (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 |=3D (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 |=3D (1 << AK4613_CHANNEL_8); 439 break; 440 case 2: 441 /* NOT TESTED */ 442 mask |=3D (1 << AK4613_CHANNEL_12); 443 WARN_ON(1); 444 break; 445 default: 446 BUG(); 447 break; 448 } 449 } else { 450 mask |=3D (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 =3D &priv->constraint_channels; 462 = 463 constraint->list =3D ak4613_channels; 464 constraint->mask =3D mask; 465 constraint->count =3D 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 --===============7363789685311187577==--