From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f71.google.com (mail-lf0-f71.google.com [209.85.215.71]) by kanga.kvack.org (Postfix) with ESMTP id 263356B0005 for ; Fri, 22 Jul 2016 14:02:20 -0400 (EDT) Received: by mail-lf0-f71.google.com with SMTP id r97so78494510lfi.2 for ; Fri, 22 Jul 2016 11:02:20 -0700 (PDT) Received: from mout.web.de (mout.web.de. [212.227.17.11]) by mx.google.com with ESMTPS id g76si10947528wmg.106.2016.07.22.11.02.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Jul 2016 11:02:18 -0700 (PDT) Subject: [PATCH] zsmalloc: Delete an unnecessary check before the function call "iput" 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.sourceforge.net> From: SF Markus Elfring Message-ID: <559cf499-4a01-25f9-c87f-24d906626a57@users.sourceforge.net> Date: Fri, 22 Jul 2016 20:02:08 +0200 MIME-Version: 1.0 In-Reply-To: <5317A59D.4@users.sourceforge.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: linux-mm@kvack.org, Minchan Kim , Nitin Gupta , Sergey Senozhatsky Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: Markus Elfring Date: Fri, 22 Jul 2016 19:54:20 +0200 The iput() 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 --- mm/zsmalloc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index 5e5237c..7b5fd2b 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -2181,8 +2181,7 @@ static int zs_register_migration(struct zs_pool *pool) static void zs_unregister_migration(struct zs_pool *pool) { flush_work(&pool->free_work); - if (pool->inode) - iput(pool->inode); + iput(pool->inode); } /* -- 2.9.2 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org