From mboxrd@z Thu Jan 1 00:00:00 1970 From: SF Markus Elfring Subject: [PATCH] net-RDS: Delete an unnecessary check before the function call "module_put" Date: Thu, 02 Jul 2015 18:08:19 +0200 Message-ID: <559561F3.2040107@users.sourceforge.net> References: <5307CAA2.8060406@users.sourceforge.net> <530A086E.8010901@users.sourceforge.net> <530A72AA.3000601@users.sourceforge.net> <530B5FB6.6010207@users.sourceforge.net> <530C5E18.1020800@users.sourceforge.net> <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.so urceforge.net> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: LKML , kernel-janitors , Julia Lawall To: Chien Yen , "David S. Miller" , rds-devel@oss.oracle.com, netdev@vger.kernel.org Return-path: Received: from mout.web.de ([212.227.15.3]:62114 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753790AbbGBQIl (ORCPT ); Thu, 2 Jul 2015 12:08:41 -0400 In-Reply-To: <5317A59D.4@users.sourceforge.net> Sender: netdev-owner@vger.kernel.org List-ID: From: Markus Elfring Date: Thu, 2 Jul 2015 17:58:21 +0200 The module_put() 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 --- net/rds/transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/rds/transport.c b/net/rds/transport.c index 8b4a6cd..83498e1 100644 --- a/net/rds/transport.c +++ b/net/rds/transport.c @@ -73,7 +73,7 @@ EXPORT_SYMBOL_GPL(rds_trans_unregister); void rds_trans_put(struct rds_transport *trans) { - if (trans && trans->t_owner) + if (trans) module_put(trans->t_owner); } -- 2.4.5