Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753285AbeANUpE (ORCPT + 1 other); Sun, 14 Jan 2018 15:45:04 -0500 Received: from mout.web.de ([212.227.17.12]:53051 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752822AbeANUpB (ORCPT ); Sun, 14 Jan 2018 15:45:01 -0500 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 Cc: LKML , kernel-janitors@vger.kernel.org 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-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit 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= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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; -- 2.15.1