From patchwork Mon Feb 2 15:23:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 5766841 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D441FBF440 for ; Tue, 3 Feb 2015 08:14:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 14D4020B48 for ; Tue, 3 Feb 2015 08:14:02 +0000 (UTC) Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com [209.132.183.37]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 25DB020B46 for ; Tue, 3 Feb 2015 08:14:01 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t1389BZT053020; Tue, 3 Feb 2015 03:09:12 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id t12FNXcu001612 for ; Mon, 2 Feb 2015 10:23:33 -0500 Received: from mx1.redhat.com (ext-mx14.extmail.prod.ext.phx2.redhat.com [10.5.110.19]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t12FNXoE024138; Mon, 2 Feb 2015 10:23:33 -0500 Received: from mout.web.de (mout.web.de [212.227.15.3]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t12FNQRJ007461 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 2 Feb 2015 10:23:27 -0500 Received: from [192.168.1.2] ([78.49.21.25]) by smtp.web.de (mrweb004) with ESMTPSA (Nemesis) id 0MfCyA-1Y2Paa2SnS-00OkuY; Mon, 02 Feb 2015 16:23:22 +0100 Message-ID: <54CF9666.5060407@users.sourceforge.net> Date: Mon, 02 Feb 2015 16:23:18 +0100 From: SF Markus Elfring User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Alasdair Kergon , Mike Snitzer , Neil Brown , dm-devel@redhat.com, linux-raid@vger.kernel.org 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> <54CF93BB.40206@users.sourceforge.net> In-Reply-To: <54CF93BB.40206@users.sourceforge.net> X-Provags-ID: V03:K0:K2AiVsIC8oO2Jt/+Uu/c86Co3wqZ4Lgq4+VyGGcQfFD+OoPTtk/ Kcn05wmWuIWsNSBxwHvBqmSD5NcB6wwJyGVJ0/gKzaUhtbhZdOYqJvmd4Z3v4s/aekYDlcm sESU4dNIKTPu6rXwNW6mYcXqJx0l/ivxBUwM0UiM91uqJ4qb/DF/CgEKo77SP0k6wcWJI3t ESEyvNtC1dloyeMYlmZ+A== X-UI-Out-Filterresults: notjunk:1; X-RedHat-Spam-Score: -2.01 (BAYES_00, DCC_REPUT_13_19, RCVD_IN_DNSWL_NONE) 212.227.15.3 mout.web.de 212.227.15.3 mout.web.de X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Scanned-By: MIMEDefang 2.68 on 10.5.110.19 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Tue, 03 Feb 2015 02:43:28 -0500 Cc: Julia Lawall , kernel-janitors@vger.kernel.org, LKML Subject: [dm-devel] [PATCH 3/3] dm ioctl: Delete an unnecessary check before the function call "dm_table_destroy" X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Mon, 2 Feb 2015 15:30:37 +0100 The dm_table_destroy() 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 --- drivers/md/dm-ioctl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index 73f791b..4fac6cf 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c @@ -1053,8 +1053,7 @@ static int do_resume(struct dm_ioctl *param) * Since dm_swap_table synchronizes RCU, nobody should be in * read-side critical section already. */ - if (old_map) - dm_table_destroy(old_map); + dm_table_destroy(old_map); if (!r) __dev_status(md, param);