@@ -433,7 +433,7 @@ int snd_usb_get_cur_mix_value(struct usb_mixer_elem_info *cval,
433
433
{
434
434
int err ;
435
435
436
- if (cval -> cached & ( 1 << channel )) {
436
+ if (cval -> cached & BIT ( channel )) {
437
437
* value = cval -> cache_val [index ];
438
438
return 0 ;
439
439
}
@@ -445,7 +445,7 @@ int snd_usb_get_cur_mix_value(struct usb_mixer_elem_info *cval,
445
445
cval -> control , channel , err );
446
446
return err ;
447
447
}
448
- cval -> cached |= 1 << channel ;
448
+ cval -> cached |= BIT ( channel ) ;
449
449
cval -> cache_val [index ] = * value ;
450
450
return 0 ;
451
451
}
@@ -522,7 +522,7 @@ int snd_usb_set_cur_mix_value(struct usb_mixer_elem_info *cval, int channel,
522
522
int err ;
523
523
unsigned int read_only = (channel == 0 ) ?
524
524
cval -> master_readonly :
525
- cval -> ch_readonly & ( 1 << ( channel - 1 ) );
525
+ cval -> ch_readonly & BIT ( channel - 1 );
526
526
527
527
if (read_only ) {
528
528
usb_audio_dbg (cval -> head .mixer -> chip ,
@@ -536,7 +536,7 @@ int snd_usb_set_cur_mix_value(struct usb_mixer_elem_info *cval, int channel,
536
536
value );
537
537
if (err < 0 )
538
538
return err ;
539
- cval -> cached |= 1 << channel ;
539
+ cval -> cached |= BIT ( channel ) ;
540
540
cval -> cache_val [index ] = value ;
541
541
return 0 ;
542
542
}
@@ -1253,7 +1253,7 @@ static int get_min_max_with_quirks(struct usb_mixer_elem_info *cval,
1253
1253
int minchn = 0 ;
1254
1254
if (cval -> cmask ) {
1255
1255
for (i = 0 ; i < MAX_CHANNELS ; i ++ )
1256
- if (cval -> cmask & ( 1 << i )) {
1256
+ if (cval -> cmask & BIT ( i )) {
1257
1257
minchn = i + 1 ;
1258
1258
break ;
1259
1259
}
@@ -1358,7 +1358,7 @@ static int get_min_max_with_quirks(struct usb_mixer_elem_info *cval,
1358
1358
} else {
1359
1359
idx = 0 ;
1360
1360
for (i = 0 ; i < MAX_CHANNELS ; i ++ ) {
1361
- if (cval -> cmask & ( 1 << i )) {
1361
+ if (cval -> cmask & BIT ( i )) {
1362
1362
init_cur_mix_raw (cval , i + 1 , idx );
1363
1363
idx ++ ;
1364
1364
}
@@ -1416,7 +1416,7 @@ static int mixer_ctl_feature_get(struct snd_kcontrol *kcontrol,
1416
1416
if (cval -> cmask ) {
1417
1417
cnt = 0 ;
1418
1418
for (c = 0 ; c < MAX_CHANNELS ; c ++ ) {
1419
- if (!(cval -> cmask & ( 1 << c )))
1419
+ if (!(cval -> cmask & BIT ( c )))
1420
1420
continue ;
1421
1421
err = snd_usb_get_cur_mix_value (cval , c + 1 , cnt , & val );
1422
1422
if (err < 0 )
@@ -1448,7 +1448,7 @@ static int mixer_ctl_feature_put(struct snd_kcontrol *kcontrol,
1448
1448
if (cval -> cmask ) {
1449
1449
cnt = 0 ;
1450
1450
for (c = 0 ; c < MAX_CHANNELS ; c ++ ) {
1451
- if (!(cval -> cmask & ( 1 << c )))
1451
+ if (!(cval -> cmask & BIT ( c )))
1452
1452
continue ;
1453
1453
err = snd_usb_get_cur_mix_value (cval , c + 1 , cnt , & oval );
1454
1454
if (err < 0 )
@@ -1700,7 +1700,7 @@ static void __build_feature_ctl(struct usb_mixer_interface *mixer,
1700
1700
} else {
1701
1701
int i , c = 0 ;
1702
1702
for (i = 0 ; i < 16 ; i ++ )
1703
- if (ctl_mask & ( 1 << i ))
1703
+ if (ctl_mask & BIT ( i ))
1704
1704
c ++ ;
1705
1705
cval -> channels = c ;
1706
1706
cval -> ch_readonly = readonly_mask ;
@@ -2060,8 +2060,8 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid,
2060
2060
2061
2061
mask = snd_usb_combine_bytes (bmaControls +
2062
2062
csize * (j + 1 ), csize );
2063
- if (mask & ( 1 << i ))
2064
- ch_bits |= ( 1 << j );
2063
+ if (mask & BIT ( i ))
2064
+ ch_bits |= BIT ( j );
2065
2065
}
2066
2066
/* audio class v1 controls are never read-only */
2067
2067
@@ -2072,7 +2072,7 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid,
2072
2072
if (ch_bits & 1 )
2073
2073
build_feature_ctl (state , _ftr , ch_bits , control ,
2074
2074
& iterm , unitid , 0 );
2075
- if (master_bits & ( 1 << i ))
2075
+ if (master_bits & BIT ( i ))
2076
2076
build_feature_ctl (state , _ftr , 0 , control ,
2077
2077
& iterm , unitid , 0 );
2078
2078
}
@@ -2088,9 +2088,9 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid,
2088
2088
mask = snd_usb_combine_bytes (bmaControls +
2089
2089
csize * (j + 1 ), csize );
2090
2090
if (uac_v2v3_control_is_readable (mask , control )) {
2091
- ch_bits |= ( 1 << j );
2091
+ ch_bits |= BIT ( j );
2092
2092
if (!uac_v2v3_control_is_writeable (mask , control ))
2093
- ch_read_only |= ( 1 << j );
2093
+ ch_read_only |= BIT ( j );
2094
2094
}
2095
2095
}
2096
2096
@@ -2181,7 +2181,7 @@ static void build_mixer_unit_ctl(struct mixer_build *state,
2181
2181
__u8 * c = uac_mixer_unit_bmControls (desc , state -> mixer -> protocol );
2182
2182
2183
2183
if (check_matrix_bitmap (c , in_ch , i , num_outs )) {
2184
- cval -> cmask |= ( 1 << i );
2184
+ cval -> cmask |= BIT ( i );
2185
2185
cval -> channels ++ ;
2186
2186
}
2187
2187
}
@@ -2504,7 +2504,7 @@ static int build_audio_procunit(struct mixer_build *state, int unitid,
2504
2504
2505
2505
if (state -> mixer -> protocol == UAC_VERSION_1 ) {
2506
2506
if (!(controls [valinfo -> control / 8 ] &
2507
- ( 1 << ((valinfo -> control % 8 ) - 1 ) )))
2507
+ BIT ((valinfo -> control % 8 ) - 1 )))
2508
2508
continue ;
2509
2509
} else { /* UAC_VERSION_2/3 */
2510
2510
if (!uac_v2v3_control_is_readable (controls [valinfo -> control / 8 ],
@@ -3448,7 +3448,7 @@ static void snd_usb_mixer_interrupt_v2(struct usb_mixer_interface *mixer,
3448
3448
case UAC2_CS_CUR :
3449
3449
/* invalidate cache, so the value is read from the device */
3450
3450
if (channel )
3451
- info -> cached &= ~( 1 << channel );
3451
+ info -> cached &= ~BIT ( channel );
3452
3452
else /* master channel */
3453
3453
info -> cached = 0 ;
3454
3454
@@ -3684,9 +3684,9 @@ static int restore_mixer_value(struct usb_mixer_elem_list *list)
3684
3684
if (cval -> cmask ) {
3685
3685
idx = 0 ;
3686
3686
for (c = 0 ; c < MAX_CHANNELS ; c ++ ) {
3687
- if (!(cval -> cmask & ( 1 << c )))
3687
+ if (!(cval -> cmask & BIT ( c )))
3688
3688
continue ;
3689
- if (cval -> cached & ( 1 << ( c + 1 ) )) {
3689
+ if (cval -> cached & BIT ( c + 1 )) {
3690
3690
err = snd_usb_set_cur_mix_value (cval , c + 1 , idx ,
3691
3691
cval -> cache_val [idx ]);
3692
3692
if (err < 0 )
0 commit comments