From patchwork Sun Jan 14 20:44:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 10162813 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 EEC9E602A7 for ; Sun, 14 Jan 2018 20:45:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF4FC28A7A for ; Sun, 14 Jan 2018 20:45:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D2B4A28A7D; Sun, 14 Jan 2018 20:45:03 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5DEE928A7A for ; Sun, 14 Jan 2018 20:45:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:References:To:From:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=trX4P2tYdBv8bqxqMIJFeT4YzfXLGL4BUXQ2GQelk8c=; b=sE+wYTlf47YyqV gJMFFOUpy11JOGaKESPNUDq9MkGaO/Ku2QI6p9qyo4aRhMXrYgF4qmUnLQ22pTwhKwPTpeiYoAUoD /9XR6HPqAV01Y9+aJblh+5MAxhD6O//JChZ9snYMYAy9zb9WkGnuI06FbDyJNndswvZGpSUCvg/j7 855YDDGQ/tN+QYhwvBl8e61REetXJf0/iTZehGa1ZihV66F2TpJhICTuQ1F7qyFU3JMxWRulB8kLu QQtisM1m/LDpWX7AisWwTg1Af1bXCFrwYGj+wwwfjP9zHv2mB8a3QFqe7kIGzL18CayINZB/5pDw+ Yw2oKjFSoEUaIu6NuHpQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eap9J-00027W-Mx; Sun, 14 Jan 2018 20:45:01 +0000 Received: from mout.web.de ([212.227.17.12]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eap9F-00025b-S2 for linux-arm-kernel@lists.infradead.org; Sun, 14 Jan 2018 20:44:59 +0000 Received: from [192.168.1.3] ([92.228.167.87]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MSads-1eT5uy3Kbs-00RaX5; Sun, 14 Jan 2018 21:44:45 +0100 Subject: [PATCH 3/3] mfd/abx500-core: Adjust 14 checks for null pointers From: SF Markus Elfring To: linux-arm-kernel@lists.infradead.org, Lee Jones , Linus Walleij References: Message-ID: <54712a5d-5874-c29a-40b4-5482ea06958c@users.sourceforge.net> Date: Sun, 14 Jan 2018 21:44:43 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB X-Provags-ID: V03:K0:3I0kMNmTFViPWGCicPBTwhqqpE7Kaj+kYCOFoopIMRYz04W1F3V sgkkahfvPrNByNsy28QQzMV+jUSHUv3YStaNkKYVCphFnY7D1Tsp8XiEUffY4udmbCq+81g s4OL/9/+75AcMLjHjfqQ9IFyNtjemq9cMKxU1wpJ4a9PmAaIU1bkTPoD5xhZ8Vj/oJZ+5XT eJITWvkWru+qpfCVkiHHg== X-UI-Out-Filterresults: notjunk:1; V01:K0:fIOg7Gzinzg=:NRd0hKnwbVeaazvXCzaPHG 5zqwlCtmn6fBmSo4lQliras9nQDJwZR+wkglWr2VXzgIB+GpQexrlCKLK4aoZ+/SI7+Y4lvqx bBPUYEcUDWwQMh9qWIyaHj+durQciHLmoMMOnPoxgbi7PTANwLHnFYoOGgkRa0R7GI6qEXFCJ +ybnR/MLFPKEsYiqHPkYtjtADXctVA4dbI09yckeXeLeYa5IN/Y7tHkm+q19To3m8M8RqEFS6 aVtQijo0K/qe4dxSLRP0r5a1IxQLpdXNB8MagE2kk/lR180cVmQOWKmtCBMi5dmW9JKl3j60V 3KkjjrRtTufLlhLjs4W4gNToSyHbk1LHT3ALYBwHdPqP2nl6XP6Rn0W6v3ma5sqtOflC8woC7 AcCos5BcoKHt0zrjTyINutmx9UTHnPEe1wI5Npi2vUKGCACkilfYxUDt0vaikeuD+WtR9wPNw bL9sVjjDRDaISilDO0MndPt3ybVnn4HDfS7FY54U9LUQLoaXZSbBzn1jirTG4Sg64Wujm9tbA YzxQKX7/O0wtd04WJnQmNsdonxSuWi7Vs6dc4METOJ0423nbb53N6OtWkSj4iomBHIostGAN5 PG5QNO1NIhiEGkjm8lwVxspES66PrjhgHrLDMtomqbbz4OgncYigw4eU9j1CiDHzfCQE8r7zO ElAc2smquBxY282Gnl8cxYQWPXojteLvj+T910GB7Ju6z0X7vMmGGHCS8FkLnFuEEFCAw/O5D QPM/ew4uj0iM22V2cQ5xjPpvEusG8/Ekzs5Kf6xtLptEfioV7F2BYCDB0H48AM1H+7LDbc3bW 6LcTZT7MfI+d/IUg8sPd5cE5uqfMGj0+iU+vDJuAV94xoxq+k0= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180114_124458_238935_A0FA040E X-CRM114-Status: UNSURE ( 8.85 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-janitors@vger.kernel.org, LKML Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Sun, 14 Jan 2018 21:31:50 +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/mfd/abx500-core.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/mfd/abx500-core.c b/drivers/mfd/abx500-core.c index 17176e91cbd0..f282d39a5917 100644 --- a/drivers/mfd/abx500-core.c +++ b/drivers/mfd/abx500-core.c @@ -65,7 +65,7 @@ int abx500_set_register_interruptible(struct device *dev, u8 bank, u8 reg, struct abx500_ops *ops; lookup_ops(dev->parent, &ops); - if ((ops != NULL) && (ops->set_register != NULL)) + if (ops && ops->set_register) return ops->set_register(dev, bank, reg, value); else return -ENOTSUPP; @@ -78,7 +78,7 @@ int abx500_get_register_interruptible(struct device *dev, u8 bank, u8 reg, struct abx500_ops *ops; lookup_ops(dev->parent, &ops); - if ((ops != NULL) && (ops->get_register != NULL)) + if (ops && ops->get_register) return ops->get_register(dev, bank, reg, value); else return -ENOTSUPP; @@ -91,7 +91,7 @@ int abx500_get_register_page_interruptible(struct device *dev, u8 bank, struct abx500_ops *ops; lookup_ops(dev->parent, &ops); - if ((ops != NULL) && (ops->get_register_page != NULL)) + if (ops && ops->get_register_page) return ops->get_register_page(dev, bank, first_reg, regvals, numregs); else @@ -105,7 +105,7 @@ int abx500_mask_and_set_register_interruptible(struct device *dev, u8 bank, struct abx500_ops *ops; lookup_ops(dev->parent, &ops); - if ((ops != NULL) && (ops->mask_and_set_register != NULL)) + if (ops && ops->mask_and_set_register) return ops->mask_and_set_register(dev, bank, reg, bitmask, bitvalues); else @@ -118,7 +118,7 @@ int abx500_get_chip_id(struct device *dev) struct abx500_ops *ops; lookup_ops(dev->parent, &ops); - if ((ops != NULL) && (ops->get_chip_id != NULL)) + if (ops && ops->get_chip_id) return ops->get_chip_id(dev); else return -ENOTSUPP; @@ -130,7 +130,7 @@ int abx500_event_registers_startup_state_get(struct device *dev, u8 *event) struct abx500_ops *ops; lookup_ops(dev->parent, &ops); - if ((ops != NULL) && (ops->event_registers_startup_state_get != NULL)) + if (ops && ops->event_registers_startup_state_get) return ops->event_registers_startup_state_get(dev, event); else return -ENOTSUPP; @@ -142,7 +142,7 @@ int abx500_startup_irq_enabled(struct device *dev, unsigned int irq) struct abx500_ops *ops; lookup_ops(dev->parent, &ops); - if ((ops != NULL) && (ops->startup_irq_enabled != NULL)) + if (ops && ops->startup_irq_enabled) return ops->startup_irq_enabled(dev, irq); else return -ENOTSUPP;