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
34784d80
Commit
34784d80
authored
Aug 09, 2004
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://bk.arm.linux.org.uk/linux-2.6-rmk
into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents
b6321974
2425359b
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
167 additions
and
107 deletions
+167
-107
Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
+7
-6
arch/ia64/mm/init.c
arch/ia64/mm/init.c
+2
-0
arch/ppc64/mm/slb_low.S
arch/ppc64/mm/slb_low.S
+22
-11
drivers/block/ll_rw_blk.c
drivers/block/ll_rw_blk.c
+2
-0
drivers/block/scsi_ioctl.c
drivers/block/scsi_ioctl.c
+1
-1
drivers/ide/pci/hpt366.h
drivers/ide/pci/hpt366.h
+9
-0
fs/nfsd/nfs3xdr.c
fs/nfsd/nfs3xdr.c
+10
-7
fs/nfsd/nfsxdr.c
fs/nfsd/nfsxdr.c
+2
-2
include/asm-ia64/pgalloc.h
include/asm-ia64/pgalloc.h
+18
-2
include/scsi/scsi.h
include/scsi/scsi.h
+13
-13
include/scsi/sg.h
include/scsi/sg.h
+2
-0
include/sound/info.h
include/sound/info.h
+4
-2
sound/core/info.c
sound/core/info.c
+28
-16
sound/drivers/opl4/opl4_proc.c
sound/drivers/opl4/opl4_proc.c
+10
-10
sound/isa/gus/gus_mem_proc.c
sound/isa/gus/gus_mem_proc.c
+5
-5
sound/pci/cs4281.c
sound/pci/cs4281.c
+10
-10
sound/pci/cs46xx/cs46xx_lib.c
sound/pci/cs46xx/cs46xx_lib.c
+5
-5
sound/pci/emu10k1/emuproc.c
sound/pci/emu10k1/emuproc.c
+7
-7
sound/pci/mixart/mixart.c
sound/pci/mixart/mixart.c
+10
-10
No files found.
Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl
View file @
34784d80
...
...
@@ -5182,7 +5182,7 @@ struct _snd_pcm_runtime {
The callback is much more complicated than the text-file
version. You need to use a low-level i/o functions such as
<function>
copy_from/to_user()
</function>
to transfer the
data.
Also, you have to keep tracking the file position, too.
data.
<informalexample>
<programlisting>
...
...
@@ -5190,14 +5190,15 @@ struct _snd_pcm_runtime {
static long my_file_io_read(snd_info_entry_t *entry,
void *file_private_data,
struct file *file,
char *buf, long count)
char *buf,
unsigned long count,
unsigned long pos)
{
long size = count;
if (
file->
f_
pos + size > local_max_size)
size = local_max_size -
file->f_
pos;
if (copy_to_user(buf, local_data +
file->f_
pos, size))
if (pos + size >
local_max_size)
size = local_max_size - pos;
if (copy_to_user(buf, local_data + pos, size))
return -EFAULT;
file->f_pos += size;
return size;
}
]]>
...
...
arch/ia64/mm/init.c
View file @
34784d80
...
...
@@ -63,6 +63,7 @@ check_pgt_cache (void)
low
=
pgt_cache_water
[
0
];
high
=
pgt_cache_water
[
1
];
preempt_disable
();
if
(
pgtable_cache_size
>
(
u64
)
high
)
{
do
{
if
(
pgd_quicklist
)
...
...
@@ -71,6 +72,7 @@ check_pgt_cache (void)
free_page
((
unsigned
long
)
pmd_alloc_one_fast
(
0
,
0
));
}
while
(
pgtable_cache_size
>
(
u64
)
low
);
}
preempt_enable
();
}
void
...
...
arch/ppc64/mm/slb_low.S
View file @
34784d80
...
...
@@ -37,9 +37,6 @@ _GLOBAL(slb_allocate)
*
a
free
slot
first
but
that
took
too
long
.
Unfortunately
we
*
dont
have
any
LRU
information
to
help
us
choose
a
slot
.
*/
srdi
r9
,
r1
,
27
ori
r9
,
r9
,
1
/*
mangle
SP
for
later
compare
*/
ld
r10
,
PACASTABRR
(
r13
)
3
:
addi
r10
,
r10
,
1
...
...
@@ -48,18 +45,32 @@ _GLOBAL(slb_allocate)
blt
+
4
f
li
r10
,
SLB_NUM_BOLTED
4
:
slbmfee
r11
,
r10
/
*
Don
't throw
out the segment for our kernel stack. Since we
/
*
*
Never
cast
out
the
segment
for
our
kernel
stack
.
Since
we
*
dont
invalidate
the
ERAT
we
could
have
a
valid
translation
*
for
the
kernel
stack
during
the
first
part
of
exception
*
exit
which
gets
invalidated
due
to
a
tlbie
from
another
cpu
*
at
a
non
recoverable
point
(
after
setting
srr0
/
1
)
-
Anton
*
*
for
the
kernel
stack
during
the
first
part
of
exception
exit
*
which
gets
invalidated
due
to
a
tlbie
from
another
cpu
at
a
*
non
recoverable
point
(
after
setting
srr0
/
1
)
-
Anton
*/
4
:
slbmfee
r11
,
r10
srdi
r11
,
r11
,
27
/
*
*
Use
paca
->
ksave
as
the
value
of
the
kernel
stack
pointer
,
*
because
this
is
valid
at
all
times
.
*
The
>>
27
(
rather
than
>>
28
)
is
so
that
the
LSB
is
the
*
valid
bit
-
this
way
we
check
valid
and
ESID
in
one
compare
.
*
In
order
to
completely
close
the
tiny
race
in
the
context
*
switch
(
between
updating
r1
and
updating
paca
->
ksave
),
*
we
check
against
both
r1
and
paca
->
ksave
.
*/
srdi
r11
,
r11
,
27
srdi
r9
,
r1
,
27
ori
r9
,
r9
,
1
/*
mangle
SP
for
later
compare
*/
cmpd
r11
,
r9
beq
-
3
b
ld
r9
,
PACAKSAVE
(
r13
)
srdi
r9
,
r9
,
27
ori
r9
,
r9
,
1
cmpd
r11
,
r9
beq
-
3
b
...
...
drivers/block/ll_rw_blk.c
View file @
34784d80
...
...
@@ -632,6 +632,8 @@ int blk_queue_resize_tags(request_queue_t *q, int new_depth)
return
0
;
}
EXPORT_SYMBOL
(
blk_queue_resize_tags
);
/**
* blk_queue_end_tag - end tag operations for a request
* @q: the request queue for the device
...
...
drivers/block/scsi_ioctl.c
View file @
34784d80
...
...
@@ -90,7 +90,7 @@ static int sg_set_reserved_size(request_queue_t *q, int __user *p)
if
(
size
<
0
)
return
-
EINVAL
;
if
(
size
>
(
q
->
max_sectors
<<
9
))
return
-
EINVAL
;
size
=
q
->
max_sectors
<<
9
;
q
->
sg_reserved_size
=
size
;
return
0
;
...
...
drivers/ide/pci/hpt366.h
View file @
34784d80
...
...
@@ -470,6 +470,15 @@ static ide_pci_device_t hpt366_chipsets[] __devinitdata = {
.
channels
=
2
,
/* 4 */
.
autodma
=
AUTODMA
,
.
bootable
=
OFF_BOARD
,
},{
/* 5 */
.
name
=
"HPT372N"
,
.
init_setup
=
init_setup_hpt37x
,
.
init_chipset
=
init_chipset_hpt366
,
.
init_hwif
=
init_hwif_hpt366
,
.
init_dma
=
init_dma_hpt366
,
.
channels
=
2
,
/* 4 */
.
autodma
=
AUTODMA
,
.
bootable
=
OFF_BOARD
,
}
};
...
...
fs/nfsd/nfs3xdr.c
View file @
34784d80
...
...
@@ -74,7 +74,7 @@ decode_fh(u32 *p, struct svc_fh *fhp)
static
inline
u32
*
encode_fh
(
u32
*
p
,
struct
svc_fh
*
fhp
)
{
int
size
=
fhp
->
fh_handle
.
fh_size
;
unsigned
int
size
=
fhp
->
fh_handle
.
fh_size
;
*
p
++
=
htonl
(
size
);
if
(
size
)
p
[
XDR_QUADLEN
(
size
)
-
1
]
=
0
;
memcpy
(
p
,
&
fhp
->
fh_handle
.
fh_base
,
size
);
...
...
@@ -328,7 +328,7 @@ int
nfs3svc_decode_readargs
(
struct
svc_rqst
*
rqstp
,
u32
*
p
,
struct
nfsd3_readargs
*
args
)
{
int
len
;
unsigned
int
len
;
int
v
,
pn
;
if
(
!
(
p
=
decode_fh
(
p
,
&
args
->
fh
))
...
...
@@ -358,7 +358,7 @@ int
nfs3svc_decode_writeargs
(
struct
svc_rqst
*
rqstp
,
u32
*
p
,
struct
nfsd3_writeargs
*
args
)
{
int
len
,
v
;
unsigned
int
len
,
v
,
hdr
;
if
(
!
(
p
=
decode_fh
(
p
,
&
args
->
fh
))
||
!
(
p
=
xdr_decode_hyper
(
p
,
&
args
->
offset
)))
...
...
@@ -368,9 +368,12 @@ nfs3svc_decode_writeargs(struct svc_rqst *rqstp, u32 *p,
args
->
stable
=
ntohl
(
*
p
++
);
len
=
args
->
len
=
ntohl
(
*
p
++
);
hdr
=
(
void
*
)
p
-
rqstp
->
rq_arg
.
head
[
0
].
iov_base
;
if
(
rqstp
->
rq_arg
.
len
<
len
+
hdr
)
return
0
;
args
->
vec
[
0
].
iov_base
=
(
void
*
)
p
;
args
->
vec
[
0
].
iov_len
=
rqstp
->
rq_arg
.
head
[
0
].
iov_len
-
(((
void
*
)
p
)
-
rqstp
->
rq_arg
.
head
[
0
].
iov_base
);
args
->
vec
[
0
].
iov_len
=
rqstp
->
rq_arg
.
head
[
0
].
iov_len
-
hdr
;
if
(
len
>
NFSSVC_MAXBLKSIZE
)
len
=
NFSSVC_MAXBLKSIZE
;
...
...
@@ -427,7 +430,7 @@ int
nfs3svc_decode_symlinkargs
(
struct
svc_rqst
*
rqstp
,
u32
*
p
,
struct
nfsd3_symlinkargs
*
args
)
{
int
len
;
unsigned
int
len
;
int
avail
;
char
*
old
,
*
new
;
struct
kvec
*
vec
;
...
...
@@ -444,7 +447,7 @@ nfs3svc_decode_symlinkargs(struct svc_rqst *rqstp, u32 *p,
*/
svc_take_page
(
rqstp
);
len
=
ntohl
(
*
p
++
);
if
(
len
<
=
0
||
len
>
NFS3_MAXPATHLEN
||
len
>=
PAGE_SIZE
)
if
(
len
=
=
0
||
len
>
NFS3_MAXPATHLEN
||
len
>=
PAGE_SIZE
)
return
0
;
args
->
tname
=
new
=
page_address
(
rqstp
->
rq_respages
[
rqstp
->
rq_resused
-
1
]);
args
->
tlen
=
len
;
...
...
fs/nfsd/nfsxdr.c
View file @
34784d80
...
...
@@ -234,7 +234,7 @@ int
nfssvc_decode_readargs
(
struct
svc_rqst
*
rqstp
,
u32
*
p
,
struct
nfsd_readargs
*
args
)
{
int
len
;
unsigned
int
len
;
int
v
,
pn
;
if
(
!
(
p
=
decode_fh
(
p
,
&
args
->
fh
)))
return
0
;
...
...
@@ -266,7 +266,7 @@ int
nfssvc_decode_writeargs
(
struct
svc_rqst
*
rqstp
,
u32
*
p
,
struct
nfsd_writeargs
*
args
)
{
int
len
;
unsigned
int
len
;
int
v
;
if
(
!
(
p
=
decode_fh
(
p
,
&
args
->
fh
)))
return
0
;
...
...
include/asm-ia64/pgalloc.h
View file @
34784d80
...
...
@@ -37,14 +37,20 @@
static
inline
pgd_t
*
pgd_alloc_one_fast
(
struct
mm_struct
*
mm
)
{
unsigned
long
*
ret
=
pgd_quicklist
;
unsigned
long
*
ret
=
NULL
;
preempt_disable
();
ret
=
pgd_quicklist
;
if
(
likely
(
ret
!=
NULL
))
{
pgd_quicklist
=
(
unsigned
long
*
)(
*
ret
);
ret
[
0
]
=
0
;
--
pgtable_cache_size
;
}
else
ret
=
NULL
;
preempt_enable
();
return
(
pgd_t
*
)
ret
;
}
...
...
@@ -65,9 +71,11 @@ pgd_alloc (struct mm_struct *mm)
static
inline
void
pgd_free
(
pgd_t
*
pgd
)
{
preempt_disable
();
*
(
unsigned
long
*
)
pgd
=
(
unsigned
long
)
pgd_quicklist
;
pgd_quicklist
=
(
unsigned
long
*
)
pgd
;
++
pgtable_cache_size
;
preempt_enable
();
}
static
inline
void
...
...
@@ -80,13 +88,19 @@ pgd_populate (struct mm_struct *mm, pgd_t *pgd_entry, pmd_t *pmd)
static
inline
pmd_t
*
pmd_alloc_one_fast
(
struct
mm_struct
*
mm
,
unsigned
long
addr
)
{
unsigned
long
*
ret
=
(
unsigned
long
*
)
pmd_quicklist
;
unsigned
long
*
ret
=
NULL
;
preempt_disable
();
ret
=
(
unsigned
long
*
)
pmd_quicklist
;
if
(
likely
(
ret
!=
NULL
))
{
pmd_quicklist
=
(
unsigned
long
*
)(
*
ret
);
ret
[
0
]
=
0
;
--
pgtable_cache_size
;
}
preempt_enable
();
return
(
pmd_t
*
)
ret
;
}
...
...
@@ -103,9 +117,11 @@ pmd_alloc_one (struct mm_struct *mm, unsigned long addr)
static
inline
void
pmd_free
(
pmd_t
*
pmd
)
{
preempt_disable
();
*
(
unsigned
long
*
)
pmd
=
(
unsigned
long
)
pmd_quicklist
;
pmd_quicklist
=
(
unsigned
long
*
)
pmd
;
++
pgtable_cache_size
;
preempt_enable
();
}
#define __pmd_free_tlb(tlb, pmd) pmd_free(pmd)
...
...
include/scsi/scsi.h
View file @
34784d80
...
...
@@ -214,25 +214,25 @@ static inline int scsi_status_is_good(int status)
*/
struct
ccs_modesel_head
{
u8
_r1
;
/* reserved */
u8
medium
;
/* device-specific medium type */
u8
_r2
;
/* reserved */
u8
block_desc_length
;
/* block descriptor length */
u8
density
;
/* device-specific density code */
u8
number_blocks_hi
;
/* number of blocks in this block desc */
u8
number_blocks_med
;
u8
number_blocks_lo
;
u8
_r3
;
u8
block_length_hi
;
/* block length for blocks in this desc */
u8
block_length_med
;
u8
block_length_lo
;
__
u8
_r1
;
/* reserved */
__
u8
medium
;
/* device-specific medium type */
__
u8
_r2
;
/* reserved */
__
u8
block_desc_length
;
/* block descriptor length */
__
u8
density
;
/* device-specific density code */
__
u8
number_blocks_hi
;
/* number of blocks in this block desc */
__
u8
number_blocks_med
;
__
u8
number_blocks_lo
;
__
u8
_r3
;
__
u8
block_length_hi
;
/* block length for blocks in this desc */
__
u8
block_length_med
;
__
u8
block_length_lo
;
};
/*
* ScsiLun: 8 byte LUN.
*/
struct
scsi_lun
{
u8
scsi_lun
[
8
];
__
u8
scsi_lun
[
8
];
};
/*
...
...
include/scsi/sg.h
View file @
34784d80
#ifndef _SCSI_GENERIC_H
#define _SCSI_GENERIC_H
#include <linux/compiler.h>
/*
History:
Started: Aug 9 by Lawrence Foard (entropy@world.std.com), to allow user
...
...
include/sound/info.h
View file @
34784d80
...
...
@@ -54,9 +54,11 @@ struct snd_info_entry_ops {
int
(
*
release
)
(
snd_info_entry_t
*
entry
,
unsigned
short
mode
,
void
*
file_private_data
);
long
(
*
read
)
(
snd_info_entry_t
*
entry
,
void
*
file_private_data
,
struct
file
*
file
,
char
__user
*
buf
,
long
count
);
struct
file
*
file
,
char
__user
*
buf
,
unsigned
long
count
,
unsigned
long
pos
);
long
(
*
write
)
(
snd_info_entry_t
*
entry
,
void
*
file_private_data
,
struct
file
*
file
,
const
char
__user
*
buf
,
long
count
);
struct
file
*
file
,
const
char
__user
*
buf
,
unsigned
long
count
,
unsigned
long
pos
);
long
long
(
*
llseek
)
(
snd_info_entry_t
*
entry
,
void
*
file_private_data
,
struct
file
*
file
,
long
long
offset
,
int
orig
);
unsigned
int
(
*
poll
)
(
snd_info_entry_t
*
entry
,
void
*
file_private_data
,
...
...
sound/core/info.c
View file @
34784d80
...
...
@@ -181,30 +181,37 @@ static ssize_t snd_info_entry_read(struct file *file, char __user *buffer,
struct
snd_info_entry
*
entry
;
snd_info_buffer_t
*
buf
;
size_t
size
=
0
;
loff_t
pos
;
data
=
snd_magic_cast
(
snd_info_private_data_t
,
file
->
private_data
,
return
-
ENXIO
);
snd_assert
(
data
!=
NULL
,
return
-
ENXIO
);
pos
=
*
offset
;
if
(
pos
<
0
||
(
long
)
pos
!=
pos
||
(
ssize_t
)
count
<
0
)
return
-
EIO
;
if
((
unsigned
long
)
pos
+
(
unsigned
long
)
count
<
(
unsigned
long
)
pos
)
return
-
EIO
;
entry
=
data
->
entry
;
switch
(
entry
->
content
)
{
case
SNDRV_INFO_CONTENT_TEXT
:
buf
=
data
->
rbuffer
;
if
(
buf
==
NULL
)
return
-
EIO
;
if
(
file
->
f_pos
>=
(
long
)
buf
->
size
)
if
(
pos
>=
buf
->
size
)
return
0
;
size
=
buf
->
size
-
file
->
f_
pos
;
size
=
buf
->
size
-
pos
;
size
=
min
(
count
,
size
);
if
(
copy_to_user
(
buffer
,
buf
->
buffer
+
file
->
f_
pos
,
size
))
if
(
copy_to_user
(
buffer
,
buf
->
buffer
+
pos
,
size
))
return
-
EFAULT
;
file
->
f_pos
+=
size
;
break
;
case
SNDRV_INFO_CONTENT_DATA
:
if
(
entry
->
c
.
ops
->
read
)
return
entry
->
c
.
ops
->
read
(
entry
,
size
=
entry
->
c
.
ops
->
read
(
entry
,
data
->
file_private_data
,
file
,
buffer
,
count
);
file
,
buffer
,
count
,
pos
);
break
;
}
if
((
ssize_t
)
size
>
0
)
*
offset
=
pos
+
size
;
return
size
;
}
...
...
@@ -215,34 +222,39 @@ static ssize_t snd_info_entry_write(struct file *file, const char __user *buffer
struct
snd_info_entry
*
entry
;
snd_info_buffer_t
*
buf
;
size_t
size
=
0
;
loff_t
pos
;
data
=
snd_magic_cast
(
snd_info_private_data_t
,
file
->
private_data
,
return
-
ENXIO
);
snd_assert
(
data
!=
NULL
,
return
-
ENXIO
);
entry
=
data
->
entry
;
pos
=
*
offset
;
if
(
pos
<
0
||
(
long
)
pos
!=
pos
||
(
ssize_t
)
count
<
0
)
return
-
EIO
;
if
((
unsigned
long
)
pos
+
(
unsigned
long
)
count
<
(
unsigned
long
)
pos
)
return
-
EIO
;
switch
(
entry
->
content
)
{
case
SNDRV_INFO_CONTENT_TEXT
:
buf
=
data
->
wbuffer
;
if
(
buf
==
NULL
)
return
-
EIO
;
if
(
file
->
f_pos
<
0
)
return
-
EINVAL
;
if
(
file
->
f_pos
>=
(
long
)
buf
->
len
)
if
(
pos
>=
buf
->
len
)
return
-
ENOMEM
;
size
=
buf
->
len
-
file
->
f_
pos
;
size
=
buf
->
len
-
pos
;
size
=
min
(
count
,
size
);
if
(
copy_from_user
(
buf
->
buffer
+
file
->
f_
pos
,
buffer
,
size
))
if
(
copy_from_user
(
buf
->
buffer
+
pos
,
buffer
,
size
))
return
-
EFAULT
;
if
((
long
)
buf
->
size
<
file
->
f_pos
+
size
)
buf
->
size
=
file
->
f_pos
+
size
;
file
->
f_pos
+=
size
;
if
((
long
)
buf
->
size
<
pos
+
size
)
buf
->
size
=
pos
+
size
;
break
;
case
SNDRV_INFO_CONTENT_DATA
:
if
(
entry
->
c
.
ops
->
write
)
return
entry
->
c
.
ops
->
write
(
entry
,
size
=
entry
->
c
.
ops
->
write
(
entry
,
data
->
file_private_data
,
file
,
buffer
,
count
);
file
,
buffer
,
count
,
pos
);
break
;
}
if
((
ssize_t
)
size
>
0
)
*
offset
=
pos
+
size
;
return
size
;
}
...
...
sound/drivers/opl4/opl4_proc.c
View file @
34784d80
...
...
@@ -50,41 +50,42 @@ static int snd_opl4_mem_proc_release(snd_info_entry_t *entry,
}
static
long
snd_opl4_mem_proc_read
(
snd_info_entry_t
*
entry
,
void
*
file_private_data
,
struct
file
*
file
,
char
__user
*
_buf
,
long
count
)
struct
file
*
file
,
char
__user
*
_buf
,
unsigned
long
count
,
unsigned
long
pos
)
{
opl4_t
*
opl4
=
snd_magic_cast
(
opl4_t
,
entry
->
private_data
,
return
-
ENXIO
);
long
size
;
char
*
buf
;
size
=
count
;
if
(
file
->
f_
pos
+
size
>
entry
->
size
)
size
=
entry
->
size
-
file
->
f_
pos
;
if
(
pos
+
size
>
entry
->
size
)
size
=
entry
->
size
-
pos
;
if
(
size
>
0
)
{
buf
=
vmalloc
(
size
);
if
(
!
buf
)
return
-
ENOMEM
;
snd_opl4_read_memory
(
opl4
,
buf
,
file
->
f_
pos
,
size
);
snd_opl4_read_memory
(
opl4
,
buf
,
pos
,
size
);
if
(
copy_to_user
(
_buf
,
buf
,
size
))
{
vfree
(
buf
);
return
-
EFAULT
;
}
vfree
(
buf
);
file
->
f_pos
+=
size
;
return
size
;
}
return
0
;
}
static
long
snd_opl4_mem_proc_write
(
snd_info_entry_t
*
entry
,
void
*
file_private_data
,
struct
file
*
file
,
const
char
__user
*
_buf
,
long
count
)
struct
file
*
file
,
const
char
__user
*
_buf
,
unsigned
long
count
,
unsigned
long
pos
)
{
opl4_t
*
opl4
=
snd_magic_cast
(
opl4_t
,
entry
->
private_data
,
return
-
ENXIO
);
long
size
;
char
*
buf
;
size
=
count
;
if
(
file
->
f_
pos
+
size
>
entry
->
size
)
size
=
entry
->
size
-
file
->
f_
pos
;
if
(
pos
+
size
>
entry
->
size
)
size
=
entry
->
size
-
pos
;
if
(
size
>
0
)
{
buf
=
vmalloc
(
size
);
if
(
!
buf
)
...
...
@@ -93,9 +94,8 @@ static long snd_opl4_mem_proc_write(snd_info_entry_t *entry, void *file_private_
vfree
(
buf
);
return
-
EFAULT
;
}
snd_opl4_write_memory
(
opl4
,
buf
,
file
->
f_
pos
,
size
);
snd_opl4_write_memory
(
opl4
,
buf
,
pos
,
size
);
vfree
(
buf
);
file
->
f_pos
+=
size
;
return
size
;
}
return
0
;
...
...
sound/isa/gus/gus_mem_proc.c
View file @
34784d80
...
...
@@ -33,7 +33,8 @@ typedef struct gus_proc_private {
}
gus_proc_private_t
;
static
long
snd_gf1_mem_proc_dump
(
snd_info_entry_t
*
entry
,
void
*
file_private_data
,
struct
file
*
file
,
char
__user
*
buf
,
long
count
)
struct
file
*
file
,
char
__user
*
buf
,
unsigned
long
count
,
unsigned
long
pos
)
{
long
size
;
gus_proc_private_t
*
priv
=
snd_magic_cast
(
gus_proc_private_t
,
entry
->
private_data
,
return
-
ENXIO
);
...
...
@@ -41,12 +42,11 @@ static long snd_gf1_mem_proc_dump(snd_info_entry_t *entry, void *file_private_da
int
err
;
size
=
count
;
if
(
file
->
f_
pos
+
size
>
priv
->
size
)
size
=
(
long
)
priv
->
size
-
file
->
f_
pos
;
if
(
pos
+
size
>
priv
->
size
)
size
=
(
long
)
priv
->
size
-
pos
;
if
(
size
>
0
)
{
if
((
err
=
snd_gus_dram_read
(
gus
,
buf
,
file
->
f_
pos
,
size
,
priv
->
rom
))
<
0
)
if
((
err
=
snd_gus_dram_read
(
gus
,
buf
,
pos
,
size
,
priv
->
rom
))
<
0
)
return
err
;
file
->
f_pos
+=
size
;
return
size
;
}
return
0
;
...
...
sound/pci/cs4281.c
View file @
34784d80
...
...
@@ -1185,35 +1185,35 @@ static void snd_cs4281_proc_read(snd_info_entry_t *entry,
}
static
long
snd_cs4281_BA0_read
(
snd_info_entry_t
*
entry
,
void
*
file_private_data
,
struct
file
*
file
,
char
__user
*
buf
,
long
count
)
struct
file
*
file
,
char
__user
*
buf
,
unsigned
long
count
,
unsigned
long
pos
)
{
long
size
;
cs4281_t
*
chip
=
snd_magic_cast
(
cs4281_t
,
entry
->
private_data
,
return
-
ENXIO
);
size
=
count
;
if
(
file
->
f_
pos
+
size
>
CS4281_BA0_SIZE
)
size
=
(
long
)
CS4281_BA0_SIZE
-
file
->
f_
pos
;
if
(
pos
+
size
>
CS4281_BA0_SIZE
)
size
=
(
long
)
CS4281_BA0_SIZE
-
pos
;
if
(
size
>
0
)
{
if
(
copy_to_user_fromio
(
buf
,
chip
->
ba0
+
file
->
f_
pos
,
size
))
if
(
copy_to_user_fromio
(
buf
,
chip
->
ba0
+
pos
,
size
))
return
-
EFAULT
;
file
->
f_pos
+=
size
;
}
return
size
;
}
static
long
snd_cs4281_BA1_read
(
snd_info_entry_t
*
entry
,
void
*
file_private_data
,
struct
file
*
file
,
char
__user
*
buf
,
long
count
)
struct
file
*
file
,
char
__user
*
buf
,
unsigned
long
count
,
unsigned
long
pos
)
{
long
size
;
cs4281_t
*
chip
=
snd_magic_cast
(
cs4281_t
,
entry
->
private_data
,
return
-
ENXIO
);
size
=
count
;
if
(
file
->
f_
pos
+
size
>
CS4281_BA1_SIZE
)
size
=
(
long
)
CS4281_BA1_SIZE
-
file
->
f_
pos
;
if
(
pos
+
size
>
CS4281_BA1_SIZE
)
size
=
(
long
)
CS4281_BA1_SIZE
-
pos
;
if
(
size
>
0
)
{
if
(
copy_to_user_fromio
(
buf
,
chip
->
ba1
+
file
->
f_
pos
,
size
))
if
(
copy_to_user_fromio
(
buf
,
chip
->
ba1
+
pos
,
size
))
return
-
EFAULT
;
file
->
f_pos
+=
size
;
}
return
size
;
}
...
...
sound/pci/cs46xx/cs46xx_lib.c
View file @
34784d80
...
...
@@ -2866,18 +2866,18 @@ void __devinit snd_cs46xx_gameport(cs46xx_t *chip)
*/
static
long
snd_cs46xx_io_read
(
snd_info_entry_t
*
entry
,
void
*
file_private_data
,
struct
file
*
file
,
char
__user
*
buf
,
long
count
)
struct
file
*
file
,
char
__user
*
buf
,
unsigned
long
count
,
unsigned
long
pos
)
{
long
size
;
snd_cs46xx_region_t
*
region
=
(
snd_cs46xx_region_t
*
)
entry
->
private_data
;
size
=
count
;
if
(
file
->
f_
pos
+
(
size_t
)
size
>
region
->
size
)
size
=
region
->
size
-
file
->
f_
pos
;
if
(
pos
+
(
size_t
)
size
>
region
->
size
)
size
=
region
->
size
-
pos
;
if
(
size
>
0
)
{
if
(
copy_to_user_fromio
(
buf
,
region
->
remap_addr
+
file
->
f_
pos
,
size
))
if
(
copy_to_user_fromio
(
buf
,
region
->
remap_addr
+
pos
,
size
))
return
-
EFAULT
;
file
->
f_pos
+=
size
;
}
return
size
;
}
...
...
sound/pci/emu10k1/emuproc.c
View file @
34784d80
...
...
@@ -191,7 +191,8 @@ static void snd_emu10k1_proc_acode_read(snd_info_entry_t *entry,
#define TOTAL_SIZE_CODE (0x200*8)
static
long
snd_emu10k1_fx8010_read
(
snd_info_entry_t
*
entry
,
void
*
file_private_data
,
struct
file
*
file
,
char
__user
*
buf
,
long
count
)
struct
file
*
file
,
char
__user
*
buf
,
unsigned
long
count
,
unsigned
long
pos
)
{
long
size
;
emu10k1_t
*
emu
=
snd_magic_cast
(
emu10k1_t
,
entry
->
private_data
,
return
-
ENXIO
);
...
...
@@ -209,21 +210,20 @@ static long snd_emu10k1_fx8010_read(snd_info_entry_t *entry, void *file_private_
offset
=
emu
->
audigy
?
A_FXGPREGBASE
:
FXGPREGBASE
;
}
size
=
count
;
if
(
file
->
f_
pos
+
size
>
entry
->
size
)
size
=
(
long
)
entry
->
size
-
file
->
f_
pos
;
if
(
pos
+
size
>
entry
->
size
)
size
=
(
long
)
entry
->
size
-
pos
;
if
(
size
>
0
)
{
unsigned
int
*
tmp
;
long
res
;
unsigned
int
idx
;
if
((
tmp
=
kmalloc
(
size
+
8
,
GFP_KERNEL
))
==
NULL
)
return
-
ENOMEM
;
for
(
idx
=
0
;
idx
<
((
file
->
f_
pos
&
3
)
+
size
+
3
)
>>
2
;
idx
++
)
tmp
[
idx
]
=
snd_emu10k1_ptr_read
(
emu
,
offset
+
idx
+
(
file
->
f_
pos
>>
2
),
0
);
if
(
copy_to_user
(
buf
,
((
char
*
)
tmp
)
+
(
file
->
f_
pos
&
3
),
size
))
for
(
idx
=
0
;
idx
<
((
pos
&
3
)
+
size
+
3
)
>>
2
;
idx
++
)
tmp
[
idx
]
=
snd_emu10k1_ptr_read
(
emu
,
offset
+
idx
+
(
pos
>>
2
),
0
);
if
(
copy_to_user
(
buf
,
((
char
*
)
tmp
)
+
(
pos
&
3
),
size
))
res
=
-
EFAULT
;
else
{
res
=
size
;
file
->
f_pos
+=
size
;
}
kfree
(
tmp
);
return
res
;
...
...
sound/pci/mixart/mixart.c
View file @
34784d80
...
...
@@ -1154,18 +1154,18 @@ static long long snd_mixart_BA1_llseek(snd_info_entry_t *entry,
mixart_BA0 proc interface for BAR 0 - read callback
*/
static
long
snd_mixart_BA0_read
(
snd_info_entry_t
*
entry
,
void
*
file_private_data
,
struct
file
*
file
,
char
__user
*
buf
,
long
count
)
struct
file
*
file
,
char
__user
*
buf
,
unsigned
long
count
,
unsigned
long
pos
)
{
mixart_mgr_t
*
mgr
=
snd_magic_cast
(
mixart_mgr_t
,
entry
->
private_data
,
return
-
ENXIO
);
count
=
count
&
~
3
;
/* make sure the read size is a multiple of 4 bytes */
if
(
count
<=
0
)
return
0
;
if
(
file
->
f_
pos
+
count
>
MIXART_BA0_SIZE
)
count
=
(
long
)(
MIXART_BA0_SIZE
-
file
->
f_
pos
);
if
(
copy_to_user_fromio
(
buf
,
MIXART_MEM
(
mgr
,
file
->
f_
pos
),
count
))
if
(
pos
+
count
>
MIXART_BA0_SIZE
)
count
=
(
long
)(
MIXART_BA0_SIZE
-
pos
);
if
(
copy_to_user_fromio
(
buf
,
MIXART_MEM
(
mgr
,
pos
),
count
))
return
-
EFAULT
;
file
->
f_pos
+=
count
;
return
count
;
}
...
...
@@ -1173,18 +1173,18 @@ static long snd_mixart_BA0_read(snd_info_entry_t *entry, void *file_private_data
mixart_BA1 proc interface for BAR 1 - read callback
*/
static
long
snd_mixart_BA1_read
(
snd_info_entry_t
*
entry
,
void
*
file_private_data
,
struct
file
*
file
,
char
__user
*
buf
,
long
count
)
struct
file
*
file
,
char
__user
*
buf
,
unsigned
long
count
,
unsigned
long
pos
)
{
mixart_mgr_t
*
mgr
=
snd_magic_cast
(
mixart_mgr_t
,
entry
->
private_data
,
return
-
ENXIO
);
count
=
count
&
~
3
;
/* make sure the read size is a multiple of 4 bytes */
if
(
count
<=
0
)
return
0
;
if
(
file
->
f_
pos
+
count
>
MIXART_BA1_SIZE
)
count
=
(
long
)(
MIXART_BA1_SIZE
-
file
->
f_
pos
);
if
(
copy_to_user_fromio
(
buf
,
MIXART_REG
(
mgr
,
file
->
f_
pos
),
count
))
if
(
pos
+
count
>
MIXART_BA1_SIZE
)
count
=
(
long
)(
MIXART_BA1_SIZE
-
pos
);
if
(
copy_to_user_fromio
(
buf
,
MIXART_REG
(
mgr
,
pos
),
count
))
return
-
EFAULT
;
file
->
f_pos
+=
count
;
return
count
;
}
...
...
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