From patchwork Thu Jun 25 11:38:17 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: 6674891 Return-Path: X-Original-To: patchwork-linux-omap@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 7557AC05AC for ; Thu, 25 Jun 2015 11:39:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A49122066D for ; Thu, 25 Jun 2015 11:39:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C2FF52060B for ; Thu, 25 Jun 2015 11:39:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751283AbbFYLiw (ORCPT ); Thu, 25 Jun 2015 07:38:52 -0400 Received: from mout.web.de ([212.227.15.4]:51327 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751114AbbFYLiu (ORCPT ); Thu, 25 Jun 2015 07:38:50 -0400 Received: from [192.168.1.2] ([77.181.56.149]) by smtp.web.de (mrweb001) with ESMTPSA (Nemesis) id 0LpOOj-1Ye04746J3-00fFFl; Thu, 25 Jun 2015 13:38:19 +0200 Message-ID: <558BE829.4070901@users.sourceforge.net> Date: Thu, 25 Jun 2015 13:38:17 +0200 From: SF Markus Elfring User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Tony Lindgren , Russell King , linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org CC: LKML , kernel-janitors@vger.kernel.org, Julia Lawall Subject: [PATCH 1/2] ARM-OMAP2+: Delete an unnecessary check before the function call "omap_device_delete" 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> <558BE713.1020409@users.sourceforge.net> In-Reply-To: <558BE713.1020409@users.sourceforge.net> X-Provags-ID: V03:K0:C6T3Wu4aOUTryx87u288q25qVNr9ZaFTyCjmfzdTGiZ0xtHq6pd 7ICsCS82no195yJcvkRbzefWzns0bc3yhH4UuJm1mF86IIhK14JBhobNMx82iTJlyqh9gFi +5h1fFRpEgfeVgaBsGTaAQG6kXZMu0yarzJ441HSslORrDAd24MAWJf/nKpu7pSWVTH+lb5 SRr397uVWvdFRMVfUGlQA== X-UI-Out-Filterresults: notjunk:1; V01:K0:tGVDiQI6dIM=:pKPlB0Soi33SkqV8uD6N3Y M/zVbK5EBinTAJdQ04dHO8UowllUmLoeJc1JP2+LuMpEDM4wxzNT8ZnTL+90nKggy86O8Zhw3 ahkYQlsF/vKtjwtVplHF6ipQWt0f4+7V/hrvJD4SnB/9FDRKM/Qdvzw4/If6hPimCkdY9An3x /mFcPyVXlmiT0EfSk87Z6yBl3ZVBTgks/7ZjZSSr4nMsiNzMwXE+CPT1RzT5wtOPYOcSNoKIs 5XG1ERozH019yrsKU7n51q9v2YkgbbnURWgPoWVjJI9mDNYWy+5zi6RWoLYhfLUglVSYYIlWG oaFm6w7S56FUAX5qNHWFdy365zJT5Xs4C/sz0ZK4ZCeYKV8lUQghRS+43CJBDEq1cuZbPmGon GdOUaHSCFAqe/8Yj6R9qbBVCQei8mEzDa7spu16IhcaDiuVeclFkmJ6yQ1Xy8r94R18BVwtZe hz/Jyot+E1LZE2OvzteOVIaIvcsBcQef5YgZDyaogTOB0jbi92iPT0Cu9MdbCKqzZwK6FVndY eY0pWrRJu4OYjnGH/ISrMMy+jZ3US/WIPXlGhBP8pN/0daAeLzYUq4/ZovYL486C1Jae/f4Ee A3bHUz8aDpdf8Cen/ITDA5qoRx3pZ0+VfN8OzEx67R/cNiifrbX19p03k1dyUAKyEAQu0/bk7 Ekcb4plJsG4uLiqJW4zu7kjZ6GQ+07uahClQZF3XdTwpnG61L43GJzTUO7Bf63GVpHZM= Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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: Thu, 25 Jun 2015 13:00:11 +0200 The omap_device_delete() 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 --- arch/arm/mach-omap2/omap_device.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c index 4cb8fd9..196366e 100644 --- a/arch/arm/mach-omap2/omap_device.c +++ b/arch/arm/mach-omap2/omap_device.c @@ -193,8 +193,7 @@ static int _omap_device_notifier_call(struct notifier_block *nb, switch (event) { case BUS_NOTIFY_DEL_DEVICE: - if (pdev->archdata.od) - omap_device_delete(pdev->archdata.od); + omap_device_delete(pdev->archdata.od); break; case BUS_NOTIFY_ADD_DEVICE: if (pdev->dev.of_node)