فهرست منبع

qcacld-3.0: pld: Replace explicit comparison to NULL

Per the Linux Kernel coding style, as enforced by the kernel
checkpatch script, pointers should not be explicitly compared to
NULL. Therefore within pld replace any such comparisons with logical
operations performed on the pointer itself.

Change-Id: I8092ddbb80bb39fc6ff560cca34e021b115f7fd7
CRs-Fixed: 2418390
Jeff Johnson 6 سال پیش
والد
کامیت
753f9d7861
5فایلهای تغییر یافته به همراه14 افزوده شده و 14 حذف شده
  1. 5 5
      core/pld/src/pld_common.c
  2. 3 3
      core/pld/src/pld_pcie.c
  3. 1 1
      core/pld/src/pld_sdio.c
  4. 3 3
      core/pld/src/pld_sdio.h
  5. 2 2
      core/pld/src/pld_snoc.c

+ 5 - 5
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;
 	}

+ 3 - 3
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);

+ 1 - 1
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));

+ 3 - 3
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

+ 2 - 2
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);