qcacmn: scan: 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 umac scan replace any such comparisons with
logical operations performed on the pointer itself.

Change-Id: I0127e39fb4278e9c8063e2b37e7b46a9311defe7
CRs-Fixed: 2420153
diff --git a/umac/scan/core/src/wlan_scan_cache_db.c b/umac/scan/core/src/wlan_scan_cache_db.c
index 87a7182..78e4742 100644
--- a/umac/scan/core/src/wlan_scan_cache_db.c
+++ b/umac/scan/core/src/wlan_scan_cache_db.c
@@ -108,7 +108,7 @@
  */
 static void scm_scan_entry_get_ref(struct scan_cache_node *scan_node)
 {
-	if (scan_node == NULL) {
+	if (!scan_node) {
 		scm_err("scan_node is NULL");
 		QDF_ASSERT(0);
 		return;
@@ -804,7 +804,7 @@
 	list_count = qdf_list_size(scan_list);
 	for (i = 0; i < list_count; i++) {
 		status = qdf_list_remove_front(scan_list, &next_node);
-		if (QDF_IS_STATUS_ERROR(status) || next_node == NULL) {
+		if (QDF_IS_STATUS_ERROR(status) || !next_node) {
 			scm_debug("list remove failure i:%d, lsize:%d, BSSID: %pM",
 				  i, list_count, hdr->i_addr3);
 			status = QDF_STATUS_E_INVAL;
diff --git a/umac/scan/core/src/wlan_scan_main.c b/umac/scan/core/src/wlan_scan_main.c
index 90de6c8..44a2bb6 100644
--- a/umac/scan/core/src/wlan_scan_main.c
+++ b/umac/scan/core/src/wlan_scan_main.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-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
@@ -30,7 +30,7 @@
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 
 	scan_obj = qdf_mem_malloc_atomic(sizeof(struct wlan_scan_obj));
-	if (scan_obj == NULL) {
+	if (!scan_obj) {
 		scm_err("Failed to allocate memory");
 		return QDF_STATUS_E_NOMEM;
 	}
@@ -79,7 +79,7 @@
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 
 	scan_vdev_obj = qdf_mem_malloc_atomic(sizeof(struct scan_vdev_obj));
-	if (scan_vdev_obj == NULL) {
+	if (!scan_vdev_obj) {
 		scm_err("Failed to allocate memory");
 		return QDF_STATUS_E_NOMEM;
 	}
diff --git a/umac/scan/dispatcher/inc/wlan_scan_utils_api.h b/umac/scan/dispatcher/inc/wlan_scan_utils_api.h
index a925164..d66d0cb 100644
--- a/umac/scan/dispatcher/inc/wlan_scan_utils_api.h
+++ b/umac/scan/dispatcher/inc/wlan_scan_utils_api.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-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
@@ -546,7 +546,7 @@
 	u_int16_t    buff_len;
 
 	/* iebuf can be NULL, ie_len must be a valid pointer. */
-	QDF_ASSERT(ie_len != NULL);
+	QDF_ASSERT(ie_len);
 	if (!ie_len)
 		return QDF_STATUS_E_NULL_VALUE;
 
@@ -557,7 +557,7 @@
 	 * it's large enough.
 	 * If no buffer is passed, just return the length of the IE blob.
 	 */
-	if (iebuf != NULL) {
+	if (iebuf) {
 		if (*ie_len >= buff_len) {
 			qdf_mem_copy(iebuf, buff, buff_len);
 			*ie_len = buff_len;
@@ -591,7 +591,7 @@
 }
 
 #define conv_ptr(_address, _base1, _base2) \
-	((_address != NULL) ? (((u_int8_t *) (_address) - \
+	((_address) ? (((u_int8_t *) (_address) - \
 	(u_int8_t *) (_base1)) + (u_int8_t *) (_base2)) : NULL)
 
 /**
diff --git a/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c b/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c
index ae05a1d..950abd5 100644
--- a/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c
+++ b/umac/scan/dispatcher/src/wlan_scan_ucfg_api.c
@@ -1488,7 +1488,7 @@
 		return QDF_STATUS_E_FAILURE;
 	}
 	scan_obj = wlan_psoc_get_scan_obj(psoc);
-	if (scan_obj == NULL) {
+	if (!scan_obj) {
 		scm_err("Failed to get scan object");
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -1633,7 +1633,7 @@
 		return QDF_STATUS_E_FAILURE;
 	}
 	scan_obj = wlan_psoc_get_scan_obj(psoc);
-	if (scan_obj == NULL) {
+	if (!scan_obj) {
 		scm_err("Failed to get scan object");
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -1658,7 +1658,7 @@
 	}
 	scm_db_deinit(psoc);
 	scan_obj = wlan_psoc_get_scan_obj(psoc);
-	if (scan_obj == NULL) {
+	if (!scan_obj) {
 		scm_err("Failed to get scan object");
 		return QDF_STATUS_E_FAILURE;
 	}
diff --git a/umac/scan/dispatcher/src/wlan_scan_utils_api.c b/umac/scan/dispatcher/src/wlan_scan_utils_api.c
index 74f9cf2..af5ef67 100644
--- a/umac/scan/dispatcher/src/wlan_scan_utils_api.c
+++ b/umac/scan/dispatcher/src/wlan_scan_utils_api.c
@@ -389,7 +389,7 @@
 util_scan_parse_vendor_ie(struct scan_cache_entry *scan_params,
 	struct ie_header *ie)
 {
-	if (scan_params->ie_list.vendor == NULL)
+	if (!scan_params->ie_list.vendor)
 		scan_params->ie_list.vendor = (uint8_t *)ie;
 
 	if (is_wpa_oui((uint8_t *)ie)) {
@@ -416,7 +416,7 @@
 		scan_params->ie_list.sonadv = (uint8_t *)ie;
 	} else if (is_ht_cap((uint8_t *)ie)) {
 		/* we only care if there isn't already an HT IE (ANA) */
-		if (scan_params->ie_list.htcap == NULL) {
+		if (!scan_params->ie_list.htcap) {
 			if (ie->ie_len != (WLAN_VENDOR_HT_IE_OFFSET_LEN +
 					   sizeof(struct htcap_cmn_ie)))
 				return QDF_STATUS_E_INVAL;
@@ -425,7 +425,7 @@
 		}
 	} else if (is_ht_info((uint8_t *)ie)) {
 		/* we only care if there isn't already an HT IE (ANA) */
-		if (scan_params->ie_list.htinfo == NULL) {
+		if (!scan_params->ie_list.htinfo) {
 			if (ie->ie_len != WLAN_VENDOR_HT_IE_OFFSET_LEN +
 					  sizeof(struct wlan_ie_htinfo_cmn))
 				return QDF_STATUS_E_INVAL;