Skip to content

Commit

Permalink
s390: Delete unnecessary checks before the function call "debug_unreg…
Browse files Browse the repository at this point in the history
…ister"

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: Markus Elfring <[email protected]>
Signed-off-by: Heiko Carstens <[email protected]>
Signed-off-by: Martin Schwidefsky <[email protected]>
  • Loading branch information
elfring authored and Martin Schwidefsky committed Nov 27, 2015
1 parent 69eea95 commit a6e975c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 16 deletions.
3 changes: 1 addition & 2 deletions drivers/s390/cio/chsc_sch.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,7 @@ static int __init chsc_init_dbfs(void)
debug_set_level(chsc_debug_log_id, 2);
return 0;
out:
if (chsc_debug_msg_id)
debug_unregister(chsc_debug_msg_id);
debug_unregister(chsc_debug_msg_id);
return -ENOMEM;
}

Expand Down
9 changes: 3 additions & 6 deletions drivers/s390/cio/cio.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,9 @@ static int __init cio_debug_init(void)
return 0;

out_unregister:
if (cio_debug_msg_id)
debug_unregister(cio_debug_msg_id);
if (cio_debug_trace_id)
debug_unregister(cio_debug_trace_id);
if (cio_debug_crw_id)
debug_unregister(cio_debug_crw_id);
debug_unregister(cio_debug_msg_id);
debug_unregister(cio_debug_trace_id);
debug_unregister(cio_debug_crw_id);
return -1;
}

Expand Down
6 changes: 2 additions & 4 deletions drivers/s390/cio/qdio_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,6 @@ void qdio_debug_exit(void)
{
qdio_clear_dbf_list();
debugfs_remove(debugfs_root);
if (qdio_dbf_setup)
debug_unregister(qdio_dbf_setup);
if (qdio_dbf_error)
debug_unregister(qdio_dbf_error);
debug_unregister(qdio_dbf_setup);
debug_unregister(qdio_dbf_error);
}
6 changes: 2 additions & 4 deletions drivers/s390/crypto/zcrypt_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1428,10 +1428,8 @@ int __init zcrypt_debug_init(void)
void zcrypt_debug_exit(void)
{
debugfs_remove(debugfs_root);
if (zcrypt_dbf_common)
debug_unregister(zcrypt_dbf_common);
if (zcrypt_dbf_devices)
debug_unregister(zcrypt_dbf_devices);
debug_unregister(zcrypt_dbf_common);
debug_unregister(zcrypt_dbf_devices);
}

/**
Expand Down

0 comments on commit a6e975c

Please sign in to comment.