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
1274bd1e
Commit
1274bd1e
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: forte annotation
forte annotated
parent
a500bcb7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
27 deletions
+29
-27
sound/oss/forte.c
sound/oss/forte.c
+29
-27
No files found.
sound/oss/forte.c
View file @
1274bd1e
...
...
@@ -849,6 +849,8 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
struct
forte_chip
*
chip
;
struct
audio_buf_info
abi
;
struct
count_info
cinfo
;
void
__user
*
argp
=
(
void
__user
*
)
arg
;
int
__user
*
p
=
argp
;
chip
=
file
->
private_data
;
...
...
@@ -865,24 +867,24 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
switch
(
cmd
)
{
case
OSS_GETVERSION
:
return
put_user
(
SOUND_VERSION
,
(
int
*
)
arg
);
return
put_user
(
SOUND_VERSION
,
p
);
case
SNDCTL_DSP_GETCAPS
:
DPRINTK
(
"%s: GETCAPS
\n
"
,
__FUNCTION__
);
ival
=
FORTE_CAPS
;
/* DUPLEX */
return
put_user
(
ival
,
(
int
*
)
arg
);
return
put_user
(
ival
,
p
);
case
SNDCTL_DSP_GETFMTS
:
DPRINTK
(
"%s: GETFMTS
\n
"
,
__FUNCTION__
);
ival
=
FORTE_FMTS
;
/* U8, 16LE */
return
put_user
(
ival
,
(
int
*
)
arg
);
return
put_user
(
ival
,
p
);
case
SNDCTL_DSP_SETFMT
:
/* U8, 16LE */
DPRINTK
(
"%s: SETFMT
\n
"
,
__FUNCTION__
);
if
(
get_user
(
ival
,
(
int
*
)
arg
))
if
(
get_user
(
ival
,
p
))
return
-
EFAULT
;
spin_lock_irq
(
&
chip
->
lock
);
...
...
@@ -899,12 +901,12 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
spin_unlock_irq
(
&
chip
->
lock
);
return
put_user
(
rval
,
(
int
*
)
arg
);
return
put_user
(
rval
,
p
);
case
SNDCTL_DSP_STEREO
:
/* 0 - mono, 1 - stereo */
DPRINTK
(
"%s: STEREO
\n
"
,
__FUNCTION__
);
if
(
get_user
(
ival
,
(
int
*
)
arg
))
if
(
get_user
(
ival
,
p
))
return
-
EFAULT
;
spin_lock_irq
(
&
chip
->
lock
);
...
...
@@ -921,12 +923,12 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
spin_unlock_irq
(
&
chip
->
lock
);
return
put_user
(
rval
,
(
int
*
)
arg
);
return
put_user
(
rval
,
p
);
case
SNDCTL_DSP_CHANNELS
:
/* 1 - mono, 2 - stereo */
DPRINTK
(
"%s: CHANNELS
\n
"
,
__FUNCTION__
);
if
(
get_user
(
ival
,
(
int
*
)
arg
))
if
(
get_user
(
ival
,
p
))
return
-
EFAULT
;
spin_lock_irq
(
&
chip
->
lock
);
...
...
@@ -943,12 +945,12 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
spin_unlock_irq
(
&
chip
->
lock
);
return
put_user
(
rval
,
(
int
*
)
arg
);
return
put_user
(
rval
,
p
);
case
SNDCTL_DSP_SPEED
:
DPRINTK
(
"%s: SPEED
\n
"
,
__FUNCTION__
);
if
(
get_user
(
ival
,
(
int
*
)
arg
))
if
(
get_user
(
ival
,
p
))
return
-
EFAULT
;
spin_lock_irq
(
&
chip
->
lock
);
...
...
@@ -965,7 +967,7 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
spin_unlock_irq
(
&
chip
->
lock
);
return
put_user
(
rval
,
(
int
*
)
arg
);
return
put_user
(
rval
,
p
);
case
SNDCTL_DSP_GETBLKSIZE
:
DPRINTK
(
"%s: GETBLKSIZE
\n
"
,
__FUNCTION__
);
...
...
@@ -980,7 +982,7 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
spin_unlock_irq
(
&
chip
->
lock
);
return
put_user
(
ival
,
(
int
*
)
arg
);
return
put_user
(
ival
,
p
);
case
SNDCTL_DSP_RESET
:
DPRINTK
(
"%s: RESET
\n
"
,
__FUNCTION__
);
...
...
@@ -1022,7 +1024,7 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
case
SNDCTL_DSP_SETFRAGMENT
:
DPRINTK
(
"%s: SETFRAGMENT
\n
"
,
__FUNCTION__
);
if
(
get_user
(
ival
,
(
int
*
)
arg
))
if
(
get_user
(
ival
,
p
))
return
-
EFAULT
;
spin_lock_irq
(
&
chip
->
lock
);
...
...
@@ -1041,7 +1043,7 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
spin_unlock_irq
(
&
chip
->
lock
);
return
put_user
(
ival
,
(
int
*
)
arg
);
return
put_user
(
ival
,
p
);
case
SNDCTL_DSP_GETISPACE
:
DPRINTK
(
"%s: GETISPACE
\n
"
,
__FUNCTION__
);
...
...
@@ -1065,7 +1067,7 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
spin_unlock_irq
(
&
chip
->
lock
);
return
copy_to_user
(
(
void
*
)
arg
,
&
abi
,
sizeof
(
abi
))
?
-
EFAULT
:
0
;
return
copy_to_user
(
argp
,
&
abi
,
sizeof
(
abi
))
?
-
EFAULT
:
0
;
case
SNDCTL_DSP_GETIPTR
:
DPRINTK
(
"%s: GETIPTR
\n
"
,
__FUNCTION__
);
...
...
@@ -1086,7 +1088,7 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
spin_unlock_irq
(
&
chip
->
lock
);
return
copy_to_user
(
(
void
*
)
arg
,
&
cinfo
,
sizeof
(
cinfo
))
?
-
EFAULT
:
0
;
return
copy_to_user
(
argp
,
&
cinfo
,
sizeof
(
cinfo
))
?
-
EFAULT
:
0
;
case
SNDCTL_DSP_GETOSPACE
:
if
(
!
wr
)
...
...
@@ -1114,7 +1116,7 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
spin_unlock_irq
(
&
chip
->
lock
);
return
copy_to_user
(
(
void
*
)
arg
,
&
abi
,
sizeof
(
abi
))
?
-
EFAULT
:
0
;
return
copy_to_user
(
argp
,
&
abi
,
sizeof
(
abi
))
?
-
EFAULT
:
0
;
case
SNDCTL_DSP_GETOPTR
:
if
(
!
wr
)
...
...
@@ -1133,7 +1135,7 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
spin_unlock_irq
(
&
chip
->
lock
);
return
copy_to_user
(
(
void
*
)
arg
,
&
cinfo
,
sizeof
(
cinfo
))
?
-
EFAULT
:
0
;
return
copy_to_user
(
argp
,
&
cinfo
,
sizeof
(
cinfo
))
?
-
EFAULT
:
0
;
case
SNDCTL_DSP_GETODELAY
:
if
(
!
wr
)
...
...
@@ -1157,7 +1159,7 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
spin_unlock_irq
(
&
chip
->
lock
);
return
put_user
(
ival
,
(
int
*
)
arg
);
return
put_user
(
ival
,
p
);
case
SNDCTL_DSP_SETDUPLEX
:
DPRINTK
(
"%s: SETDUPLEX
\n
"
,
__FUNCTION__
);
...
...
@@ -1167,11 +1169,11 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
case
SNDCTL_DSP_GETTRIGGER
:
DPRINTK
(
"%s: GETTRIGGER
\n
"
,
__FUNCTION__
);
return
put_user
(
chip
->
trigger
,
(
int
*
)
arg
);
return
put_user
(
chip
->
trigger
,
p
);
case
SNDCTL_DSP_SETTRIGGER
:
if
(
get_user
(
ival
,
(
int
*
)
arg
))
if
(
get_user
(
ival
,
p
))
return
-
EFAULT
;
DPRINTK
(
"%s: SETTRIGGER %d
\n
"
,
__FUNCTION__
,
ival
);
...
...
@@ -1207,15 +1209,15 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
case
SOUND_PCM_READ_RATE
:
DPRINTK
(
"%s: PCM_READ_RATE
\n
"
,
__FUNCTION__
);
return
put_user
(
chip
->
play
.
rate
,
(
int
*
)
arg
);
return
put_user
(
chip
->
play
.
rate
,
p
);
case
SOUND_PCM_READ_CHANNELS
:
DPRINTK
(
"%s: PCM_READ_CHANNELS
\n
"
,
__FUNCTION__
);
return
put_user
(
chip
->
play
.
stereo
,
(
int
*
)
arg
);
return
put_user
(
chip
->
play
.
stereo
,
p
);
case
SOUND_PCM_READ_BITS
:
DPRINTK
(
"%s: PCM_READ_BITS
\n
"
,
__FUNCTION__
);
return
put_user
(
chip
->
play
.
format
,
(
int
*
)
arg
);
return
put_user
(
chip
->
play
.
format
,
p
);
case
SNDCTL_DSP_NONBLOCK
:
DPRINTK
(
"%s: DSP_NONBLOCK
\n
"
,
__FUNCTION__
);
...
...
@@ -1223,7 +1225,7 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
return
0
;
default:
DPRINTK
(
"Unsupported ioctl: %x (%p)
\n
"
,
cmd
,
(
void
*
)
arg
);
DPRINTK
(
"Unsupported ioctl: %x (%p)
\n
"
,
cmd
,
argp
);
break
;
}
...
...
@@ -1428,7 +1430,7 @@ forte_dsp_mmap (struct file *file, struct vm_area_struct *vma)
*/
static
ssize_t
forte_dsp_write
(
struct
file
*
file
,
const
char
*
buffer
,
size_t
bytes
,
forte_dsp_write
(
struct
file
*
file
,
const
char
__user
*
buffer
,
size_t
bytes
,
loff_t
*
ppos
)
{
struct
forte_chip
*
chip
;
...
...
@@ -1536,7 +1538,7 @@ forte_dsp_write (struct file *file, const char *buffer, size_t bytes,
*/
static
ssize_t
forte_dsp_read
(
struct
file
*
file
,
char
*
buffer
,
size_t
bytes
,
forte_dsp_read
(
struct
file
*
file
,
char
__user
*
buffer
,
size_t
bytes
,
loff_t
*
ppos
)
{
struct
forte_chip
*
chip
;
...
...
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