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
986f1878
Commit
986f1878
authored
Apr 30, 2004
by
Rolf Eike Beer
Committed by
Deepak Saxena
Apr 30, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] SHPC PCI Hotplug: kill useless NULL checks
parent
b1f8fa94
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
32 deletions
+3
-32
drivers/pci/hotplug/shpchp_core.c
drivers/pci/hotplug/shpchp_core.c
+3
-32
No files found.
drivers/pci/hotplug/shpchp_core.c
View file @
986f1878
...
@@ -240,15 +240,11 @@ static int set_attention_status (struct hotplug_slot *hotplug_slot, u8 status)
...
@@ -240,15 +240,11 @@ static int set_attention_status (struct hotplug_slot *hotplug_slot, u8 status)
{
{
struct
slot
*
slot
=
get_slot
(
hotplug_slot
,
__FUNCTION__
);
struct
slot
*
slot
=
get_slot
(
hotplug_slot
,
__FUNCTION__
);
if
(
slot
==
NULL
)
return
-
ENODEV
;
dbg
(
"%s - physical_slot = %s
\n
"
,
__FUNCTION__
,
hotplug_slot
->
name
);
dbg
(
"%s - physical_slot = %s
\n
"
,
__FUNCTION__
,
hotplug_slot
->
name
);
hotplug_slot
->
info
->
attention_status
=
status
;
hotplug_slot
->
info
->
attention_status
=
status
;
slot
->
hpc_ops
->
set_attention_status
(
slot
,
status
);
slot
->
hpc_ops
->
set_attention_status
(
slot
,
status
);
return
0
;
return
0
;
}
}
...
@@ -256,9 +252,6 @@ static int set_attention_status (struct hotplug_slot *hotplug_slot, u8 status)
...
@@ -256,9 +252,6 @@ static int set_attention_status (struct hotplug_slot *hotplug_slot, u8 status)
static
int
enable_slot
(
struct
hotplug_slot
*
hotplug_slot
)
static
int
enable_slot
(
struct
hotplug_slot
*
hotplug_slot
)
{
{
struct
slot
*
slot
=
get_slot
(
hotplug_slot
,
__FUNCTION__
);
struct
slot
*
slot
=
get_slot
(
hotplug_slot
,
__FUNCTION__
);
if
(
slot
==
NULL
)
return
-
ENODEV
;
dbg
(
"%s - physical_slot = %s
\n
"
,
__FUNCTION__
,
hotplug_slot
->
name
);
dbg
(
"%s - physical_slot = %s
\n
"
,
__FUNCTION__
,
hotplug_slot
->
name
);
...
@@ -269,9 +262,6 @@ static int enable_slot (struct hotplug_slot *hotplug_slot)
...
@@ -269,9 +262,6 @@ static int enable_slot (struct hotplug_slot *hotplug_slot)
static
int
disable_slot
(
struct
hotplug_slot
*
hotplug_slot
)
static
int
disable_slot
(
struct
hotplug_slot
*
hotplug_slot
)
{
{
struct
slot
*
slot
=
get_slot
(
hotplug_slot
,
__FUNCTION__
);
struct
slot
*
slot
=
get_slot
(
hotplug_slot
,
__FUNCTION__
);
if
(
slot
==
NULL
)
return
-
ENODEV
;
dbg
(
"%s - physical_slot = %s
\n
"
,
__FUNCTION__
,
hotplug_slot
->
name
);
dbg
(
"%s - physical_slot = %s
\n
"
,
__FUNCTION__
,
hotplug_slot
->
name
);
...
@@ -282,10 +272,7 @@ static int get_power_status (struct hotplug_slot *hotplug_slot, u8 *value)
...
@@ -282,10 +272,7 @@ static int get_power_status (struct hotplug_slot *hotplug_slot, u8 *value)
{
{
struct
slot
*
slot
=
get_slot
(
hotplug_slot
,
__FUNCTION__
);
struct
slot
*
slot
=
get_slot
(
hotplug_slot
,
__FUNCTION__
);
int
retval
;
int
retval
;
if
(
slot
==
NULL
)
return
-
ENODEV
;
dbg
(
"%s - physical_slot = %s
\n
"
,
__FUNCTION__
,
hotplug_slot
->
name
);
dbg
(
"%s - physical_slot = %s
\n
"
,
__FUNCTION__
,
hotplug_slot
->
name
);
retval
=
slot
->
hpc_ops
->
get_power_status
(
slot
,
value
);
retval
=
slot
->
hpc_ops
->
get_power_status
(
slot
,
value
);
...
@@ -299,10 +286,7 @@ static int get_attention_status (struct hotplug_slot *hotplug_slot, u8 *value)
...
@@ -299,10 +286,7 @@ static int get_attention_status (struct hotplug_slot *hotplug_slot, u8 *value)
{
{
struct
slot
*
slot
=
get_slot
(
hotplug_slot
,
__FUNCTION__
);
struct
slot
*
slot
=
get_slot
(
hotplug_slot
,
__FUNCTION__
);
int
retval
;
int
retval
;
if
(
slot
==
NULL
)
return
-
ENODEV
;
dbg
(
"%s - physical_slot = %s
\n
"
,
__FUNCTION__
,
hotplug_slot
->
name
);
dbg
(
"%s - physical_slot = %s
\n
"
,
__FUNCTION__
,
hotplug_slot
->
name
);
retval
=
slot
->
hpc_ops
->
get_attention_status
(
slot
,
value
);
retval
=
slot
->
hpc_ops
->
get_attention_status
(
slot
,
value
);
...
@@ -316,10 +300,7 @@ static int get_latch_status (struct hotplug_slot *hotplug_slot, u8 *value)
...
@@ -316,10 +300,7 @@ static int get_latch_status (struct hotplug_slot *hotplug_slot, u8 *value)
{
{
struct
slot
*
slot
=
get_slot
(
hotplug_slot
,
__FUNCTION__
);
struct
slot
*
slot
=
get_slot
(
hotplug_slot
,
__FUNCTION__
);
int
retval
;
int
retval
;
if
(
slot
==
NULL
)
return
-
ENODEV
;
dbg
(
"%s - physical_slot = %s
\n
"
,
__FUNCTION__
,
hotplug_slot
->
name
);
dbg
(
"%s - physical_slot = %s
\n
"
,
__FUNCTION__
,
hotplug_slot
->
name
);
retval
=
slot
->
hpc_ops
->
get_latch_status
(
slot
,
value
);
retval
=
slot
->
hpc_ops
->
get_latch_status
(
slot
,
value
);
...
@@ -333,14 +314,10 @@ static int get_adapter_status (struct hotplug_slot *hotplug_slot, u8 *value)
...
@@ -333,14 +314,10 @@ static int get_adapter_status (struct hotplug_slot *hotplug_slot, u8 *value)
{
{
struct
slot
*
slot
=
get_slot
(
hotplug_slot
,
__FUNCTION__
);
struct
slot
*
slot
=
get_slot
(
hotplug_slot
,
__FUNCTION__
);
int
retval
;
int
retval
;
if
(
slot
==
NULL
)
return
-
ENODEV
;
dbg
(
"%s - physical_slot = %s
\n
"
,
__FUNCTION__
,
hotplug_slot
->
name
);
dbg
(
"%s - physical_slot = %s
\n
"
,
__FUNCTION__
,
hotplug_slot
->
name
);
retval
=
slot
->
hpc_ops
->
get_adapter_status
(
slot
,
value
);
retval
=
slot
->
hpc_ops
->
get_adapter_status
(
slot
,
value
);
if
(
retval
<
0
)
if
(
retval
<
0
)
*
value
=
hotplug_slot
->
info
->
adapter_status
;
*
value
=
hotplug_slot
->
info
->
adapter_status
;
...
@@ -351,9 +328,6 @@ static int get_max_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_sp
...
@@ -351,9 +328,6 @@ static int get_max_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_sp
{
{
struct
slot
*
slot
=
get_slot
(
hotplug_slot
,
__FUNCTION__
);
struct
slot
*
slot
=
get_slot
(
hotplug_slot
,
__FUNCTION__
);
int
retval
;
int
retval
;
if
(
slot
==
NULL
)
return
-
ENODEV
;
dbg
(
"%s - physical_slot = %s
\n
"
,
__FUNCTION__
,
hotplug_slot
->
name
);
dbg
(
"%s - physical_slot = %s
\n
"
,
__FUNCTION__
,
hotplug_slot
->
name
);
...
@@ -368,9 +342,6 @@ static int get_cur_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_sp
...
@@ -368,9 +342,6 @@ static int get_cur_bus_speed (struct hotplug_slot *hotplug_slot, enum pci_bus_sp
{
{
struct
slot
*
slot
=
get_slot
(
hotplug_slot
,
__FUNCTION__
);
struct
slot
*
slot
=
get_slot
(
hotplug_slot
,
__FUNCTION__
);
int
retval
;
int
retval
;
if
(
slot
==
NULL
)
return
-
ENODEV
;
dbg
(
"%s - physical_slot = %s
\n
"
,
__FUNCTION__
,
hotplug_slot
->
name
);
dbg
(
"%s - physical_slot = %s
\n
"
,
__FUNCTION__
,
hotplug_slot
->
name
);
...
...
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