diff --git a/core/pld/src/pld_common.c b/core/pld/src/pld_common.c index d01d65d69b79..1b67020ff81d 100644 --- a/core/pld/src/pld_common.c +++ b/core/pld/src/pld_common.c @@ -130,7 +130,7 @@ int pld_add_dev(struct pld_context *pld_context, struct dev_node *dev_node; dev_node = kzalloc(sizeof(*dev_node), GFP_KERNEL); - if (dev_node == NULL) + if (!dev_node) return -ENOMEM; dev_node->dev = dev; @@ -175,7 +175,7 @@ static struct dev_node *pld_get_dev_node(struct device *dev) pld_context = pld_get_global_context(); - if (dev == NULL || pld_context == NULL) { + if (!dev || !pld_context) { pr_err("Invalid info: dev %pK, context %pK\n", dev, pld_context); return NULL; @@ -244,7 +244,7 @@ int pld_register_driver(struct pld_driver_ops *ops) pld_context = pld_get_global_context(); - if (pld_context == NULL) { + if (!pld_context) { pr_err("global context is NULL\n"); ret = -ENODEV; goto out; @@ -324,12 +324,12 @@ void pld_unregister_driver(void) pld_context = pld_get_global_context(); - if (pld_context == NULL) { + if (!pld_context) { pr_err("global context is NULL\n"); return; } - if (pld_context->ops == NULL) { + if (!pld_context->ops) { pr_err("driver not registered\n"); return; } diff --git a/core/pld/src/pld_pcie.c b/core/pld/src/pld_pcie.c index 021b212a111e..0292cc76385b 100644 --- a/core/pld/src/pld_pcie.c +++ b/core/pld/src/pld_pcie.c @@ -632,7 +632,7 @@ int pld_pcie_get_fw_files_for_target(struct device *dev, int ret = 0; struct cnss_fw_files cnss_fw_files; - if (pfw_files == NULL) + if (!pfw_files) return -ENODEV; memset(pfw_files, 0, sizeof(*pfw_files)); @@ -675,7 +675,7 @@ int pld_pcie_get_platform_cap(struct device *dev, struct pld_platform_cap *cap) int ret = 0; struct cnss_platform_cap cnss_cap; - if (cap == NULL) + if (!cap) return -ENODEV; ret = cnss_get_platform_cap(dev, &cnss_cap); @@ -701,7 +701,7 @@ int pld_pcie_get_soc_info(struct device *dev, struct pld_soc_info *info) int ret = 0; struct cnss_soc_info cnss_info = {0}; - if (info == NULL) + if (!info) return -ENODEV; ret = cnss_get_soc_info(dev, &cnss_info); diff --git a/core/pld/src/pld_sdio.c b/core/pld/src/pld_sdio.c index 0299b887212b..3a2706d0ee02 100644 --- a/core/pld/src/pld_sdio.c +++ b/core/pld/src/pld_sdio.c @@ -369,7 +369,7 @@ int pld_sdio_get_fw_files_for_target(struct pld_fw_files *pfw_files, int ret = 0; struct cnss_fw_files cnss_fw_files; - if (pfw_files == NULL) + if (!pfw_files) return -ENODEV; memset(pfw_files, 0, sizeof(*pfw_files)); diff --git a/core/pld/src/pld_sdio.h b/core/pld/src/pld_sdio.h index 769663ecb864..183def9435fa 100644 --- a/core/pld/src/pld_sdio.h +++ b/core/pld/src/pld_sdio.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -201,7 +201,7 @@ static inline void *pld_hif_sdio_get_virt_ramdump_mem(struct device *dev, length = TOTAL_DUMP_SIZE; - if (size != NULL) + if (size) *size = (unsigned long)length; if (in_interrupt() || irqs_disabled() || in_atomic()) @@ -218,7 +218,7 @@ static inline void *pld_hif_sdio_get_virt_ramdump_mem(struct device *dev, */ static inline void pld_hif_sdio_release_ramdump_mem(unsigned long *address) { - if (address != NULL) + if (address) kfree(address); } #endif diff --git a/core/pld/src/pld_snoc.c b/core/pld/src/pld_snoc.c index 3eefd0d9ba2d..775d235cfee0 100644 --- a/core/pld/src/pld_snoc.c +++ b/core/pld/src/pld_snoc.c @@ -248,7 +248,7 @@ static int pld_snoc_uevent(struct device *dev, data.uevent = PLD_FW_CRASHED; break; case ICNSS_UEVENT_FW_DOWN: - if (uevent->data == NULL) + if (!uevent->data) return -EINVAL; uevent_data = (struct icnss_uevent_fw_down_data *)uevent->data; data.uevent = PLD_FW_DOWN; @@ -384,7 +384,7 @@ int pld_snoc_get_soc_info(struct device *dev, struct pld_soc_info *info) int errno; struct icnss_soc_info icnss_info = {0}; - if (info == NULL || !dev) + if (!info || !dev) return -ENODEV; errno = icnss_get_soc_info(dev, &icnss_info);