From patchwork Fri Jan 13 17:19:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9516063 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C3BA4601E5 for ; Fri, 13 Jan 2017 17:20:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B2096286E3 for ; Fri, 13 Jan 2017 17:20:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A515028763; Fri, 13 Jan 2017 17:20:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D88F1286E3 for ; Fri, 13 Jan 2017 17:20:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751114AbdAMRTn (ORCPT ); Fri, 13 Jan 2017 12:19:43 -0500 Received: from mout.web.de ([212.227.17.12]:64320 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750787AbdAMRTl (ORCPT ); Fri, 13 Jan 2017 12:19:41 -0500 Received: from [192.168.1.2] ([78.49.203.248]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MJCek-1cQQok240A-002mDN; Fri, 13 Jan 2017 18:19:36 +0100 Subject: [PATCH 10/17] spi/ppc4xx: Adjust checks for null pointers in two functions To: linux-spi@vger.kernel.org, Mark Brown References: <1413e173-dbac-7a6e-09cb-2287300a335e@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org From: SF Markus Elfring Message-ID: Date: Fri, 13 Jan 2017 18:19:35 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <1413e173-dbac-7a6e-09cb-2287300a335e@users.sourceforge.net> X-Provags-ID: V03:K0:ncu9Xhp6A4C+z82bw2HbWv8f7KBd+ojuLhjsiA5OXDma2vAuK/h +am4e0W8qujBjIEh9TB3Ewswpn5BHCpHUErEGi7FLYGF+Ks7ucSoQDs7x7i2LoBM056NZuC rUnWkjR6ZlKSfmPCoqCiwbOovDHQh/rcHtxY4DaKVrCH7rpl0snYQT4NV14Q6+524gSM1D7 ixMgCYGoViLWonP72fCNw== X-UI-Out-Filterresults: notjunk:1; V01:K0:FgUHujNSH9M=:DoeG9qdx4HhqOaaTlqEd3d uRJOgieDo76Hhdsjga0c/jBFLInDDTTg2qlTZcofy2wUxbqIYEGisgdMnm/9x9uR8LcdnCd6P YGixHQ5uVxKJkhBa1yslbpZJ0W8LCJ1DZFA+qI3dyQhEGbMwrDqJWABiMhHH02cTcblFzCJOc t4XuS2PrnnURiuN49SDPl5mIaCYG+vkr8DaPR1uRQAnPohR2tPWEb0YZ5SaTUe0ZnuRRUDP88 Wz3ORwbsZaLE54FivEeZkceD0fnyXpSDVNvd7Z4c2K7Xx9DPibgrl6G8Ru3jwwNqTjRnnzLlK 8fxZk3CAHJRERMbh72RQQ36e5FeGMucbRcxV3WKeyGcjy1PPfJ0yo/mKs5gapZgvXkjjqBmoK +tEZ2hRFXq49sw2mbn4K735VJ0zBfe1m/AYCtp5Arp4957EmTD7+N0ByacCnP8Z8krjTo0siG yZ1hiOzEMEcbdXzSL1X8ldLItHWkXC+S2e8sDxii4mx7MobvBN0qw11zJhoBM6d6xFiMfXiOB rxigf6mzulWK4S75eGOX/zBRZeUpemxDtEsWvqQL2bVpiX1CMUUQOQevSA1LcyCiyT03fwv7a Oh8bcMdQSHsXm3wj3l8fOaDRemP3CFXbDXPFtxdvEYermp3JB0NaSmf8zCGbps3dyEgc4wyJR lyzWQ3Pja2J2cRwkrKZgG1GyWtmUIrweW1EzTCbF/pUUUAa/uj4gF1gOFEKVOpK45LpikhxNT GKHcimUpikx5L/RAQhBMOOp/UtnE6oRmuBNR2dg12Bnu5a99kwo4UHmkbseuokRZBea0RRNNX vV/zcUr Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Fri, 13 Jan 2017 14:56:10 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The script "checkpatch.pl" pointed information out like the following. Comparison to NULL could be written !… Thus fix the affected source code places. Signed-off-by: Markus Elfring --- drivers/spi/spi-ppc4xx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-ppc4xx.c b/drivers/spi/spi-ppc4xx.c index 967d94844b30..048794f043a0 100644 --- a/drivers/spi/spi-ppc4xx.c +++ b/drivers/spi/spi-ppc4xx.c @@ -229,7 +229,7 @@ static int spi_ppc4xx_setup(struct spi_device *spi) return -EINVAL; } - if (cs == NULL) { + if (!cs) { cs = kzalloc(sizeof *cs, GFP_KERNEL); if (!cs) return -ENOMEM; @@ -392,7 +392,7 @@ static int spi_ppc4xx_of_probe(struct platform_device *op) const unsigned int *clk; master = spi_alloc_master(dev, sizeof *hw); - if (master == NULL) + if (!master) return -ENOMEM; master->dev.of_node = np; platform_set_drvdata(op, master); @@ -466,14 +466,14 @@ static int spi_ppc4xx_of_probe(struct platform_device *op) /* Get the clock for the OPB */ opbnp = of_find_compatible_node(NULL, NULL, "ibm,opb"); - if (opbnp == NULL) { + if (!opbnp) { dev_err(dev, "OPB: cannot find node\n"); ret = -ENODEV; goto free_gpios; } /* Get the clock (Hz) for the OPB */ clk = of_get_property(opbnp, "clock-frequency", NULL); - if (clk == NULL) { + if (!clk) { dev_err(dev, "OPB: no clock-frequency property set\n"); of_node_put(opbnp); ret = -ENODEV;