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
nexedi
linux
Commits
a500bcb7
Commit
a500bcb7
authored
Jun 03, 2004
by
Alexander Viro
Committed by
Linus Torvalds
Jun 03, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] sparse: msnd annotation
msnd annotated
parent
a83d576c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
22 deletions
+23
-22
sound/oss/msnd_pinnacle.c
sound/oss/msnd_pinnacle.c
+23
-22
No files found.
sound/oss/msnd_pinnacle.c
View file @
a500bcb7
...
@@ -212,6 +212,7 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
...
@@ -212,6 +212,7 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
LPDAQD
lpDAQ
,
lpDARQ
;
LPDAQD
lpDAQ
,
lpDARQ
;
audio_buf_info
abinfo
;
audio_buf_info
abinfo
;
unsigned
long
flags
;
unsigned
long
flags
;
int
__user
*
p
=
(
int
__user
*
)
arg
;
lpDAQ
=
dev
.
base
+
DAPQ_DATA_BUFF
;
lpDAQ
=
dev
.
base
+
DAPQ_DATA_BUFF
;
lpDARQ
=
dev
.
base
+
DARQ_DATA_BUFF
;
lpDARQ
=
dev
.
base
+
DARQ_DATA_BUFF
;
...
@@ -238,7 +239,7 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
...
@@ -238,7 +239,7 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
abinfo
.
fragstotal
=
dev
.
DAPF
.
n
/
abinfo
.
fragsize
;
abinfo
.
fragstotal
=
dev
.
DAPF
.
n
/
abinfo
.
fragsize
;
abinfo
.
fragments
=
abinfo
.
bytes
/
abinfo
.
fragsize
;
abinfo
.
fragments
=
abinfo
.
bytes
/
abinfo
.
fragsize
;
spin_unlock_irqrestore
(
&
dev
.
lock
,
flags
);
spin_unlock_irqrestore
(
&
dev
.
lock
,
flags
);
return
copy_to_user
((
void
*
)
arg
,
&
abinfo
,
sizeof
(
abinfo
))
?
-
EFAULT
:
0
;
return
copy_to_user
((
void
__user
*
)
arg
,
&
abinfo
,
sizeof
(
abinfo
))
?
-
EFAULT
:
0
;
case
SNDCTL_DSP_GETISPACE
:
case
SNDCTL_DSP_GETISPACE
:
if
(
!
(
file
->
f_mode
&
FMODE_READ
))
if
(
!
(
file
->
f_mode
&
FMODE_READ
))
...
@@ -249,7 +250,7 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
...
@@ -249,7 +250,7 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
abinfo
.
fragstotal
=
dev
.
DARF
.
n
/
abinfo
.
fragsize
;
abinfo
.
fragstotal
=
dev
.
DARF
.
n
/
abinfo
.
fragsize
;
abinfo
.
fragments
=
abinfo
.
bytes
/
abinfo
.
fragsize
;
abinfo
.
fragments
=
abinfo
.
bytes
/
abinfo
.
fragsize
;
spin_unlock_irqrestore
(
&
dev
.
lock
,
flags
);
spin_unlock_irqrestore
(
&
dev
.
lock
,
flags
);
return
copy_to_user
((
void
*
)
arg
,
&
abinfo
,
sizeof
(
abinfo
))
?
-
EFAULT
:
0
;
return
copy_to_user
((
void
__user
*
)
arg
,
&
abinfo
,
sizeof
(
abinfo
))
?
-
EFAULT
:
0
;
case
SNDCTL_DSP_RESET
:
case
SNDCTL_DSP_RESET
:
dev
.
nresets
=
0
;
dev
.
nresets
=
0
;
...
@@ -262,18 +263,18 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
...
@@ -262,18 +263,18 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
case
SNDCTL_DSP_GETBLKSIZE
:
case
SNDCTL_DSP_GETBLKSIZE
:
tmp
=
dsp_get_frag_size
();
tmp
=
dsp_get_frag_size
();
if
(
put_user
(
tmp
,
(
int
*
)
arg
))
if
(
put_user
(
tmp
,
p
))
return
-
EFAULT
;
return
-
EFAULT
;
return
0
;
return
0
;
case
SNDCTL_DSP_GETFMTS
:
case
SNDCTL_DSP_GETFMTS
:
val
=
AFMT_S16_LE
|
AFMT_U8
;
val
=
AFMT_S16_LE
|
AFMT_U8
;
if
(
put_user
(
val
,
(
int
*
)
arg
))
if
(
put_user
(
val
,
p
))
return
-
EFAULT
;
return
-
EFAULT
;
return
0
;
return
0
;
case
SNDCTL_DSP_SETFMT
:
case
SNDCTL_DSP_SETFMT
:
if
(
get_user
(
val
,
(
int
*
)
arg
))
if
(
get_user
(
val
,
p
))
return
-
EFAULT
;
return
-
EFAULT
;
if
(
file
->
f_mode
&
FMODE_WRITE
)
if
(
file
->
f_mode
&
FMODE_WRITE
)
...
@@ -285,7 +286,7 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
...
@@ -285,7 +286,7 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
?
dev
.
rec_sample_size
?
dev
.
rec_sample_size
:
dsp_set_format
(
file
,
val
);
:
dsp_set_format
(
file
,
val
);
if
(
put_user
(
data
,
(
int
*
)
arg
))
if
(
put_user
(
data
,
p
))
return
-
EFAULT
;
return
-
EFAULT
;
return
0
;
return
0
;
...
@@ -299,12 +300,12 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
...
@@ -299,12 +300,12 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
case
SNDCTL_DSP_GETCAPS
:
case
SNDCTL_DSP_GETCAPS
:
val
=
DSP_CAP_DUPLEX
|
DSP_CAP_BATCH
;
val
=
DSP_CAP_DUPLEX
|
DSP_CAP_BATCH
;
if
(
put_user
(
val
,
(
int
*
)
arg
))
if
(
put_user
(
val
,
p
))
return
-
EFAULT
;
return
-
EFAULT
;
return
0
;
return
0
;
case
SNDCTL_DSP_SPEED
:
case
SNDCTL_DSP_SPEED
:
if
(
get_user
(
val
,
(
int
*
)
arg
))
if
(
get_user
(
val
,
p
))
return
-
EFAULT
;
return
-
EFAULT
;
if
(
val
<
8000
)
if
(
val
<
8000
)
...
@@ -326,13 +327,13 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
...
@@ -326,13 +327,13 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
if
(
file
->
f_mode
&
FMODE_READ
)
if
(
file
->
f_mode
&
FMODE_READ
)
dev
.
rec_sample_rate
=
data
;
dev
.
rec_sample_rate
=
data
;
if
(
put_user
(
data
,
(
int
*
)
arg
))
if
(
put_user
(
data
,
p
))
return
-
EFAULT
;
return
-
EFAULT
;
return
0
;
return
0
;
case
SNDCTL_DSP_CHANNELS
:
case
SNDCTL_DSP_CHANNELS
:
case
SNDCTL_DSP_STEREO
:
case
SNDCTL_DSP_STEREO
:
if
(
get_user
(
val
,
(
int
*
)
arg
))
if
(
get_user
(
val
,
p
))
return
-
EFAULT
;
return
-
EFAULT
;
if
(
cmd
==
SNDCTL_DSP_CHANNELS
)
{
if
(
cmd
==
SNDCTL_DSP_CHANNELS
)
{
...
@@ -369,7 +370,7 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
...
@@ -369,7 +370,7 @@ static int dsp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
if
(
file
->
f_mode
&
FMODE_READ
)
if
(
file
->
f_mode
&
FMODE_READ
)
dev
.
rec_channels
=
data
;
dev
.
rec_channels
=
data
;
if
(
put_user
(
val
,
(
int
*
)
arg
))
if
(
put_user
(
val
,
p
))
return
-
EFAULT
;
return
-
EFAULT
;
return
0
;
return
0
;
}
}
...
@@ -565,13 +566,13 @@ static int mixer_ioctl(unsigned int cmd, unsigned long arg)
...
@@ -565,13 +566,13 @@ static int mixer_ioctl(unsigned int cmd, unsigned long arg)
mixer_info
info
;
mixer_info
info
;
set_mixer_info
();
set_mixer_info
();
info
.
modify_counter
=
dev
.
mixer_mod_count
;
info
.
modify_counter
=
dev
.
mixer_mod_count
;
if
(
copy_to_user
((
void
*
)
arg
,
&
info
,
sizeof
(
info
)))
if
(
copy_to_user
((
void
__user
*
)
arg
,
&
info
,
sizeof
(
info
)))
return
-
EFAULT
;
return
-
EFAULT
;
return
0
;
return
0
;
}
else
if
(
cmd
==
SOUND_OLD_MIXER_INFO
)
{
}
else
if
(
cmd
==
SOUND_OLD_MIXER_INFO
)
{
_old_mixer_info
info
;
_old_mixer_info
info
;
set_mixer_info
();
set_mixer_info
();
if
(
copy_to_user
((
void
*
)
arg
,
&
info
,
sizeof
(
info
)))
if
(
copy_to_user
((
void
__user
*
)
arg
,
&
info
,
sizeof
(
info
)))
return
-
EFAULT
;
return
-
EFAULT
;
return
0
;
return
0
;
}
else
if
(
cmd
==
SOUND_MIXER_PRIVATE1
)
{
}
else
if
(
cmd
==
SOUND_MIXER_PRIVATE1
)
{
...
@@ -584,19 +585,19 @@ static int mixer_ioctl(unsigned int cmd, unsigned long arg)
...
@@ -584,19 +585,19 @@ static int mixer_ioctl(unsigned int cmd, unsigned long arg)
if
(
_SIOC_DIR
(
cmd
)
&
_SIOC_WRITE
)
{
if
(
_SIOC_DIR
(
cmd
)
&
_SIOC_WRITE
)
{
switch
(
cmd
&
0xff
)
{
switch
(
cmd
&
0xff
)
{
case
SOUND_MIXER_RECSRC
:
case
SOUND_MIXER_RECSRC
:
if
(
get_user
(
val
,
(
int
*
)
arg
))
if
(
get_user
(
val
,
(
int
__user
*
)
arg
))
return
-
EFAULT
;
return
-
EFAULT
;
val
=
set_recsrc
(
val
);
val
=
set_recsrc
(
val
);
break
;
break
;
default:
default:
if
(
get_user
(
val
,
(
int
*
)
arg
))
if
(
get_user
(
val
,
(
int
__user
*
)
arg
))
return
-
EFAULT
;
return
-
EFAULT
;
val
=
mixer_set
(
cmd
&
0xff
,
val
);
val
=
mixer_set
(
cmd
&
0xff
,
val
);
break
;
break
;
}
}
++
dev
.
mixer_mod_count
;
++
dev
.
mixer_mod_count
;
return
put_user
(
val
,
(
int
*
)
arg
);
return
put_user
(
val
,
(
int
__user
*
)
arg
);
}
else
{
}
else
{
switch
(
cmd
&
0xff
)
{
switch
(
cmd
&
0xff
)
{
case
SOUND_MIXER_RECSRC
:
case
SOUND_MIXER_RECSRC
:
...
@@ -638,7 +639,7 @@ static int mixer_ioctl(unsigned int cmd, unsigned long arg)
...
@@ -638,7 +639,7 @@ static int mixer_ioctl(unsigned int cmd, unsigned long arg)
}
}
}
}
return
put_user
(
val
,
(
int
*
)
arg
);
return
put_user
(
val
,
(
int
__user
*
)
arg
);
}
}
return
-
EINVAL
;
return
-
EINVAL
;
...
@@ -650,7 +651,7 @@ static int dev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
...
@@ -650,7 +651,7 @@ static int dev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
if
(
cmd
==
OSS_GETVERSION
)
{
if
(
cmd
==
OSS_GETVERSION
)
{
int
sound_version
=
SOUND_VERSION
;
int
sound_version
=
SOUND_VERSION
;
return
put_user
(
sound_version
,
(
int
*
)
arg
);
return
put_user
(
sound_version
,
(
int
__user
*
)
arg
);
}
}
if
(
minor
==
dev
.
dsp_minor
)
if
(
minor
==
dev
.
dsp_minor
)
...
@@ -888,7 +889,7 @@ static __inline__ int pack_DAPF_to_DAPQ(register int start)
...
@@ -888,7 +889,7 @@ static __inline__ int pack_DAPF_to_DAPQ(register int start)
return
nbanks
;
return
nbanks
;
}
}
static
int
dsp_read
(
char
*
buf
,
size_t
len
)
static
int
dsp_read
(
char
__user
*
buf
,
size_t
len
)
{
{
int
count
=
len
;
int
count
=
len
;
char
*
page
=
(
char
*
)
__get_free_page
(
PAGE_SIZE
);
char
*
page
=
(
char
*
)
__get_free_page
(
PAGE_SIZE
);
...
@@ -946,7 +947,7 @@ static int dsp_read(char *buf, size_t len)
...
@@ -946,7 +947,7 @@ static int dsp_read(char *buf, size_t len)
return
len
-
count
;
return
len
-
count
;
}
}
static
int
dsp_write
(
const
char
*
buf
,
size_t
len
)
static
int
dsp_write
(
const
char
__user
*
buf
,
size_t
len
)
{
{
int
count
=
len
;
int
count
=
len
;
char
*
page
=
(
char
*
)
__get_free_page
(
GFP_KERNEL
);
char
*
page
=
(
char
*
)
__get_free_page
(
GFP_KERNEL
);
...
@@ -1005,7 +1006,7 @@ static int dsp_write(const char *buf, size_t len)
...
@@ -1005,7 +1006,7 @@ static int dsp_write(const char *buf, size_t len)
return
len
-
count
;
return
len
-
count
;
}
}
static
ssize_t
dev_read
(
struct
file
*
file
,
char
*
buf
,
size_t
count
,
loff_t
*
off
)
static
ssize_t
dev_read
(
struct
file
*
file
,
char
__user
*
buf
,
size_t
count
,
loff_t
*
off
)
{
{
int
minor
=
iminor
(
file
->
f_dentry
->
d_inode
);
int
minor
=
iminor
(
file
->
f_dentry
->
d_inode
);
if
(
minor
==
dev
.
dsp_minor
)
if
(
minor
==
dev
.
dsp_minor
)
...
@@ -1014,7 +1015,7 @@ static ssize_t dev_read(struct file *file, char *buf, size_t count, loff_t *off)
...
@@ -1014,7 +1015,7 @@ static ssize_t dev_read(struct file *file, char *buf, size_t count, loff_t *off)
return
-
EINVAL
;
return
-
EINVAL
;
}
}
static
ssize_t
dev_write
(
struct
file
*
file
,
const
char
*
buf
,
size_t
count
,
loff_t
*
off
)
static
ssize_t
dev_write
(
struct
file
*
file
,
const
char
__user
*
buf
,
size_t
count
,
loff_t
*
off
)
{
{
int
minor
=
iminor
(
file
->
f_dentry
->
d_inode
);
int
minor
=
iminor
(
file
->
f_dentry
->
d_inode
);
if
(
minor
==
dev
.
dsp_minor
)
if
(
minor
==
dev
.
dsp_minor
)
...
...
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