tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: dad309222e4c3fc7f88b20ce725ce1e0eea07cc7 commit: a94566ace3ca789747cd4cb26dd59474d135c7ac [13138/13397] ALSA: usb-audio: Stop parsing channels bits when all channels are found. config: loongarch-defconfig (https://download.01.org/0day-ci/archive/20240313/202403132230.Ituid5qw-lkp@xxxxxxxxx/config) compiler: loongarch64-linux-gcc (GCC) 13.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240313/202403132230.Ituid5qw-lkp@xxxxxxxxx/reproduce) 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@xxxxxxxxx> | Closes: https://lore.kernel.org/oe-kbuild-all/202403132230.Ituid5qw-lkp@xxxxxxxxx/ Note: the linux-next/master HEAD dad309222e4c3fc7f88b20ce725ce1e0eea07cc7 builds fine. It may have been fixed somewhere. All errors (new ones prefixed by >>): sound/usb/stream.c: In function 'convert_chmap': >> sound/usb/stream.c:306:34: error: 'chmaps' undeclared (first use in this function); did you mean 'chmap'? 306 | if (c == chmaps->channels) | ^~~~~~ | chmap sound/usb/stream.c:306:34: note: each undeclared identifier is reported only once for each function it appears in vim +306 sound/usb/stream.c 237 238 /* convert from USB ChannelConfig bits to ALSA chmap element */ 239 static struct snd_pcm_chmap_elem *convert_chmap(int channels, unsigned int bits, 240 int protocol) 241 { 242 static const unsigned int uac1_maps[] = { 243 SNDRV_CHMAP_FL, /* left front */ 244 SNDRV_CHMAP_FR, /* right front */ 245 SNDRV_CHMAP_FC, /* center front */ 246 SNDRV_CHMAP_LFE, /* LFE */ 247 SNDRV_CHMAP_SL, /* left surround */ 248 SNDRV_CHMAP_SR, /* right surround */ 249 SNDRV_CHMAP_FLC, /* left of center */ 250 SNDRV_CHMAP_FRC, /* right of center */ 251 SNDRV_CHMAP_RC, /* surround */ 252 SNDRV_CHMAP_SL, /* side left */ 253 SNDRV_CHMAP_SR, /* side right */ 254 SNDRV_CHMAP_TC, /* top */ 255 0 /* terminator */ 256 }; 257 static const unsigned int uac2_maps[] = { 258 SNDRV_CHMAP_FL, /* front left */ 259 SNDRV_CHMAP_FR, /* front right */ 260 SNDRV_CHMAP_FC, /* front center */ 261 SNDRV_CHMAP_LFE, /* LFE */ 262 SNDRV_CHMAP_RL, /* back left */ 263 SNDRV_CHMAP_RR, /* back right */ 264 SNDRV_CHMAP_FLC, /* front left of center */ 265 SNDRV_CHMAP_FRC, /* front right of center */ 266 SNDRV_CHMAP_RC, /* back center */ 267 SNDRV_CHMAP_SL, /* side left */ 268 SNDRV_CHMAP_SR, /* side right */ 269 SNDRV_CHMAP_TC, /* top center */ 270 SNDRV_CHMAP_TFL, /* top front left */ 271 SNDRV_CHMAP_TFC, /* top front center */ 272 SNDRV_CHMAP_TFR, /* top front right */ 273 SNDRV_CHMAP_TRL, /* top back left */ 274 SNDRV_CHMAP_TRC, /* top back center */ 275 SNDRV_CHMAP_TRR, /* top back right */ 276 SNDRV_CHMAP_TFLC, /* top front left of center */ 277 SNDRV_CHMAP_TFRC, /* top front right of center */ 278 SNDRV_CHMAP_LLFE, /* left LFE */ 279 SNDRV_CHMAP_RLFE, /* right LFE */ 280 SNDRV_CHMAP_TSL, /* top side left */ 281 SNDRV_CHMAP_TSR, /* top side right */ 282 SNDRV_CHMAP_BC, /* bottom center */ 283 SNDRV_CHMAP_RLC, /* back left of center */ 284 SNDRV_CHMAP_RRC, /* back right of center */ 285 0 /* terminator */ 286 }; 287 struct snd_pcm_chmap_elem *chmap; 288 const unsigned int *maps; 289 int c; 290 291 if (channels > ARRAY_SIZE(chmap->map)) 292 return NULL; 293 294 chmap = kzalloc(sizeof(*chmap), GFP_KERNEL); 295 if (!chmap) 296 return NULL; 297 298 maps = protocol == UAC_VERSION_2 ? uac2_maps : uac1_maps; 299 chmap->channels = channels; 300 c = 0; 301 302 if (bits) { 303 for (; bits && *maps; maps++, bits >>= 1) { 304 if (bits & 1) 305 chmap->map[c++] = *maps; > 306 if (c == chmaps->channels) 307 break; 308 } 309 } else { 310 /* If we're missing wChannelConfig, then guess something 311 to make sure the channel map is not skipped entirely */ 312 if (channels == 1) 313 chmap->map[c++] = SNDRV_CHMAP_MONO; 314 else 315 for (; c < channels && *maps; maps++) 316 chmap->map[c++] = *maps; 317 } 318 319 for (; c < channels; c++) 320 chmap->map[c] = SNDRV_CHMAP_UNKNOWN; 321 322 return chmap; 323 } 324 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki