Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by

Markus Elfring and committed by
Martin Schwidefsky
a6e975c5 69eea95c

+8 -16
+1 -2
drivers/s390/cio/chsc_sch.c
··· 185 185 debug_set_level(chsc_debug_log_id, 2); 186 186 return 0; 187 187 out: 188 - if (chsc_debug_msg_id) 189 - debug_unregister(chsc_debug_msg_id); 188 + debug_unregister(chsc_debug_msg_id); 190 189 return -ENOMEM; 191 190 } 192 191
+3 -6
drivers/s390/cio/cio.c
··· 76 76 return 0; 77 77 78 78 out_unregister: 79 - if (cio_debug_msg_id) 80 - debug_unregister(cio_debug_msg_id); 81 - if (cio_debug_trace_id) 82 - debug_unregister(cio_debug_trace_id); 83 - if (cio_debug_crw_id) 84 - debug_unregister(cio_debug_crw_id); 79 + debug_unregister(cio_debug_msg_id); 80 + debug_unregister(cio_debug_trace_id); 81 + debug_unregister(cio_debug_crw_id); 85 82 return -1; 86 83 } 87 84
+2 -4
drivers/s390/cio/qdio_debug.c
··· 366 366 { 367 367 qdio_clear_dbf_list(); 368 368 debugfs_remove(debugfs_root); 369 - if (qdio_dbf_setup) 370 - debug_unregister(qdio_dbf_setup); 371 - if (qdio_dbf_error) 372 - debug_unregister(qdio_dbf_error); 369 + debug_unregister(qdio_dbf_setup); 370 + debug_unregister(qdio_dbf_error); 373 371 }
+2 -4
drivers/s390/crypto/zcrypt_api.c
··· 1428 1428 void zcrypt_debug_exit(void) 1429 1429 { 1430 1430 debugfs_remove(debugfs_root); 1431 - if (zcrypt_dbf_common) 1432 - debug_unregister(zcrypt_dbf_common); 1433 - if (zcrypt_dbf_devices) 1434 - debug_unregister(zcrypt_dbf_devices); 1431 + debug_unregister(zcrypt_dbf_common); 1432 + debug_unregister(zcrypt_dbf_devices); 1435 1433 } 1436 1434 1437 1435 /**