Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
c64c8daa
Commit
c64c8daa
authored
Jun 30, 2004
by
Mika Kukkonen
Committed by
Linus Torvalds
Jun 30, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] sparse: NULL vs 0 - sound/*
parent
a2de740a
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
47 additions
and
47 deletions
+47
-47
sound/core/memalloc.c
sound/core/memalloc.c
+1
-1
sound/core/oss/pcm_oss.c
sound/core/oss/pcm_oss.c
+18
-18
sound/core/oss/pcm_plugin.c
sound/core/oss/pcm_plugin.c
+2
-2
sound/core/oss/route.c
sound/core/oss/route.c
+4
-4
sound/core/pcm_lib.c
sound/core/pcm_lib.c
+9
-9
sound/core/pcm_native.c
sound/core/pcm_native.c
+12
-12
sound/pci/intel8x0.c
sound/pci/intel8x0.c
+1
-1
No files found.
sound/core/memalloc.c
View file @
c64c8daa
...
@@ -807,7 +807,7 @@ static int snd_mem_proc_read(char *page, char **start, off_t off,
...
@@ -807,7 +807,7 @@ static int snd_mem_proc_read(char *page, char **start, off_t off,
static
int
__init
snd_mem_init
(
void
)
static
int
__init
snd_mem_init
(
void
)
{
{
#ifdef CONFIG_PROC_FS
#ifdef CONFIG_PROC_FS
create_proc_read_entry
(
"driver/snd-page-alloc"
,
0
,
0
,
snd_mem_proc_read
,
NULL
);
create_proc_read_entry
(
"driver/snd-page-alloc"
,
0
,
NULL
,
snd_mem_proc_read
,
NULL
);
#endif
#endif
preallocate_cards
();
preallocate_cards
();
return
0
;
return
0
;
...
...
sound/core/oss/pcm_oss.c
View file @
c64c8daa
...
@@ -192,7 +192,7 @@ static int snd_pcm_oss_period_size(snd_pcm_substream_t *substream,
...
@@ -192,7 +192,7 @@ static int snd_pcm_oss_period_size(snd_pcm_substream_t *substream,
params_channels
(
oss_params
)
/
8
;
params_channels
(
oss_params
)
/
8
;
oss_buffer_size
=
snd_pcm_plug_client_size
(
substream
,
oss_buffer_size
=
snd_pcm_plug_client_size
(
substream
,
snd_pcm_hw_param_value_max
(
slave_params
,
SNDRV_PCM_HW_PARAM_BUFFER_SIZE
,
0
))
*
oss_frame_size
;
snd_pcm_hw_param_value_max
(
slave_params
,
SNDRV_PCM_HW_PARAM_BUFFER_SIZE
,
NULL
))
*
oss_frame_size
;
oss_buffer_size
=
1
<<
ld2
(
oss_buffer_size
);
oss_buffer_size
=
1
<<
ld2
(
oss_buffer_size
);
if
(
atomic_read
(
&
runtime
->
mmap_count
))
{
if
(
atomic_read
(
&
runtime
->
mmap_count
))
{
if
(
oss_buffer_size
>
runtime
->
oss
.
mmap_bytes
)
if
(
oss_buffer_size
>
runtime
->
oss
.
mmap_bytes
)
...
@@ -228,14 +228,14 @@ static int snd_pcm_oss_period_size(snd_pcm_substream_t *substream,
...
@@ -228,14 +228,14 @@ static int snd_pcm_oss_period_size(snd_pcm_substream_t *substream,
}
}
min_period_size
=
snd_pcm_plug_client_size
(
substream
,
min_period_size
=
snd_pcm_plug_client_size
(
substream
,
snd_pcm_hw_param_value_min
(
slave_params
,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE
,
0
));
snd_pcm_hw_param_value_min
(
slave_params
,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE
,
NULL
));
min_period_size
*=
oss_frame_size
;
min_period_size
*=
oss_frame_size
;
min_period_size
=
1
<<
(
ld2
(
min_period_size
-
1
)
+
1
);
min_period_size
=
1
<<
(
ld2
(
min_period_size
-
1
)
+
1
);
if
(
oss_period_size
<
min_period_size
)
if
(
oss_period_size
<
min_period_size
)
oss_period_size
=
min_period_size
;
oss_period_size
=
min_period_size
;
max_period_size
=
snd_pcm_plug_client_size
(
substream
,
max_period_size
=
snd_pcm_plug_client_size
(
substream
,
snd_pcm_hw_param_value_max
(
slave_params
,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE
,
0
));
snd_pcm_hw_param_value_max
(
slave_params
,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE
,
NULL
));
max_period_size
*=
oss_frame_size
;
max_period_size
*=
oss_frame_size
;
max_period_size
=
1
<<
ld2
(
max_period_size
);
max_period_size
=
1
<<
ld2
(
max_period_size
);
if
(
oss_period_size
>
max_period_size
)
if
(
oss_period_size
>
max_period_size
)
...
@@ -248,13 +248,13 @@ static int snd_pcm_oss_period_size(snd_pcm_substream_t *substream,
...
@@ -248,13 +248,13 @@ static int snd_pcm_oss_period_size(snd_pcm_substream_t *substream,
oss_periods
=
substream
->
oss
.
setup
->
periods
;
oss_periods
=
substream
->
oss
.
setup
->
periods
;
}
}
s
=
snd_pcm_hw_param_value_max
(
slave_params
,
SNDRV_PCM_HW_PARAM_PERIODS
,
0
);
s
=
snd_pcm_hw_param_value_max
(
slave_params
,
SNDRV_PCM_HW_PARAM_PERIODS
,
NULL
);
if
(
runtime
->
oss
.
maxfrags
&&
s
>
runtime
->
oss
.
maxfrags
)
if
(
runtime
->
oss
.
maxfrags
&&
s
>
runtime
->
oss
.
maxfrags
)
s
=
runtime
->
oss
.
maxfrags
;
s
=
runtime
->
oss
.
maxfrags
;
if
(
oss_periods
>
s
)
if
(
oss_periods
>
s
)
oss_periods
=
s
;
oss_periods
=
s
;
s
=
snd_pcm_hw_param_value_min
(
slave_params
,
SNDRV_PCM_HW_PARAM_PERIODS
,
0
);
s
=
snd_pcm_hw_param_value_min
(
slave_params
,
SNDRV_PCM_HW_PARAM_PERIODS
,
NULL
);
if
(
s
<
2
)
if
(
s
<
2
)
s
=
2
;
s
=
2
;
if
(
oss_periods
<
s
)
if
(
oss_periods
<
s
)
...
@@ -307,7 +307,7 @@ static int choose_rate(snd_pcm_substream_t *substream,
...
@@ -307,7 +307,7 @@ static int choose_rate(snd_pcm_substream_t *substream,
/* not found, use the nearest rate */
/* not found, use the nearest rate */
kfree
(
save
);
kfree
(
save
);
return
snd_pcm_hw_param_near
(
substream
,
params
,
SNDRV_PCM_HW_PARAM_RATE
,
best_rate
,
0
);
return
snd_pcm_hw_param_near
(
substream
,
params
,
SNDRV_PCM_HW_PARAM_RATE
,
best_rate
,
NULL
);
}
}
static
int
snd_pcm_oss_change_params
(
snd_pcm_substream_t
*
substream
)
static
int
snd_pcm_oss_change_params
(
snd_pcm_substream_t
*
substream
)
...
@@ -357,7 +357,7 @@ static int snd_pcm_oss_change_params(snd_pcm_substream_t *substream)
...
@@ -357,7 +357,7 @@ static int snd_pcm_oss_change_params(snd_pcm_substream_t *substream)
goto
failure
;
goto
failure
;
}
}
choose_rate
(
substream
,
sparams
,
runtime
->
oss
.
rate
);
choose_rate
(
substream
,
sparams
,
runtime
->
oss
.
rate
);
snd_pcm_hw_param_near
(
substream
,
sparams
,
SNDRV_PCM_HW_PARAM_CHANNELS
,
runtime
->
oss
.
channels
,
0
);
snd_pcm_hw_param_near
(
substream
,
sparams
,
SNDRV_PCM_HW_PARAM_CHANNELS
,
runtime
->
oss
.
channels
,
NULL
);
format
=
snd_pcm_oss_format_from
(
runtime
->
oss
.
format
);
format
=
snd_pcm_oss_format_from
(
runtime
->
oss
.
format
);
...
@@ -440,14 +440,14 @@ static int snd_pcm_oss_change_params(snd_pcm_substream_t *substream)
...
@@ -440,14 +440,14 @@ static int snd_pcm_oss_change_params(snd_pcm_substream_t *substream)
goto
failure
;
goto
failure
;
n
=
snd_pcm_plug_slave_size
(
substream
,
runtime
->
oss
.
period_bytes
/
oss_frame_size
);
n
=
snd_pcm_plug_slave_size
(
substream
,
runtime
->
oss
.
period_bytes
/
oss_frame_size
);
err
=
snd_pcm_hw_param_near
(
substream
,
sparams
,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE
,
n
,
0
);
err
=
snd_pcm_hw_param_near
(
substream
,
sparams
,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE
,
n
,
NULL
);
snd_assert
(
err
>=
0
,
goto
failure
);
snd_assert
(
err
>=
0
,
goto
failure
);
err
=
snd_pcm_hw_param_near
(
substream
,
sparams
,
SNDRV_PCM_HW_PARAM_PERIODS
,
err
=
snd_pcm_hw_param_near
(
substream
,
sparams
,
SNDRV_PCM_HW_PARAM_PERIODS
,
runtime
->
oss
.
periods
,
0
);
runtime
->
oss
.
periods
,
NULL
);
snd_assert
(
err
>=
0
,
goto
failure
);
snd_assert
(
err
>=
0
,
goto
failure
);
snd_pcm_kernel_ioctl
(
substream
,
SNDRV_PCM_IOCTL_DROP
,
0
);
snd_pcm_kernel_ioctl
(
substream
,
SNDRV_PCM_IOCTL_DROP
,
NULL
);
if
((
err
=
snd_pcm_kernel_ioctl
(
substream
,
SNDRV_PCM_IOCTL_HW_PARAMS
,
sparams
))
<
0
)
{
if
((
err
=
snd_pcm_kernel_ioctl
(
substream
,
SNDRV_PCM_IOCTL_HW_PARAMS
,
sparams
))
<
0
)
{
snd_printd
(
"HW_PARAMS failed: %i
\n
"
,
err
);
snd_printd
(
"HW_PARAMS failed: %i
\n
"
,
err
);
...
@@ -564,7 +564,7 @@ static int snd_pcm_oss_prepare(snd_pcm_substream_t *substream)
...
@@ -564,7 +564,7 @@ static int snd_pcm_oss_prepare(snd_pcm_substream_t *substream)
int
err
;
int
err
;
snd_pcm_runtime_t
*
runtime
=
substream
->
runtime
;
snd_pcm_runtime_t
*
runtime
=
substream
->
runtime
;
err
=
snd_pcm_kernel_ioctl
(
substream
,
SNDRV_PCM_IOCTL_PREPARE
,
0
);
err
=
snd_pcm_kernel_ioctl
(
substream
,
SNDRV_PCM_IOCTL_PREPARE
,
NULL
);
if
(
err
<
0
)
{
if
(
err
<
0
)
{
snd_printd
(
"snd_pcm_oss_prepare: SNDRV_PCM_IOCTL_PREPARE failed
\n
"
);
snd_printd
(
"snd_pcm_oss_prepare: SNDRV_PCM_IOCTL_PREPARE failed
\n
"
);
return
err
;
return
err
;
...
@@ -932,12 +932,12 @@ static int snd_pcm_oss_reset(snd_pcm_oss_file_t *pcm_oss_file)
...
@@ -932,12 +932,12 @@ static int snd_pcm_oss_reset(snd_pcm_oss_file_t *pcm_oss_file)
substream
=
pcm_oss_file
->
streams
[
SNDRV_PCM_STREAM_PLAYBACK
];
substream
=
pcm_oss_file
->
streams
[
SNDRV_PCM_STREAM_PLAYBACK
];
if
(
substream
!=
NULL
)
{
if
(
substream
!=
NULL
)
{
snd_pcm_kernel_playback_ioctl
(
substream
,
SNDRV_PCM_IOCTL_DROP
,
0
);
snd_pcm_kernel_playback_ioctl
(
substream
,
SNDRV_PCM_IOCTL_DROP
,
NULL
);
substream
->
runtime
->
oss
.
prepare
=
1
;
substream
->
runtime
->
oss
.
prepare
=
1
;
}
}
substream
=
pcm_oss_file
->
streams
[
SNDRV_PCM_STREAM_CAPTURE
];
substream
=
pcm_oss_file
->
streams
[
SNDRV_PCM_STREAM_CAPTURE
];
if
(
substream
!=
NULL
)
{
if
(
substream
!=
NULL
)
{
snd_pcm_kernel_capture_ioctl
(
substream
,
SNDRV_PCM_IOCTL_DROP
,
0
);
snd_pcm_kernel_capture_ioctl
(
substream
,
SNDRV_PCM_IOCTL_DROP
,
NULL
);
substream
->
runtime
->
oss
.
prepare
=
1
;
substream
->
runtime
->
oss
.
prepare
=
1
;
}
}
return
0
;
return
0
;
...
@@ -952,7 +952,7 @@ static int snd_pcm_oss_post(snd_pcm_oss_file_t *pcm_oss_file)
...
@@ -952,7 +952,7 @@ static int snd_pcm_oss_post(snd_pcm_oss_file_t *pcm_oss_file)
if
(
substream
!=
NULL
)
{
if
(
substream
!=
NULL
)
{
if
((
err
=
snd_pcm_oss_make_ready
(
substream
))
<
0
)
if
((
err
=
snd_pcm_oss_make_ready
(
substream
))
<
0
)
return
err
;
return
err
;
snd_pcm_kernel_playback_ioctl
(
substream
,
SNDRV_PCM_IOCTL_START
,
0
);
snd_pcm_kernel_playback_ioctl
(
substream
,
SNDRV_PCM_IOCTL_START
,
NULL
);
}
}
/* note: all errors from the start action are ignored */
/* note: all errors from the start action are ignored */
/* OSS apps do not know, how to handle them */
/* OSS apps do not know, how to handle them */
...
@@ -1078,7 +1078,7 @@ static int snd_pcm_oss_sync(snd_pcm_oss_file_t *pcm_oss_file)
...
@@ -1078,7 +1078,7 @@ static int snd_pcm_oss_sync(snd_pcm_oss_file_t *pcm_oss_file)
__direct:
__direct:
saved_f_flags
=
substream
->
ffile
->
f_flags
;
saved_f_flags
=
substream
->
ffile
->
f_flags
;
substream
->
ffile
->
f_flags
&=
~
O_NONBLOCK
;
substream
->
ffile
->
f_flags
&=
~
O_NONBLOCK
;
err
=
snd_pcm_kernel_playback_ioctl
(
substream
,
SNDRV_PCM_IOCTL_DRAIN
,
0
);
err
=
snd_pcm_kernel_playback_ioctl
(
substream
,
SNDRV_PCM_IOCTL_DRAIN
,
NULL
);
substream
->
ffile
->
f_flags
=
saved_f_flags
;
substream
->
ffile
->
f_flags
=
saved_f_flags
;
if
(
err
<
0
)
if
(
err
<
0
)
return
err
;
return
err
;
...
@@ -1090,7 +1090,7 @@ static int snd_pcm_oss_sync(snd_pcm_oss_file_t *pcm_oss_file)
...
@@ -1090,7 +1090,7 @@ static int snd_pcm_oss_sync(snd_pcm_oss_file_t *pcm_oss_file)
if
((
err
=
snd_pcm_oss_make_ready
(
substream
))
<
0
)
if
((
err
=
snd_pcm_oss_make_ready
(
substream
))
<
0
)
return
err
;
return
err
;
runtime
=
substream
->
runtime
;
runtime
=
substream
->
runtime
;
err
=
snd_pcm_kernel_capture_ioctl
(
substream
,
SNDRV_PCM_IOCTL_DROP
,
0
);
err
=
snd_pcm_kernel_capture_ioctl
(
substream
,
SNDRV_PCM_IOCTL_DROP
,
NULL
);
if
(
err
<
0
)
if
(
err
<
0
)
return
err
;
return
err
;
runtime
->
oss
.
buffer_used
=
0
;
runtime
->
oss
.
buffer_used
=
0
;
...
@@ -1402,7 +1402,7 @@ static int snd_pcm_oss_set_trigger(snd_pcm_oss_file_t *pcm_oss_file, int trigger
...
@@ -1402,7 +1402,7 @@ static int snd_pcm_oss_set_trigger(snd_pcm_oss_file_t *pcm_oss_file, int trigger
cmd
=
SNDRV_PCM_IOCTL_DROP
;
cmd
=
SNDRV_PCM_IOCTL_DROP
;
runtime
->
oss
.
prepare
=
1
;
runtime
->
oss
.
prepare
=
1
;
}
}
err
=
snd_pcm_kernel_playback_ioctl
(
psubstream
,
cmd
,
0
);
err
=
snd_pcm_kernel_playback_ioctl
(
psubstream
,
cmd
,
NULL
);
if
(
err
<
0
)
if
(
err
<
0
)
return
err
;
return
err
;
}
}
...
@@ -1423,7 +1423,7 @@ static int snd_pcm_oss_set_trigger(snd_pcm_oss_file_t *pcm_oss_file, int trigger
...
@@ -1423,7 +1423,7 @@ static int snd_pcm_oss_set_trigger(snd_pcm_oss_file_t *pcm_oss_file, int trigger
cmd
=
SNDRV_PCM_IOCTL_DROP
;
cmd
=
SNDRV_PCM_IOCTL_DROP
;
runtime
->
oss
.
prepare
=
1
;
runtime
->
oss
.
prepare
=
1
;
}
}
err
=
snd_pcm_kernel_capture_ioctl
(
csubstream
,
cmd
,
0
);
err
=
snd_pcm_kernel_capture_ioctl
(
csubstream
,
cmd
,
NULL
);
if
(
err
<
0
)
if
(
err
<
0
)
return
err
;
return
err
;
}
}
...
...
sound/core/oss/pcm_plugin.c
View file @
c64c8daa
...
@@ -797,7 +797,7 @@ snd_pcm_sframes_t snd_pcm_plug_write_transfer(snd_pcm_plug_t *plug, snd_pcm_plug
...
@@ -797,7 +797,7 @@ snd_pcm_sframes_t snd_pcm_plug_write_transfer(snd_pcm_plug_t *plug, snd_pcm_plug
frames
=
plugin
->
src_frames
(
plugin
,
frames1
);
frames
=
plugin
->
src_frames
(
plugin
,
frames1
);
}
}
}
else
}
else
dst_channels
=
0
;
dst_channels
=
NULL
;
pdprintf
(
"write plugin: %s, %li
\n
"
,
plugin
->
name
,
frames
);
pdprintf
(
"write plugin: %s, %li
\n
"
,
plugin
->
name
,
frames
);
if
((
frames
=
plugin
->
transfer
(
plugin
,
src_channels
,
dst_channels
,
frames
))
<
0
)
if
((
frames
=
plugin
->
transfer
(
plugin
,
src_channels
,
dst_channels
,
frames
))
<
0
)
return
frames
;
return
frames
;
...
@@ -818,7 +818,7 @@ snd_pcm_sframes_t snd_pcm_plug_read_transfer(snd_pcm_plug_t *plug, snd_pcm_plugi
...
@@ -818,7 +818,7 @@ snd_pcm_sframes_t snd_pcm_plug_read_transfer(snd_pcm_plug_t *plug, snd_pcm_plugi
if
(
frames
<
0
)
if
(
frames
<
0
)
return
frames
;
return
frames
;
src_channels
=
0
;
src_channels
=
NULL
;
plugin
=
snd_pcm_plug_first
(
plug
);
plugin
=
snd_pcm_plug_first
(
plug
);
while
(
plugin
&&
frames
>
0
)
{
while
(
plugin
&&
frames
>
0
)
{
if
((
next
=
plugin
->
next
)
!=
NULL
)
{
if
((
next
=
plugin
->
next
)
!=
NULL
)
{
...
...
sound/core/oss/route.c
View file @
c64c8daa
...
@@ -95,7 +95,7 @@ static void route_to_channel_from_one(snd_pcm_plugin_t *plugin,
...
@@ -95,7 +95,7 @@ static void route_to_channel_from_one(snd_pcm_plugin_t *plugin,
#undef CONV_LABELS
#undef CONV_LABELS
route_t
*
data
=
(
route_t
*
)
plugin
->
extra_data
;
route_t
*
data
=
(
route_t
*
)
plugin
->
extra_data
;
void
*
conv
;
void
*
conv
;
const
snd_pcm_plugin_channel_t
*
src_channel
=
0
;
const
snd_pcm_plugin_channel_t
*
src_channel
=
NULL
;
unsigned
int
srcidx
;
unsigned
int
srcidx
;
char
*
src
,
*
dst
;
char
*
src
,
*
dst
;
int
src_step
,
dst_step
;
int
src_step
,
dst_step
;
...
@@ -149,11 +149,11 @@ static void route_to_channel(snd_pcm_plugin_t *plugin,
...
@@ -149,11 +149,11 @@ static void route_to_channel(snd_pcm_plugin_t *plugin,
#endif
#endif
};
};
/* sum_type att shift */
/* sum_type att shift */
static
void
*
norm_labels
[
3
*
2
*
4
]
=
{
0
,
static
void
*
norm_labels
[
3
*
2
*
4
]
=
{
NULL
,
&&
norm_int32_8_noatt
,
&&
norm_int32_8_noatt
,
&&
norm_int32_16_noatt
,
&&
norm_int32_16_noatt
,
&&
norm_int32_24_noatt
,
&&
norm_int32_24_noatt
,
0
,
NULL
,
&&
norm_int32_8_att
,
&&
norm_int32_8_att
,
&&
norm_int32_16_att
,
&&
norm_int32_16_att
,
&&
norm_int32_24_att
,
&&
norm_int32_24_att
,
...
@@ -462,7 +462,7 @@ static int route_load_ttable(snd_pcm_plugin_t *plugin,
...
@@ -462,7 +462,7 @@ static int route_load_ttable(snd_pcm_plugin_t *plugin,
for
(
srcidx
=
0
;
srcidx
<
nsrcs
;
srcidx
++
)
for
(
srcidx
=
0
;
srcidx
<
nsrcs
;
srcidx
++
)
dptr
->
srcs
[
srcidx
]
=
srcs
[
srcidx
];
dptr
->
srcs
[
srcidx
]
=
srcs
[
srcidx
];
}
else
}
else
dptr
->
srcs
=
0
;
dptr
->
srcs
=
NULL
;
dptr
++
;
dptr
++
;
}
}
return
0
;
return
0
;
...
...
sound/core/pcm_lib.c
View file @
c64c8daa
...
@@ -1559,7 +1559,7 @@ int snd_pcm_hw_param_set(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
...
@@ -1559,7 +1559,7 @@ int snd_pcm_hw_param_set(snd_pcm_t *pcm, snd_pcm_hw_params_t *params,
if
(
err
<
0
)
if
(
err
<
0
)
return
err
;
return
err
;
}
}
return
snd_pcm_hw_param_value
(
params
,
var
,
0
);
return
snd_pcm_hw_param_value
(
params
,
var
,
NULL
);
}
}
int
_snd_pcm_hw_param_mask
(
snd_pcm_hw_params_t
*
params
,
int
_snd_pcm_hw_param_mask
(
snd_pcm_hw_params_t
*
params
,
...
@@ -1735,28 +1735,28 @@ int snd_pcm_hw_params_choose(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
...
@@ -1735,28 +1735,28 @@ int snd_pcm_hw_params_choose(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
{
{
int
err
;
int
err
;
err
=
snd_pcm_hw_param_first
(
pcm
,
params
,
SNDRV_PCM_HW_PARAM_ACCESS
,
0
);
err
=
snd_pcm_hw_param_first
(
pcm
,
params
,
SNDRV_PCM_HW_PARAM_ACCESS
,
NULL
);
assert
(
err
>=
0
);
assert
(
err
>=
0
);
err
=
snd_pcm_hw_param_first
(
pcm
,
params
,
SNDRV_PCM_HW_PARAM_FORMAT
,
0
);
err
=
snd_pcm_hw_param_first
(
pcm
,
params
,
SNDRV_PCM_HW_PARAM_FORMAT
,
NULL
);
assert
(
err
>=
0
);
assert
(
err
>=
0
);
err
=
snd_pcm_hw_param_first
(
pcm
,
params
,
SNDRV_PCM_HW_PARAM_SUBFORMAT
,
0
);
err
=
snd_pcm_hw_param_first
(
pcm
,
params
,
SNDRV_PCM_HW_PARAM_SUBFORMAT
,
NULL
);
assert
(
err
>=
0
);
assert
(
err
>=
0
);
err
=
snd_pcm_hw_param_first
(
pcm
,
params
,
SNDRV_PCM_HW_PARAM_CHANNELS
,
0
);
err
=
snd_pcm_hw_param_first
(
pcm
,
params
,
SNDRV_PCM_HW_PARAM_CHANNELS
,
NULL
);
assert
(
err
>=
0
);
assert
(
err
>=
0
);
err
=
snd_pcm_hw_param_first
(
pcm
,
params
,
SNDRV_PCM_HW_PARAM_RATE
,
0
);
err
=
snd_pcm_hw_param_first
(
pcm
,
params
,
SNDRV_PCM_HW_PARAM_RATE
,
NULL
);
assert
(
err
>=
0
);
assert
(
err
>=
0
);
err
=
snd_pcm_hw_param_first
(
pcm
,
params
,
SNDRV_PCM_HW_PARAM_PERIOD_TIME
,
0
);
err
=
snd_pcm_hw_param_first
(
pcm
,
params
,
SNDRV_PCM_HW_PARAM_PERIOD_TIME
,
NULL
);
assert
(
err
>=
0
);
assert
(
err
>=
0
);
err
=
snd_pcm_hw_param_last
(
pcm
,
params
,
SNDRV_PCM_HW_PARAM_BUFFER_SIZE
,
0
);
err
=
snd_pcm_hw_param_last
(
pcm
,
params
,
SNDRV_PCM_HW_PARAM_BUFFER_SIZE
,
NULL
);
assert
(
err
>=
0
);
assert
(
err
>=
0
);
err
=
snd_pcm_hw_param_first
(
pcm
,
params
,
SNDRV_PCM_HW_PARAM_TICK_TIME
,
0
);
err
=
snd_pcm_hw_param_first
(
pcm
,
params
,
SNDRV_PCM_HW_PARAM_TICK_TIME
,
NULL
);
assert
(
err
>=
0
);
assert
(
err
>=
0
);
return
0
;
return
0
;
...
...
sound/core/pcm_native.c
View file @
c64c8daa
...
@@ -1100,7 +1100,7 @@ static int snd_pcm_pre_reset(snd_pcm_substream_t * substream, int state)
...
@@ -1100,7 +1100,7 @@ static int snd_pcm_pre_reset(snd_pcm_substream_t * substream, int state)
static
int
snd_pcm_do_reset
(
snd_pcm_substream_t
*
substream
,
int
state
)
static
int
snd_pcm_do_reset
(
snd_pcm_substream_t
*
substream
,
int
state
)
{
{
snd_pcm_runtime_t
*
runtime
=
substream
->
runtime
;
snd_pcm_runtime_t
*
runtime
=
substream
->
runtime
;
int
err
=
substream
->
ops
->
ioctl
(
substream
,
SNDRV_PCM_IOCTL1_RESET
,
0
);
int
err
=
substream
->
ops
->
ioctl
(
substream
,
SNDRV_PCM_IOCTL1_RESET
,
NULL
);
if
(
err
<
0
)
if
(
err
<
0
)
return
err
;
return
err
;
// snd_assert(runtime->status->hw_ptr < runtime->buffer_size, );
// snd_assert(runtime->status->hw_ptr < runtime->buffer_size, );
...
@@ -1475,18 +1475,18 @@ static struct file *snd_pcm_file_fd(int fd)
...
@@ -1475,18 +1475,18 @@ static struct file *snd_pcm_file_fd(int fd)
unsigned
short
minor
;
unsigned
short
minor
;
file
=
fget
(
fd
);
file
=
fget
(
fd
);
if
(
!
file
)
if
(
!
file
)
return
0
;
return
NULL
;
inode
=
file
->
f_dentry
->
d_inode
;
inode
=
file
->
f_dentry
->
d_inode
;
if
(
!
S_ISCHR
(
inode
->
i_mode
)
||
if
(
!
S_ISCHR
(
inode
->
i_mode
)
||
imajor
(
inode
)
!=
snd_major
)
{
imajor
(
inode
)
!=
snd_major
)
{
fput
(
file
);
fput
(
file
);
return
0
;
return
NULL
;
}
}
minor
=
iminor
(
inode
);
minor
=
iminor
(
inode
);
if
(
minor
>=
256
||
if
(
minor
>=
256
||
minor
%
SNDRV_MINOR_DEVICES
<
SNDRV_MINOR_PCM_PLAYBACK
)
{
minor
%
SNDRV_MINOR_DEVICES
<
SNDRV_MINOR_PCM_PLAYBACK
)
{
fput
(
file
);
fput
(
file
);
return
0
;
return
NULL
;
}
}
return
file
;
return
file
;
}
}
...
@@ -1701,23 +1701,23 @@ int snd_pcm_hw_constraints_init(snd_pcm_substream_t *substream)
...
@@ -1701,23 +1701,23 @@ int snd_pcm_hw_constraints_init(snd_pcm_substream_t *substream)
snd_interval_setinteger
(
constrs_interval
(
constrs
,
SNDRV_PCM_HW_PARAM_FRAME_BITS
));
snd_interval_setinteger
(
constrs_interval
(
constrs
,
SNDRV_PCM_HW_PARAM_FRAME_BITS
));
err
=
snd_pcm_hw_rule_add
(
runtime
,
0
,
SNDRV_PCM_HW_PARAM_FORMAT
,
err
=
snd_pcm_hw_rule_add
(
runtime
,
0
,
SNDRV_PCM_HW_PARAM_FORMAT
,
snd_pcm_hw_rule_format
,
0
,
snd_pcm_hw_rule_format
,
NULL
,
SNDRV_PCM_HW_PARAM_SAMPLE_BITS
,
-
1
);
SNDRV_PCM_HW_PARAM_SAMPLE_BITS
,
-
1
);
if
(
err
<
0
)
if
(
err
<
0
)
return
err
;
return
err
;
err
=
snd_pcm_hw_rule_add
(
runtime
,
0
,
SNDRV_PCM_HW_PARAM_SAMPLE_BITS
,
err
=
snd_pcm_hw_rule_add
(
runtime
,
0
,
SNDRV_PCM_HW_PARAM_SAMPLE_BITS
,
snd_pcm_hw_rule_sample_bits
,
0
,
snd_pcm_hw_rule_sample_bits
,
NULL
,
SNDRV_PCM_HW_PARAM_FORMAT
,
SNDRV_PCM_HW_PARAM_FORMAT
,
SNDRV_PCM_HW_PARAM_SAMPLE_BITS
,
-
1
);
SNDRV_PCM_HW_PARAM_SAMPLE_BITS
,
-
1
);
if
(
err
<
0
)
if
(
err
<
0
)
return
err
;
return
err
;
err
=
snd_pcm_hw_rule_add
(
runtime
,
0
,
SNDRV_PCM_HW_PARAM_SAMPLE_BITS
,
err
=
snd_pcm_hw_rule_add
(
runtime
,
0
,
SNDRV_PCM_HW_PARAM_SAMPLE_BITS
,
snd_pcm_hw_rule_div
,
0
,
snd_pcm_hw_rule_div
,
NULL
,
SNDRV_PCM_HW_PARAM_FRAME_BITS
,
SNDRV_PCM_HW_PARAM_CHANNELS
,
-
1
);
SNDRV_PCM_HW_PARAM_FRAME_BITS
,
SNDRV_PCM_HW_PARAM_CHANNELS
,
-
1
);
if
(
err
<
0
)
if
(
err
<
0
)
return
err
;
return
err
;
err
=
snd_pcm_hw_rule_add
(
runtime
,
0
,
SNDRV_PCM_HW_PARAM_FRAME_BITS
,
err
=
snd_pcm_hw_rule_add
(
runtime
,
0
,
SNDRV_PCM_HW_PARAM_FRAME_BITS
,
snd_pcm_hw_rule_mul
,
0
,
snd_pcm_hw_rule_mul
,
NULL
,
SNDRV_PCM_HW_PARAM_SAMPLE_BITS
,
SNDRV_PCM_HW_PARAM_CHANNELS
,
-
1
);
SNDRV_PCM_HW_PARAM_SAMPLE_BITS
,
SNDRV_PCM_HW_PARAM_CHANNELS
,
-
1
);
if
(
err
<
0
)
if
(
err
<
0
)
return
err
;
return
err
;
...
@@ -1732,7 +1732,7 @@ int snd_pcm_hw_constraints_init(snd_pcm_substream_t *substream)
...
@@ -1732,7 +1732,7 @@ int snd_pcm_hw_constraints_init(snd_pcm_substream_t *substream)
if
(
err
<
0
)
if
(
err
<
0
)
return
err
;
return
err
;
err
=
snd_pcm_hw_rule_add
(
runtime
,
0
,
SNDRV_PCM_HW_PARAM_CHANNELS
,
err
=
snd_pcm_hw_rule_add
(
runtime
,
0
,
SNDRV_PCM_HW_PARAM_CHANNELS
,
snd_pcm_hw_rule_div
,
0
,
snd_pcm_hw_rule_div
,
NULL
,
SNDRV_PCM_HW_PARAM_FRAME_BITS
,
SNDRV_PCM_HW_PARAM_SAMPLE_BITS
,
-
1
);
SNDRV_PCM_HW_PARAM_FRAME_BITS
,
SNDRV_PCM_HW_PARAM_SAMPLE_BITS
,
-
1
);
if
(
err
<
0
)
if
(
err
<
0
)
return
err
;
return
err
;
...
@@ -1747,12 +1747,12 @@ int snd_pcm_hw_constraints_init(snd_pcm_substream_t *substream)
...
@@ -1747,12 +1747,12 @@ int snd_pcm_hw_constraints_init(snd_pcm_substream_t *substream)
if
(
err
<
0
)
if
(
err
<
0
)
return
err
;
return
err
;
err
=
snd_pcm_hw_rule_add
(
runtime
,
0
,
SNDRV_PCM_HW_PARAM_PERIODS
,
err
=
snd_pcm_hw_rule_add
(
runtime
,
0
,
SNDRV_PCM_HW_PARAM_PERIODS
,
snd_pcm_hw_rule_div
,
0
,
snd_pcm_hw_rule_div
,
NULL
,
SNDRV_PCM_HW_PARAM_BUFFER_SIZE
,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE
,
-
1
);
SNDRV_PCM_HW_PARAM_BUFFER_SIZE
,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE
,
-
1
);
if
(
err
<
0
)
if
(
err
<
0
)
return
err
;
return
err
;
err
=
snd_pcm_hw_rule_add
(
runtime
,
0
,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE
,
err
=
snd_pcm_hw_rule_add
(
runtime
,
0
,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE
,
snd_pcm_hw_rule_div
,
0
,
snd_pcm_hw_rule_div
,
NULL
,
SNDRV_PCM_HW_PARAM_BUFFER_SIZE
,
SNDRV_PCM_HW_PARAM_PERIODS
,
-
1
);
SNDRV_PCM_HW_PARAM_BUFFER_SIZE
,
SNDRV_PCM_HW_PARAM_PERIODS
,
-
1
);
if
(
err
<
0
)
if
(
err
<
0
)
return
err
;
return
err
;
...
@@ -1767,7 +1767,7 @@ int snd_pcm_hw_constraints_init(snd_pcm_substream_t *substream)
...
@@ -1767,7 +1767,7 @@ int snd_pcm_hw_constraints_init(snd_pcm_substream_t *substream)
if
(
err
<
0
)
if
(
err
<
0
)
return
err
;
return
err
;
err
=
snd_pcm_hw_rule_add
(
runtime
,
0
,
SNDRV_PCM_HW_PARAM_BUFFER_SIZE
,
err
=
snd_pcm_hw_rule_add
(
runtime
,
0
,
SNDRV_PCM_HW_PARAM_BUFFER_SIZE
,
snd_pcm_hw_rule_mul
,
0
,
snd_pcm_hw_rule_mul
,
NULL
,
SNDRV_PCM_HW_PARAM_PERIOD_SIZE
,
SNDRV_PCM_HW_PARAM_PERIODS
,
-
1
);
SNDRV_PCM_HW_PARAM_PERIOD_SIZE
,
SNDRV_PCM_HW_PARAM_PERIODS
,
-
1
);
if
(
err
<
0
)
if
(
err
<
0
)
return
err
;
return
err
;
...
...
sound/pci/intel8x0.c
View file @
c64c8daa
...
@@ -2617,7 +2617,7 @@ static struct shortname_table {
...
@@ -2617,7 +2617,7 @@ static struct shortname_table {
{
0x746d
,
"AMD AMD8111"
},
{
0x746d
,
"AMD AMD8111"
},
{
0x7445
,
"AMD AMD768"
},
{
0x7445
,
"AMD AMD768"
},
{
0x5455
,
"ALi M5455"
},
{
0x5455
,
"ALi M5455"
},
{
0
,
0
},
{
0
,
NULL
},
};
};
static
int
__devinit
snd_intel8x0_probe
(
struct
pci_dev
*
pci
,
static
int
__devinit
snd_intel8x0_probe
(
struct
pci_dev
*
pci
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment