提交 a6e975c5 编写于 作者: M Markus Elfring 提交者: Martin Schwidefsky

s390: Delete unnecessary checks before the function call "debug_unregister"

The debug_unregister() function performs also input parameter validation.
Thus the test around the calls is not needed.

This issue was detected by using the Coccinelle software.
Signed-off-by: NMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 69eea95c
...@@ -185,8 +185,7 @@ static int __init chsc_init_dbfs(void) ...@@ -185,8 +185,7 @@ static int __init chsc_init_dbfs(void)
debug_set_level(chsc_debug_log_id, 2); debug_set_level(chsc_debug_log_id, 2);
return 0; return 0;
out: out:
if (chsc_debug_msg_id) debug_unregister(chsc_debug_msg_id);
debug_unregister(chsc_debug_msg_id);
return -ENOMEM; return -ENOMEM;
} }
......
...@@ -76,12 +76,9 @@ static int __init cio_debug_init(void) ...@@ -76,12 +76,9 @@ static int __init cio_debug_init(void)
return 0; return 0;
out_unregister: out_unregister:
if (cio_debug_msg_id) debug_unregister(cio_debug_msg_id);
debug_unregister(cio_debug_msg_id); debug_unregister(cio_debug_trace_id);
if (cio_debug_trace_id) debug_unregister(cio_debug_crw_id);
debug_unregister(cio_debug_trace_id);
if (cio_debug_crw_id)
debug_unregister(cio_debug_crw_id);
return -1; return -1;
} }
......
...@@ -366,8 +366,6 @@ void qdio_debug_exit(void) ...@@ -366,8 +366,6 @@ void qdio_debug_exit(void)
{ {
qdio_clear_dbf_list(); qdio_clear_dbf_list();
debugfs_remove(debugfs_root); debugfs_remove(debugfs_root);
if (qdio_dbf_setup) debug_unregister(qdio_dbf_setup);
debug_unregister(qdio_dbf_setup); debug_unregister(qdio_dbf_error);
if (qdio_dbf_error)
debug_unregister(qdio_dbf_error);
} }
...@@ -1428,10 +1428,8 @@ int __init zcrypt_debug_init(void) ...@@ -1428,10 +1428,8 @@ int __init zcrypt_debug_init(void)
void zcrypt_debug_exit(void) void zcrypt_debug_exit(void)
{ {
debugfs_remove(debugfs_root); debugfs_remove(debugfs_root);
if (zcrypt_dbf_common) debug_unregister(zcrypt_dbf_common);
debug_unregister(zcrypt_dbf_common); debug_unregister(zcrypt_dbf_devices);
if (zcrypt_dbf_devices)
debug_unregister(zcrypt_dbf_devices);
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册