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
9e220970
Commit
9e220970
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: lp annotation
parent
3569e846
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
drivers/char/lp.c
drivers/char/lp.c
+8
-8
No files found.
drivers/char/lp.c
View file @
9e220970
...
@@ -291,7 +291,7 @@ static int lp_wait_ready(int minor, int nonblock)
...
@@ -291,7 +291,7 @@ static int lp_wait_ready(int minor, int nonblock)
return
error
;
return
error
;
}
}
static
ssize_t
lp_write
(
struct
file
*
file
,
const
char
*
buf
,
static
ssize_t
lp_write
(
struct
file
*
file
,
const
char
__user
*
buf
,
size_t
count
,
loff_t
*
ppos
)
size_t
count
,
loff_t
*
ppos
)
{
{
unsigned
int
minor
=
iminor
(
file
->
f_dentry
->
d_inode
);
unsigned
int
minor
=
iminor
(
file
->
f_dentry
->
d_inode
);
...
@@ -407,7 +407,7 @@ static ssize_t lp_write(struct file * file, const char * buf,
...
@@ -407,7 +407,7 @@ static ssize_t lp_write(struct file * file, const char * buf,
#ifdef CONFIG_PARPORT_1284
#ifdef CONFIG_PARPORT_1284
/* Status readback conforming to ieee1284 */
/* Status readback conforming to ieee1284 */
static
ssize_t
lp_read
(
struct
file
*
file
,
char
*
buf
,
static
ssize_t
lp_read
(
struct
file
*
file
,
char
__user
*
buf
,
size_t
count
,
loff_t
*
ppos
)
size_t
count
,
loff_t
*
ppos
)
{
{
unsigned
int
minor
=
iminor
(
file
->
f_dentry
->
d_inode
);
unsigned
int
minor
=
iminor
(
file
->
f_dentry
->
d_inode
);
...
@@ -560,6 +560,7 @@ static int lp_ioctl(struct inode *inode, struct file *file,
...
@@ -560,6 +560,7 @@ static int lp_ioctl(struct inode *inode, struct file *file,
unsigned
int
minor
=
iminor
(
inode
);
unsigned
int
minor
=
iminor
(
inode
);
int
status
;
int
status
;
int
retval
=
0
;
int
retval
=
0
;
void
__user
*
argp
=
(
void
__user
*
)
arg
;
#ifdef LP_DEBUG
#ifdef LP_DEBUG
printk
(
KERN_DEBUG
"lp%d ioctl, cmd: 0x%x, arg: 0x%lx
\n
"
,
minor
,
cmd
,
arg
);
printk
(
KERN_DEBUG
"lp%d ioctl, cmd: 0x%x, arg: 0x%lx
\n
"
,
minor
,
cmd
,
arg
);
...
@@ -603,7 +604,7 @@ static int lp_ioctl(struct inode *inode, struct file *file,
...
@@ -603,7 +604,7 @@ static int lp_ioctl(struct inode *inode, struct file *file,
return
-
EINVAL
;
return
-
EINVAL
;
break
;
break
;
case
LPGETIRQ
:
case
LPGETIRQ
:
if
(
copy_to_user
(
(
int
*
)
arg
,
&
LP_IRQ
(
minor
),
if
(
copy_to_user
(
argp
,
&
LP_IRQ
(
minor
),
sizeof
(
int
)))
sizeof
(
int
)))
return
-
EFAULT
;
return
-
EFAULT
;
break
;
break
;
...
@@ -612,7 +613,7 @@ static int lp_ioctl(struct inode *inode, struct file *file,
...
@@ -612,7 +613,7 @@ static int lp_ioctl(struct inode *inode, struct file *file,
status
=
r_str
(
minor
);
status
=
r_str
(
minor
);
lp_release_parport
(
&
lp_table
[
minor
]);
lp_release_parport
(
&
lp_table
[
minor
]);
if
(
copy_to_user
(
(
int
*
)
arg
,
&
status
,
sizeof
(
int
)))
if
(
copy_to_user
(
argp
,
&
status
,
sizeof
(
int
)))
return
-
EFAULT
;
return
-
EFAULT
;
break
;
break
;
case
LPRESET
:
case
LPRESET
:
...
@@ -620,7 +621,7 @@ static int lp_ioctl(struct inode *inode, struct file *file,
...
@@ -620,7 +621,7 @@ static int lp_ioctl(struct inode *inode, struct file *file,
break
;
break
;
#ifdef LP_STATS
#ifdef LP_STATS
case
LPGETSTATS
:
case
LPGETSTATS
:
if
(
copy_to_user
(
(
int
*
)
arg
,
&
LP_STAT
(
minor
),
if
(
copy_to_user
(
argp
,
&
LP_STAT
(
minor
),
sizeof
(
struct
lp_stats
)))
sizeof
(
struct
lp_stats
)))
return
-
EFAULT
;
return
-
EFAULT
;
if
(
capable
(
CAP_SYS_ADMIN
))
if
(
capable
(
CAP_SYS_ADMIN
))
...
@@ -630,13 +631,12 @@ static int lp_ioctl(struct inode *inode, struct file *file,
...
@@ -630,13 +631,12 @@ static int lp_ioctl(struct inode *inode, struct file *file,
#endif
#endif
case
LPGETFLAGS
:
case
LPGETFLAGS
:
status
=
LP_F
(
minor
);
status
=
LP_F
(
minor
);
if
(
copy_to_user
(
(
int
*
)
arg
,
&
status
,
sizeof
(
int
)))
if
(
copy_to_user
(
argp
,
&
status
,
sizeof
(
int
)))
return
-
EFAULT
;
return
-
EFAULT
;
break
;
break
;
case
LPSETTIMEOUT
:
case
LPSETTIMEOUT
:
if
(
copy_from_user
(
&
par_timeout
,
if
(
copy_from_user
(
&
par_timeout
,
argp
,
(
struct
timeval
*
)
arg
,
sizeof
(
struct
timeval
)))
{
sizeof
(
struct
timeval
)))
{
return
-
EFAULT
;
return
-
EFAULT
;
}
}
...
...
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