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
e3676f76
Commit
e3676f76
authored
Aug 03, 2002
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drivers/sbus/char/openprom.c: Remove useless cli/sti usage.
parent
cdef47ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
27 deletions
+0
-27
drivers/sbus/char/openprom.c
drivers/sbus/char/openprom.c
+0
-27
No files found.
drivers/sbus/char/openprom.c
View file @
e3676f76
...
@@ -147,7 +147,6 @@ static int openprom_sunos_ioctl(struct inode * inode, struct file * file,
...
@@ -147,7 +147,6 @@ static int openprom_sunos_ioctl(struct inode * inode, struct file * file,
DATA
*
data
=
(
DATA
*
)
file
->
private_data
;
DATA
*
data
=
(
DATA
*
)
file
->
private_data
;
char
buffer
[
OPROMMAXPARAM
+
1
],
*
buf
;
char
buffer
[
OPROMMAXPARAM
+
1
],
*
buf
;
struct
openpromio
*
opp
;
struct
openpromio
*
opp
;
unsigned
long
flags
;
int
bufsize
,
len
,
error
=
0
;
int
bufsize
,
len
,
error
=
0
;
extern
char
saved_command_line
[];
extern
char
saved_command_line
[];
static
int
cnt
;
static
int
cnt
;
...
@@ -163,18 +162,14 @@ static int openprom_sunos_ioctl(struct inode * inode, struct file * file,
...
@@ -163,18 +162,14 @@ static int openprom_sunos_ioctl(struct inode * inode, struct file * file,
switch
(
cmd
)
{
switch
(
cmd
)
{
case
OPROMGETOPT
:
case
OPROMGETOPT
:
case
OPROMGETPROP
:
case
OPROMGETPROP
:
save_and_cli
(
flags
);
len
=
prom_getproplen
(
node
,
opp
->
oprom_array
);
len
=
prom_getproplen
(
node
,
opp
->
oprom_array
);
restore_flags
(
flags
);
if
(
len
<=
0
||
len
>
bufsize
)
{
if
(
len
<=
0
||
len
>
bufsize
)
{
error
=
copyout
((
void
*
)
arg
,
opp
,
sizeof
(
int
));
error
=
copyout
((
void
*
)
arg
,
opp
,
sizeof
(
int
));
break
;
break
;
}
}
save_and_cli
(
flags
);
len
=
prom_getproperty
(
node
,
opp
->
oprom_array
,
buffer
,
bufsize
);
len
=
prom_getproperty
(
node
,
opp
->
oprom_array
,
buffer
,
bufsize
);
restore_flags
(
flags
);
memcpy
(
opp
->
oprom_array
,
buffer
,
len
);
memcpy
(
opp
->
oprom_array
,
buffer
,
len
);
opp
->
oprom_array
[
len
]
=
'\0'
;
opp
->
oprom_array
[
len
]
=
'\0'
;
...
@@ -185,9 +180,7 @@ static int openprom_sunos_ioctl(struct inode * inode, struct file * file,
...
@@ -185,9 +180,7 @@ static int openprom_sunos_ioctl(struct inode * inode, struct file * file,
case
OPROMNXTOPT
:
case
OPROMNXTOPT
:
case
OPROMNXTPROP
:
case
OPROMNXTPROP
:
save_and_cli
(
flags
);
buf
=
prom_nextprop
(
node
,
opp
->
oprom_array
,
buffer
);
buf
=
prom_nextprop
(
node
,
opp
->
oprom_array
,
buffer
);
restore_flags
(
flags
);
len
=
strlen
(
buf
);
len
=
strlen
(
buf
);
if
(
len
==
0
||
len
+
1
>
bufsize
)
{
if
(
len
==
0
||
len
+
1
>
bufsize
)
{
...
@@ -207,10 +200,8 @@ static int openprom_sunos_ioctl(struct inode * inode, struct file * file,
...
@@ -207,10 +200,8 @@ static int openprom_sunos_ioctl(struct inode * inode, struct file * file,
buf
=
opp
->
oprom_array
+
strlen
(
opp
->
oprom_array
)
+
1
;
buf
=
opp
->
oprom_array
+
strlen
(
opp
->
oprom_array
)
+
1
;
len
=
opp
->
oprom_array
+
bufsize
-
buf
;
len
=
opp
->
oprom_array
+
bufsize
-
buf
;
save_and_cli
(
flags
);
error
=
prom_setprop
(
options_node
,
opp
->
oprom_array
,
error
=
prom_setprop
(
options_node
,
opp
->
oprom_array
,
buf
,
len
);
buf
,
len
);
restore_flags
(
flags
);
if
(
error
<
0
)
if
(
error
<
0
)
error
=
-
EINVAL
;
error
=
-
EINVAL
;
...
@@ -226,13 +217,11 @@ static int openprom_sunos_ioctl(struct inode * inode, struct file * file,
...
@@ -226,13 +217,11 @@ static int openprom_sunos_ioctl(struct inode * inode, struct file * file,
node
=
*
((
int
*
)
opp
->
oprom_array
);
node
=
*
((
int
*
)
opp
->
oprom_array
);
save_and_cli
(
flags
);
switch
(
cmd
)
{
switch
(
cmd
)
{
case
OPROMNEXT
:
node
=
__prom_getsibling
(
node
);
break
;
case
OPROMNEXT
:
node
=
__prom_getsibling
(
node
);
break
;
case
OPROMCHILD
:
node
=
__prom_getchild
(
node
);
break
;
case
OPROMCHILD
:
node
=
__prom_getchild
(
node
);
break
;
case
OPROMSETCUR
:
break
;
case
OPROMSETCUR
:
break
;
}
}
restore_flags
(
flags
);
data
->
current_node
=
node
;
data
->
current_node
=
node
;
*
((
int
*
)
opp
->
oprom_array
)
=
node
;
*
((
int
*
)
opp
->
oprom_array
)
=
node
;
...
@@ -264,9 +253,7 @@ static int openprom_sunos_ioctl(struct inode * inode, struct file * file,
...
@@ -264,9 +253,7 @@ static int openprom_sunos_ioctl(struct inode * inode, struct file * file,
break
;
break
;
case
OPROMPATH2NODE
:
case
OPROMPATH2NODE
:
save_and_cli
(
flags
);
node
=
prom_finddevice
(
opp
->
oprom_array
);
node
=
prom_finddevice
(
opp
->
oprom_array
);
restore_flags
(
flags
);
data
->
current_node
=
node
;
data
->
current_node
=
node
;
*
((
int
*
)
opp
->
oprom_array
)
=
node
;
*
((
int
*
)
opp
->
oprom_array
)
=
node
;
opp
->
oprom_size
=
sizeof
(
int
);
opp
->
oprom_size
=
sizeof
(
int
);
...
@@ -361,7 +348,6 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file,
...
@@ -361,7 +348,6 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file,
{
{
DATA
*
data
=
(
DATA
*
)
file
->
private_data
;
DATA
*
data
=
(
DATA
*
)
file
->
private_data
;
struct
opiocdesc
op
;
struct
opiocdesc
op
;
unsigned
long
flags
;
int
error
,
node
,
len
;
int
error
,
node
,
len
;
char
*
str
,
*
tmp
;
char
*
str
,
*
tmp
;
char
buffer
[
64
];
char
buffer
[
64
];
...
@@ -379,9 +365,7 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file,
...
@@ -379,9 +365,7 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file,
if
(
error
)
if
(
error
)
return
error
;
return
error
;
save_and_cli
(
flags
);
len
=
prom_getproplen
(
op
.
op_nodeid
,
str
);
len
=
prom_getproplen
(
op
.
op_nodeid
,
str
);
restore_flags
(
flags
);
if
(
len
>
op
.
op_buflen
)
{
if
(
len
>
op
.
op_buflen
)
{
kfree
(
str
);
kfree
(
str
);
...
@@ -405,9 +389,7 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file,
...
@@ -405,9 +389,7 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file,
return
-
ENOMEM
;
return
-
ENOMEM
;
}
}
save_and_cli
(
flags
);
prom_getproperty
(
op
.
op_nodeid
,
str
,
tmp
,
len
);
prom_getproperty
(
op
.
op_nodeid
,
str
,
tmp
,
len
);
restore_flags
(
flags
);
tmp
[
len
]
=
'\0'
;
tmp
[
len
]
=
'\0'
;
...
@@ -431,9 +413,7 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file,
...
@@ -431,9 +413,7 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file,
if
(
error
)
if
(
error
)
return
error
;
return
error
;
save_and_cli
(
flags
);
tmp
=
prom_nextprop
(
op
.
op_nodeid
,
str
,
buffer
);
tmp
=
prom_nextprop
(
op
.
op_nodeid
,
str
,
buffer
);
restore_flags
(
flags
);
if
(
tmp
)
{
if
(
tmp
)
{
len
=
strlen
(
tmp
);
len
=
strlen
(
tmp
);
...
@@ -481,9 +461,7 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file,
...
@@ -481,9 +461,7 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file,
return
error
;
return
error
;
}
}
save_and_cli
(
flags
);
len
=
prom_setprop
(
op
.
op_nodeid
,
str
,
tmp
,
op
.
op_buflen
+
1
);
len
=
prom_setprop
(
op
.
op_nodeid
,
str
,
tmp
,
op
.
op_buflen
+
1
);
restore_flags
(
flags
);
if
(
len
!=
op
.
op_buflen
)
if
(
len
!=
op
.
op_buflen
)
return
-
EINVAL
;
return
-
EINVAL
;
...
@@ -503,12 +481,10 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file,
...
@@ -503,12 +481,10 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file,
if
(
copy_from_user
(
&
node
,
(
void
*
)
arg
,
sizeof
(
int
)))
if
(
copy_from_user
(
&
node
,
(
void
*
)
arg
,
sizeof
(
int
)))
return
-
EFAULT
;
return
-
EFAULT
;
save_and_cli
(
flags
);
if
(
cmd
==
OPIOCGETNEXT
)
if
(
cmd
==
OPIOCGETNEXT
)
node
=
__prom_getsibling
(
node
);
node
=
__prom_getsibling
(
node
);
else
else
node
=
__prom_getchild
(
node
);
node
=
__prom_getchild
(
node
);
restore_flags
(
flags
);
if
(
__copy_to_user
((
void
*
)
arg
,
&
node
,
sizeof
(
int
)))
if
(
__copy_to_user
((
void
*
)
arg
,
&
node
,
sizeof
(
int
)))
return
-
EFAULT
;
return
-
EFAULT
;
...
@@ -624,7 +600,6 @@ static struct miscdevice openprom_dev = {
...
@@ -624,7 +600,6 @@ static struct miscdevice openprom_dev = {
static
int
__init
openprom_init
(
void
)
static
int
__init
openprom_init
(
void
)
{
{
unsigned
long
flags
;
int
error
;
int
error
;
error
=
misc_register
(
&
openprom_dev
);
error
=
misc_register
(
&
openprom_dev
);
...
@@ -633,10 +608,8 @@ static int __init openprom_init(void)
...
@@ -633,10 +608,8 @@ static int __init openprom_init(void)
return
error
;
return
error
;
}
}
save_and_cli
(
flags
);
options_node
=
prom_getchild
(
prom_root_node
);
options_node
=
prom_getchild
(
prom_root_node
);
options_node
=
prom_searchsiblings
(
options_node
,
"options"
);
options_node
=
prom_searchsiblings
(
options_node
,
"options"
);
restore_flags
(
flags
);
if
(
options_node
==
0
||
options_node
==
-
1
)
{
if
(
options_node
==
0
||
options_node
==
-
1
)
{
printk
(
KERN_ERR
"openprom: unable to find options node
\n
"
);
printk
(
KERN_ERR
"openprom: unable to find options node
\n
"
);
...
...
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