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
3a20a8c5
Commit
3a20a8c5
authored
Jun 18, 2004
by
Alexander Viro
Committed by
Linus Torvalds
Jun 18, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] sparse: applicom annotation
parent
536f0ae9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
9 deletions
+10
-9
drivers/char/applicom.c
drivers/char/applicom.c
+10
-9
No files found.
drivers/char/applicom.c
View file @
3a20a8c5
...
@@ -105,8 +105,8 @@ static unsigned int WriteErrorCount; /* number of write error */
...
@@ -105,8 +105,8 @@ static unsigned int WriteErrorCount; /* number of write error */
static
unsigned
int
ReadErrorCount
;
/* number of read error */
static
unsigned
int
ReadErrorCount
;
/* number of read error */
static
unsigned
int
DeviceErrorCount
;
/* number of device error */
static
unsigned
int
DeviceErrorCount
;
/* number of device error */
static
ssize_t
ac_read
(
struct
file
*
,
char
*
,
size_t
,
loff_t
*
);
static
ssize_t
ac_read
(
struct
file
*
,
char
__user
*
,
size_t
,
loff_t
*
);
static
ssize_t
ac_write
(
struct
file
*
,
const
char
*
,
size_t
,
loff_t
*
);
static
ssize_t
ac_write
(
struct
file
*
,
const
char
__user
*
,
size_t
,
loff_t
*
);
static
int
ac_ioctl
(
struct
inode
*
,
struct
file
*
,
unsigned
int
,
static
int
ac_ioctl
(
struct
inode
*
,
struct
file
*
,
unsigned
int
,
unsigned
long
);
unsigned
long
);
static
irqreturn_t
ac_interrupt
(
int
,
void
*
,
struct
pt_regs
*
);
static
irqreturn_t
ac_interrupt
(
int
,
void
*
,
struct
pt_regs
*
);
...
@@ -343,7 +343,7 @@ int __init applicom_init(void)
...
@@ -343,7 +343,7 @@ int __init applicom_init(void)
__initcall
(
applicom_init
);
__initcall
(
applicom_init
);
#endif
#endif
static
ssize_t
ac_write
(
struct
file
*
file
,
const
char
*
buf
,
size_t
count
,
loff_t
*
ppos
)
static
ssize_t
ac_write
(
struct
file
*
file
,
const
char
__user
*
buf
,
size_t
count
,
loff_t
*
ppos
)
{
{
unsigned
int
NumCard
;
/* Board number 1 -> 8 */
unsigned
int
NumCard
;
/* Board number 1 -> 8 */
unsigned
int
IndexCard
;
/* Index board number 0 -> 7 */
unsigned
int
IndexCard
;
/* Index board number 0 -> 7 */
...
@@ -467,7 +467,7 @@ static ssize_t ac_write(struct file *file, const char *buf, size_t count, loff_t
...
@@ -467,7 +467,7 @@ static ssize_t ac_write(struct file *file, const char *buf, size_t count, loff_t
return
0
;
return
0
;
}
}
static
int
do_ac_read
(
int
IndexCard
,
char
*
buf
,
static
int
do_ac_read
(
int
IndexCard
,
char
__user
*
buf
,
struct
st_ram_io
*
st_loc
,
struct
mailbox
*
mailbox
)
struct
st_ram_io
*
st_loc
,
struct
mailbox
*
mailbox
)
{
{
unsigned
long
from
=
(
unsigned
long
)
apbs
[
IndexCard
].
RamIO
+
RAM_TO_PC
;
unsigned
long
from
=
(
unsigned
long
)
apbs
[
IndexCard
].
RamIO
+
RAM_TO_PC
;
...
@@ -521,7 +521,7 @@ static int do_ac_read(int IndexCard, char *buf,
...
@@ -521,7 +521,7 @@ static int do_ac_read(int IndexCard, char *buf,
return
(
sizeof
(
struct
st_ram_io
)
+
sizeof
(
struct
mailbox
));
return
(
sizeof
(
struct
st_ram_io
)
+
sizeof
(
struct
mailbox
));
}
}
static
ssize_t
ac_read
(
struct
file
*
filp
,
char
*
buf
,
size_t
count
,
loff_t
*
ptr
)
static
ssize_t
ac_read
(
struct
file
*
filp
,
char
__user
*
buf
,
size_t
count
,
loff_t
*
ptr
)
{
{
unsigned
long
flags
;
unsigned
long
flags
;
unsigned
int
i
;
unsigned
int
i
;
...
@@ -689,6 +689,7 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
...
@@ -689,6 +689,7 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
int
ret
=
0
;
int
ret
=
0
;
volatile
unsigned
char
byte_reset_it
;
volatile
unsigned
char
byte_reset_it
;
struct
st_ram_io
*
adgl
;
struct
st_ram_io
*
adgl
;
void
__user
*
argp
=
(
void
__user
*
)
arg
;
/* In general, the device is only openable by root anyway, so we're not
/* In general, the device is only openable by root anyway, so we're not
particularly concerned that bogus ioctls can flood the console. */
particularly concerned that bogus ioctls can flood the console. */
...
@@ -697,7 +698,7 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
...
@@ -697,7 +698,7 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
if
(
!
adgl
)
if
(
!
adgl
)
return
-
ENOMEM
;
return
-
ENOMEM
;
if
(
copy_from_user
(
adgl
,
(
void
*
)
arg
,
sizeof
(
struct
st_ram_io
)))
{
if
(
copy_from_user
(
adgl
,
argp
,
sizeof
(
struct
st_ram_io
)))
{
kfree
(
adgl
);
kfree
(
adgl
);
return
-
EFAULT
;
return
-
EFAULT
;
}
}
...
@@ -721,7 +722,7 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
...
@@ -721,7 +722,7 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
pmem
=
apbs
[
IndexCard
].
RamIO
;
pmem
=
apbs
[
IndexCard
].
RamIO
;
for
(
i
=
0
;
i
<
sizeof
(
struct
st_ram_io
);
i
++
)
for
(
i
=
0
;
i
<
sizeof
(
struct
st_ram_io
);
i
++
)
((
unsigned
char
*
)
adgl
)[
i
]
=
readb
(
pmem
++
);
((
unsigned
char
*
)
adgl
)[
i
]
=
readb
(
pmem
++
);
if
(
copy_to_user
(
(
void
*
)
arg
,
adgl
,
sizeof
(
struct
st_ram_io
)))
if
(
copy_to_user
(
argp
,
adgl
,
sizeof
(
struct
st_ram_io
)))
ret
=
-
EFAULT
;
ret
=
-
EFAULT
;
break
;
break
;
case
1
:
case
1
:
...
@@ -742,7 +743,7 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
...
@@ -742,7 +743,7 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
(
readb
(
apbs
[
IndexCard
].
RamIO
+
SERIAL_NUMBER
+
1
)
<<
8
)
+
(
readb
(
apbs
[
IndexCard
].
RamIO
+
SERIAL_NUMBER
+
1
)
<<
8
)
+
(
readb
(
apbs
[
IndexCard
].
RamIO
+
SERIAL_NUMBER
+
2
)
);
(
readb
(
apbs
[
IndexCard
].
RamIO
+
SERIAL_NUMBER
+
2
)
);
if
(
copy_to_user
(
(
void
*
)
arg
,
adgl
,
sizeof
(
struct
st_ram_io
)))
if
(
copy_to_user
(
argp
,
adgl
,
sizeof
(
struct
st_ram_io
)))
ret
=
-
EFAULT
;
ret
=
-
EFAULT
;
break
;
break
;
case
2
:
case
2
:
...
@@ -768,7 +769,7 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
...
@@ -768,7 +769,7 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
pmem
=
apbs
[
IndexCard
].
RamIO
+
TIC_OWNER_TO_PC
;
pmem
=
apbs
[
IndexCard
].
RamIO
+
TIC_OWNER_TO_PC
;
adgl
->
tic_owner_to_pc
=
readb
(
pmem
++
);
adgl
->
tic_owner_to_pc
=
readb
(
pmem
++
);
adgl
->
numcard_owner_to_pc
=
readb
(
pmem
);
adgl
->
numcard_owner_to_pc
=
readb
(
pmem
);
if
(
copy_to_user
(
(
void
*
)
arg
,
adgl
,
sizeof
(
struct
st_ram_io
)))
if
(
copy_to_user
(
argp
,
adgl
,
sizeof
(
struct
st_ram_io
)))
ret
=
-
EFAULT
;
ret
=
-
EFAULT
;
break
;
break
;
case
5
:
case
5
:
...
...
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