]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
staging: lustre: Deletion of unnecessary checks before three function calls
authorMarkus Elfring <elfring@users.sourceforge.net>
Tue, 14 Jul 2015 07:35:42 +0000 (09:35 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jul 2015 21:31:33 +0000 (14:31 -0700)
commita5cb88804d51b9d272d1d15ea348a244ba4d26c3
treeb3fd9ce04c8578941cbd61a3e352f122d7af4de9
parent5f37ac9343db1d0d3a9028d963eafe834053a0fb
staging: lustre: Deletion of unnecessary checks before three function calls

The following functions test whether their argument is NULL and then
return immediately.
* kfree
* ll_file_data_put
* ptlrpc_connection_put

Thus the test around such calls is not needed.

This issue was detected by using the Coccinelle software.

See also a previous update suggestion:
"remove unneeded null test before free" by Julia Lawall
https://lkml.org/lkml/2015/5/1/498
https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg878600.html

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/llite/file.c
drivers/staging/lustre/lustre/llite/llite_lib.c
drivers/staging/lustre/lustre/ptlrpc/import.c
drivers/staging/lustre/lustre/ptlrpc/service.c