[PATCH] SGI-XPC: Delete unnecessary checks before unregister_sysctl_table()

SF Markus Elfring
2015-11-06T09:15:26Z

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 6 Nov 2015 10:08:46 +0100

The unregister_sysctl_table() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/misc/sgi-xp/xpc_main.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/misc/sgi-xp/xpc_main.c b/drivers/misc/sgi-xp/xpc_main.c
index 7f32712..8d4fcac 100644
--- a/drivers/misc/sgi-xp/xpc_main.c
+++ b/drivers/misc/sgi-xp/xpc_main.c
@@ -1046,9 +1046,7 @@ xpc_do_exit(enum xp_retval reason)
/* clear the interface to XPC's functions */
xpc_clear_interface();

- if (xpc_sysctl)
- unregister_sysctl_table(xpc_sysctl);
-
+ unregister_sysctl_table(xpc_sysctl);
xpc_teardown_partitions();

if (is_shub())
@@ -1331,9 +1329,7 @@ out_3:
(void)unregister_die_notifier(&xpc_die_notifier);
(void)unregister_reboot_notifier(&xpc_reboot_notifier);
out_2:
- if (xpc_sysctl)
- unregister_sysctl_table(xpc_sysctl);
-
+ unregister_sysctl_table(xpc_sysctl);
xpc_teardown_partitions();
out_1:
if (is_shub())
--
2.6.2