浏览代码

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

Change-Id: I0f556e8baa9126511420a8d4c1b1a5e4ee220bab
CRs-Fixed: 2420149
Jeff Johnson 6 年之前
父节点
当前提交
dcb2769793

+ 2 - 2
umac/cmn_services/obj_mgr/inc/wlan_objmgr_pdev_obj.h

@@ -832,7 +832,7 @@ static inline void wlan_pdev_set_tgt_if_handle(struct wlan_objmgr_pdev *pdev,
 			void *tgt_if_handle)
 {
 	/* This API is invoked with lock acquired, do not add log prints */
-	if (pdev == NULL)
+	if (!pdev)
 		return;
 
 	pdev->tgt_if_handle = tgt_if_handle;
@@ -848,7 +848,7 @@ static inline void wlan_pdev_set_tgt_if_handle(struct wlan_objmgr_pdev *pdev,
  */
 static inline void *wlan_pdev_get_tgt_if_handle(struct wlan_objmgr_pdev *pdev)
 {
-	if (pdev == NULL)
+	if (!pdev)
 		return NULL;
 
 	return pdev->tgt_if_handle;

+ 3 - 3
umac/cmn_services/obj_mgr/inc/wlan_objmgr_peer_obj.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
@@ -527,7 +527,7 @@ static inline struct wlan_objmgr_peer *wlan_peer_get_next_peer_of_vdev(
 	qdf_list_node_t *next_node = NULL;
 
 	/* This API is invoked with lock acquired, do not add log prints */
-	if (peer == NULL)
+	if (!peer)
 		return NULL;
 
 	node = &peer->vdev_peer;
@@ -598,7 +598,7 @@ static inline struct wlan_objmgr_peer *wlan_peer_get_next_peer_of_psoc(
 	qdf_list_node_t *next_node = NULL;
 
 	/* This API is invoked with lock acquired, do not add log prints */
-	if (peer == NULL)
+	if (!peer)
 		return NULL;
 
 	node = &peer->psoc_peer;

+ 10 - 10
umac/cmn_services/obj_mgr/inc/wlan_objmgr_psoc_obj.h

@@ -934,7 +934,7 @@ static inline void wlan_psoc_set_nif_phy_version(struct wlan_objmgr_psoc *psoc,
 static inline uint32_t wlan_psoc_get_nif_phy_version(
 			struct wlan_objmgr_psoc *psoc)
 {
-	if (psoc == NULL)
+	if (!psoc)
 		return (uint32_t)-1;
 
 	return psoc->soc_nif.phy_version;
@@ -966,7 +966,7 @@ static inline void wlan_psoc_set_dev_type(struct wlan_objmgr_psoc *psoc,
 static inline WLAN_DEV_TYPE wlan_objmgr_psoc_get_dev_type(
 				struct wlan_objmgr_psoc *psoc)
 {
-	if (psoc == NULL)
+	if (!psoc)
 		return (uint32_t)-1;
 
 	return psoc->soc_nif.phy_type;
@@ -1167,7 +1167,7 @@ static inline void wlan_psoc_set_hw_macaddr(struct wlan_objmgr_psoc *psoc,
 					uint8_t *macaddr)
 {
 	/* This API is invoked with lock acquired, do not add log prints */
-	if (psoc != NULL)
+	if (psoc)
 		WLAN_ADDR_COPY(psoc->soc_nif.soc_hw_macaddr, macaddr);
 }
 
@@ -1181,7 +1181,7 @@ static inline void wlan_psoc_set_hw_macaddr(struct wlan_objmgr_psoc *psoc,
  */
 static inline uint8_t *wlan_psoc_get_hw_macaddr(struct wlan_objmgr_psoc *psoc)
 {
-	if (psoc == NULL)
+	if (!psoc)
 		return NULL;
 
 	return psoc->soc_nif.soc_hw_macaddr;
@@ -1209,7 +1209,7 @@ void *wlan_objmgr_psoc_get_comp_private_obj(struct wlan_objmgr_psoc *psoc,
  */
 static inline uint8_t wlan_psoc_get_pdev_count(struct wlan_objmgr_psoc *psoc)
 {
-	if (psoc == NULL)
+	if (!psoc)
 		return 0;
 
 	return psoc->soc_objmgr.wlan_pdev_count;
@@ -1227,7 +1227,7 @@ static inline uint8_t wlan_psoc_get_pdev_count(struct wlan_objmgr_psoc *psoc)
 static inline void wlan_psoc_set_tgt_if_handle(struct wlan_objmgr_psoc *psoc,
 			void *tgt_if_handle)
 {
-	if (psoc == NULL)
+	if (!psoc)
 		return;
 
 	psoc->tgt_if_handle = tgt_if_handle;
@@ -1243,7 +1243,7 @@ static inline void wlan_psoc_set_tgt_if_handle(struct wlan_objmgr_psoc *psoc,
  */
 static inline void *wlan_psoc_get_tgt_if_handle(struct wlan_objmgr_psoc *psoc)
 {
-	if (psoc == NULL)
+	if (!psoc)
 		return NULL;
 
 	return psoc->tgt_if_handle;
@@ -1260,7 +1260,7 @@ static inline void *wlan_psoc_get_tgt_if_handle(struct wlan_objmgr_psoc *psoc)
 static inline qdf_device_t wlan_psoc_get_qdf_dev(
 			struct wlan_objmgr_psoc *psoc)
 {
-	if (psoc == NULL)
+	if (!psoc)
 		return NULL;
 
 	return psoc->soc_objmgr.qdf_dev;
@@ -1279,7 +1279,7 @@ static inline void wlan_psoc_set_qdf_dev(
 			struct wlan_objmgr_psoc *psoc,
 			qdf_device_t dev)
 {
-	if (psoc == NULL)
+	if (!psoc)
 		return;
 
 	psoc->soc_objmgr.qdf_dev = dev;
@@ -1476,7 +1476,7 @@ void wlan_objmgr_psoc_check_for_peer_leaks(struct wlan_objmgr_psoc *psoc);
 static inline uint8_t wlan_objmgr_psoc_get_band_capability(
 		struct wlan_objmgr_psoc *psoc)
 {
-	if (psoc == NULL)
+	if (!psoc)
 		return 0;
 
 	return psoc->soc_nif.user_config.band_capability;

+ 3 - 3
umac/cmn_services/obj_mgr/inc/wlan_objmgr_vdev_obj.h

@@ -602,7 +602,7 @@ static inline struct wlan_objmgr_vdev *wlan_vdev_get_next_vdev_of_pdev(
 	qdf_list_node_t *next_node = NULL;
 
 	/* This API is invoked with lock acquired, do not add log prints */
-	if (node == NULL)
+	if (!node)
 		return NULL;
 
 	if (qdf_list_peek_next(vdev_list, node, &next_node) !=
@@ -666,7 +666,7 @@ static inline struct wlan_objmgr_psoc *wlan_vdev_get_psoc(
 	struct wlan_objmgr_psoc *psoc = NULL;
 
 	pdev = wlan_vdev_get_pdev(vdev);
-	if (pdev == NULL)
+	if (!pdev)
 		return NULL;
 
 	psoc = wlan_pdev_get_psoc(pdev);
@@ -804,7 +804,7 @@ static inline uint8_t *wlan_vdev_get_hw_macaddr(struct wlan_objmgr_vdev *vdev)
 	struct wlan_objmgr_pdev *pdev = wlan_vdev_get_pdev(vdev);
 
 	/* This API is invoked with lock acquired, do not add log prints */
-	if (pdev != NULL)
+	if (pdev)
 		return wlan_pdev_get_hw_macaddr(pdev);
 	else
 		return NULL;

+ 16 - 16
umac/cmn_services/obj_mgr/src/wlan_objmgr_global_obj.c

@@ -36,7 +36,7 @@ QDF_STATUS wlan_objmgr_global_obj_init(void)
 	struct wlan_objmgr_global *umac_global_obj;
 
 	/* If it is already created, ignore */
-	if (g_umac_glb_obj != NULL) {
+	if (g_umac_glb_obj) {
 		obj_mgr_err("Global object is already created");
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -60,7 +60,7 @@ qdf_export_symbol(wlan_objmgr_global_obj_init);
 QDF_STATUS wlan_objmgr_global_obj_deinit(void)
 {
 	/* If it is already destroyed */
-	if (g_umac_glb_obj == NULL) {
+	if (!g_umac_glb_obj) {
 		obj_mgr_err("Global object is not allocated");
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -96,7 +96,7 @@ QDF_STATUS wlan_objmgr_register_psoc_create_handler(
 
 	qdf_spin_lock_bh(&g_umac_glb_obj->global_lock);
 	/* If there is a valid entry, return failure */
-	if (g_umac_glb_obj->psoc_create_handler[id] != NULL) {
+	if (g_umac_glb_obj->psoc_create_handler[id]) {
 		qdf_spin_unlock_bh(&g_umac_glb_obj->global_lock);
 		obj_mgr_err("Callback for comp %d is already registered", id);
 		QDF_ASSERT(0);
@@ -150,7 +150,7 @@ QDF_STATUS wlan_objmgr_register_psoc_destroy_handler(
 	}
 	qdf_spin_lock_bh(&g_umac_glb_obj->global_lock);
 	/* If there is a valid entry, return failure */
-	if (g_umac_glb_obj->psoc_destroy_handler[id] != NULL) {
+	if (g_umac_glb_obj->psoc_destroy_handler[id]) {
 		qdf_spin_unlock_bh(&g_umac_glb_obj->global_lock);
 		obj_mgr_err("Callback for comp %d is already registered", id);
 		QDF_ASSERT(0);
@@ -204,7 +204,7 @@ QDF_STATUS wlan_objmgr_register_psoc_status_handler(
 	}
 	qdf_spin_lock_bh(&g_umac_glb_obj->global_lock);
 	/* If there is a valid entry, return failure */
-	if (g_umac_glb_obj->psoc_status_handler[id] != NULL) {
+	if (g_umac_glb_obj->psoc_status_handler[id]) {
 		qdf_spin_unlock_bh(&g_umac_glb_obj->global_lock);
 		obj_mgr_err("Callback for comp %d is already registered", id);
 		return QDF_STATUS_E_FAILURE;
@@ -255,7 +255,7 @@ QDF_STATUS wlan_objmgr_register_pdev_create_handler(
 	}
 	qdf_spin_lock_bh(&g_umac_glb_obj->global_lock);
 	/* If there is a valid entry, return failure */
-	if (g_umac_glb_obj->pdev_create_handler[id] != NULL) {
+	if (g_umac_glb_obj->pdev_create_handler[id]) {
 		qdf_spin_unlock_bh(&g_umac_glb_obj->global_lock);
 		obj_mgr_err("Callback for comp %d is already registered", id);
 		QDF_ASSERT(0);
@@ -309,7 +309,7 @@ QDF_STATUS wlan_objmgr_register_pdev_destroy_handler(
 	}
 	qdf_spin_lock_bh(&g_umac_glb_obj->global_lock);
 	/* If there is a valid entry, return failure */
-	if (g_umac_glb_obj->pdev_destroy_handler[id] != NULL) {
+	if (g_umac_glb_obj->pdev_destroy_handler[id]) {
 		qdf_spin_unlock_bh(&g_umac_glb_obj->global_lock);
 		obj_mgr_err("Callback for comp %d is already registered", id);
 		QDF_ASSERT(0);
@@ -363,7 +363,7 @@ QDF_STATUS wlan_objmgr_register_pdev_status_handler(
 	}
 	qdf_spin_lock_bh(&g_umac_glb_obj->global_lock);
 	/* If there is a valid entry, return failure */
-	if (g_umac_glb_obj->pdev_status_handler[id] != NULL) {
+	if (g_umac_glb_obj->pdev_status_handler[id]) {
 		qdf_spin_unlock_bh(&g_umac_glb_obj->global_lock);
 		obj_mgr_err("Callback for comp %d is already registered", id);
 		return QDF_STATUS_E_FAILURE;
@@ -414,7 +414,7 @@ QDF_STATUS wlan_objmgr_register_vdev_create_handler(
 	}
 	qdf_spin_lock_bh(&g_umac_glb_obj->global_lock);
 	/* If there is a valid entry, return failure */
-	if (g_umac_glb_obj->vdev_create_handler[id] != NULL) {
+	if (g_umac_glb_obj->vdev_create_handler[id]) {
 		qdf_spin_unlock_bh(&g_umac_glb_obj->global_lock);
 		obj_mgr_err("Callback for comp %d is already registered", id);
 		QDF_ASSERT(0);
@@ -466,7 +466,7 @@ QDF_STATUS wlan_objmgr_register_vdev_destroy_handler(
 	}
 	qdf_spin_lock_bh(&g_umac_glb_obj->global_lock);
 	/* If there is a valid entry, return failure */
-	if (g_umac_glb_obj->vdev_destroy_handler[id] != NULL) {
+	if (g_umac_glb_obj->vdev_destroy_handler[id]) {
 		qdf_spin_unlock_bh(&g_umac_glb_obj->global_lock);
 		obj_mgr_err("Callback for comp %d is already registered", id);
 		QDF_ASSERT(0);
@@ -518,7 +518,7 @@ QDF_STATUS wlan_objmgr_register_vdev_status_handler(
 	}
 	qdf_spin_lock_bh(&g_umac_glb_obj->global_lock);
 	/* If there is a valid entry, return failure */
-	if (g_umac_glb_obj->vdev_status_handler[id] != NULL) {
+	if (g_umac_glb_obj->vdev_status_handler[id]) {
 		qdf_spin_unlock_bh(&g_umac_glb_obj->global_lock);
 		obj_mgr_err("Callback for comp %d is already registered", id);
 		return QDF_STATUS_E_FAILURE;
@@ -569,7 +569,7 @@ QDF_STATUS wlan_objmgr_register_peer_create_handler(
 	}
 	qdf_spin_lock_bh(&g_umac_glb_obj->global_lock);
 	/* If there is a valid entry, return failure */
-	if (g_umac_glb_obj->peer_create_handler[id] != NULL) {
+	if (g_umac_glb_obj->peer_create_handler[id]) {
 		qdf_spin_unlock_bh(&g_umac_glb_obj->global_lock);
 		obj_mgr_err("Callback for comp %d is already registered", id);
 		QDF_ASSERT(0);
@@ -622,7 +622,7 @@ QDF_STATUS wlan_objmgr_register_peer_destroy_handler(
 	}
 	qdf_spin_lock_bh(&g_umac_glb_obj->global_lock);
 	/* If there is a valid entry, return failure */
-	if (g_umac_glb_obj->peer_destroy_handler[id] != NULL) {
+	if (g_umac_glb_obj->peer_destroy_handler[id]) {
 		qdf_spin_unlock_bh(&g_umac_glb_obj->global_lock);
 		obj_mgr_err("Callback for comp %d is already registered", id);
 		QDF_ASSERT(0);
@@ -674,7 +674,7 @@ QDF_STATUS wlan_objmgr_register_peer_status_handler(
 	}
 	qdf_spin_lock_bh(&g_umac_glb_obj->global_lock);
 	/* If there is a valid entry, return failure */
-	if (g_umac_glb_obj->peer_status_handler[id] != NULL) {
+	if (g_umac_glb_obj->peer_status_handler[id]) {
 		qdf_spin_unlock_bh(&g_umac_glb_obj->global_lock);
 		obj_mgr_err("Callback for comp %d is already registered", id);
 		return QDF_STATUS_E_FAILURE;
@@ -720,7 +720,7 @@ QDF_STATUS wlan_objmgr_psoc_object_attach(struct wlan_objmgr_psoc *psoc)
 	qdf_spin_lock_bh(&g_umac_glb_obj->global_lock);
 	/* Find free slot in PSOC table, store the PSOC */
 	while (index < WLAN_OBJMGR_MAX_DEVICES) {
-		if (g_umac_glb_obj->psoc[index] == NULL) {
+		if (!g_umac_glb_obj->psoc[index]) {
 			/* Found free slot, store psoc */
 			g_umac_glb_obj->psoc[index] = psoc;
 			psoc->soc_objmgr.psoc_id = index;
@@ -757,7 +757,7 @@ QDF_STATUS wlan_objmgr_global_obj_can_destroyed(void)
 	qdf_spin_lock_bh(&g_umac_glb_obj->global_lock);
 	/* Check whether all PSOCs are freed */
 	while (index < WLAN_OBJMGR_MAX_DEVICES) {
-		if (g_umac_glb_obj->psoc[index] != NULL) {
+		if (g_umac_glb_obj->psoc[index]) {
 			status = QDF_STATUS_E_FAILURE;
 			break;
 		}

+ 26 - 26
umac/cmn_services/obj_mgr/src/wlan_objmgr_pdev_obj.c

@@ -49,7 +49,7 @@ static QDF_STATUS wlan_objmgr_pdev_object_status(
 		/* If component operates in Async, status is Partially created,
 			break */
 		} else if (pdev->obj_status[id] == QDF_STATUS_COMP_ASYNC) {
-			if (pdev->pdev_comp_priv_obj[id] == NULL) {
+			if (!pdev->pdev_comp_priv_obj[id]) {
 				status = QDF_STATUS_COMP_ASYNC;
 				break;
 			}
@@ -70,7 +70,7 @@ static QDF_STATUS wlan_objmgr_pdev_obj_free(struct wlan_objmgr_pdev *pdev)
 
 	uint8_t pdev_id;
 
-	if (pdev == NULL) {
+	if (!pdev) {
 		obj_mgr_err("pdev obj is NULL");
 		QDF_ASSERT(0);
 		return QDF_STATUS_E_FAILURE;
@@ -101,7 +101,7 @@ struct wlan_objmgr_pdev *wlan_objmgr_pdev_obj_create(
 	void *arg;
 	QDF_STATUS obj_status;
 
-	if (psoc == NULL) {
+	if (!psoc) {
 		obj_mgr_err("psoc is NULL");
 		return NULL;
 	}
@@ -140,7 +140,7 @@ struct wlan_objmgr_pdev *wlan_objmgr_pdev_obj_create(
 	for (id = 0; id < WLAN_UMAC_MAX_COMPONENTS; id++) {
 		handler = g_umac_glb_obj->pdev_create_handler[id];
 		arg = g_umac_glb_obj->pdev_create_handler_arg[id];
-		if (handler != NULL)
+		if (handler)
 			pdev->obj_status[id] = handler(pdev, arg);
 		else
 			pdev->obj_status[id] = QDF_STATUS_COMP_DISABLED;
@@ -155,7 +155,7 @@ struct wlan_objmgr_pdev *wlan_objmgr_pdev_obj_create(
 		for (id = 0; id < WLAN_UMAC_MAX_COMPONENTS; id++) {
 			s_handler = g_umac_glb_obj->pdev_status_handler[id];
 			arg = g_umac_glb_obj->pdev_status_handler_arg[id];
-			if (s_handler != NULL) {
+			if (s_handler) {
 				s_handler(pdev, arg,
 					  QDF_STATUS_SUCCESS);
 			}
@@ -186,7 +186,7 @@ static QDF_STATUS wlan_objmgr_pdev_obj_destroy(struct wlan_objmgr_pdev *pdev)
 	void *arg;
 	uint8_t pdev_id;
 
-	if (pdev == NULL) {
+	if (!pdev) {
 		obj_mgr_err("pdev is NULL");
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -238,7 +238,7 @@ QDF_STATUS wlan_objmgr_pdev_obj_delete(struct wlan_objmgr_pdev *pdev)
 {
 	uint8_t print_idx;
 
-	if (pdev == NULL) {
+	if (!pdev) {
 		obj_mgr_err("pdev is NULL");
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -284,7 +284,7 @@ QDF_STATUS wlan_objmgr_pdev_component_obj_attach(
 	}
 	wlan_pdev_obj_lock(pdev);
 	/* If there is a valid entry, return failure */
-	if (pdev->pdev_comp_priv_obj[id] != NULL) {
+	if (pdev->pdev_comp_priv_obj[id]) {
 		obj_mgr_err("component-%d already have valid pointer", id);
 		wlan_pdev_obj_unlock(pdev);
 		return QDF_STATUS_E_FAILURE;
@@ -318,7 +318,7 @@ QDF_STATUS wlan_objmgr_pdev_component_obj_attach(
 		for (i = 0; i < WLAN_UMAC_MAX_COMPONENTS; i++) {
 			s_hlr = g_umac_glb_obj->pdev_status_handler[i];
 			a = g_umac_glb_obj->pdev_status_handler_arg[i];
-			if (s_hlr != NULL)
+			if (s_hlr)
 				s_hlr(pdev, a, obj_status);
 		}
 	}
@@ -411,10 +411,10 @@ static void wlan_objmgr_pdev_vdev_iterate_peers(struct wlan_objmgr_pdev *pdev,
 		needed */
 	/* Get peer list of the vdev */
 	peer_list = &vdev->vdev_objmgr.wlan_peer_list;
-	if (peer_list != NULL) {
+	if (peer_list) {
 		peer = wlan_vdev_peer_list_peek_active_head(vdev, peer_list,
 								dbg_id);
-		while (peer != NULL) {
+		while (peer) {
 			/* Invoke the handler */
 			handler(pdev, (void *)peer, arg);
 			/* Get next peer pointer, increments the ref count */
@@ -447,7 +447,7 @@ QDF_STATUS wlan_objmgr_pdev_iterate_obj_list(
 			VDEV object */
 		vdev = wlan_pdev_vdev_list_peek_active_head(pdev, vdev_list,
 								dbg_id);
-		while (vdev != NULL) {
+		while (vdev) {
 			handler(pdev, (void *)vdev, arg);
 			 /* Get next vdev, it increments ref of next vdev */
 			vdev_next = wlan_vdev_get_next_active_vdev_of_pdev(
@@ -459,7 +459,7 @@ QDF_STATUS wlan_objmgr_pdev_iterate_obj_list(
 	case WLAN_PEER_OP:
 		vdev = wlan_pdev_vdev_list_peek_active_head(pdev, vdev_list,
 								dbg_id);
-		while (vdev != NULL) {
+		while (vdev) {
 			wlan_objmgr_pdev_vdev_iterate_peers(pdev, vdev,	handler,
 						arg, lock_free_op, dbg_id);
 			 /* Get next vdev, it increments ref of next vdev */
@@ -492,7 +492,7 @@ QDF_STATUS wlan_objmgr_trigger_pdev_comp_priv_object_creation(
 	wlan_pdev_obj_lock(pdev);
 	/* If component object is already created, delete old
 		component object, then invoke creation */
-	if (pdev->pdev_comp_priv_obj[id] != NULL) {
+	if (pdev->pdev_comp_priv_obj[id]) {
 		wlan_pdev_obj_unlock(pdev);
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -501,7 +501,7 @@ QDF_STATUS wlan_objmgr_trigger_pdev_comp_priv_object_creation(
 	/* Invoke registered create handlers */
 	handler = g_umac_glb_obj->pdev_create_handler[id];
 	arg = g_umac_glb_obj->pdev_create_handler_arg[id];
-	if (handler != NULL)
+	if (handler)
 		pdev->obj_status[id] = handler(pdev, arg);
 	else
 		return QDF_STATUS_E_FAILURE;
@@ -532,7 +532,7 @@ QDF_STATUS wlan_objmgr_trigger_pdev_comp_priv_object_deletion(
 
 	wlan_pdev_obj_lock(pdev);
 	/* Component object was never created, invalid operation */
-	if (pdev->pdev_comp_priv_obj[id] == NULL) {
+	if (!pdev->pdev_comp_priv_obj[id]) {
 		wlan_pdev_obj_unlock(pdev);
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -541,7 +541,7 @@ QDF_STATUS wlan_objmgr_trigger_pdev_comp_priv_object_deletion(
 	/* Invoke registered create handlers */
 	handler = g_umac_glb_obj->pdev_destroy_handler[id];
 	arg = g_umac_glb_obj->pdev_destroy_handler_arg[id];
-	if (handler != NULL)
+	if (handler)
 		pdev->obj_status[id] = handler(pdev, arg);
 	else
 		return QDF_STATUS_E_FAILURE;
@@ -568,7 +568,7 @@ static QDF_STATUS wlan_obj_pdev_vdevlist_remove_vdev(
 {
 	qdf_list_node_t *vdev_node = NULL;
 
-	if (vdev == NULL)
+	if (!vdev)
 		return QDF_STATUS_E_FAILURE;
 	/* get vdev list node element */
 	vdev_node = &vdev->vdev_node;
@@ -639,7 +639,7 @@ struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_id_from_pdev(
 	vdev = wlan_pdev_vdev_list_peek_head(vdev_list);
 	/* Iterate through pdev's vdev list, till vdev id matches with
 	entry of vdev list */
-	while (vdev != NULL) {
+	while (vdev) {
 		if (wlan_vdev_get_id(vdev) == vdev_id) {
 			if (wlan_objmgr_vdev_try_get_ref(vdev, dbg_id) !=
 							QDF_STATUS_SUCCESS)
@@ -676,7 +676,7 @@ struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_id_from_pdev_no_state(
 	 * Iterate through pdev's vdev list, till vdev id matches with
 	 * entry of vdev list
 	 */
-	while (vdev != NULL) {
+	while (vdev) {
 		if (wlan_vdev_get_id(vdev) == vdev_id) {
 			wlan_objmgr_vdev_get_ref(vdev, dbg_id);
 			wlan_pdev_obj_unlock(pdev);
@@ -709,7 +709,7 @@ struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_macaddr_from_pdev(
 	vdev = wlan_pdev_vdev_list_peek_head(vdev_list);
 	/* Iterate through pdev's vdev list, till vdev macaddr matches with
 	entry of vdev list */
-	while (vdev != NULL) {
+	while (vdev) {
 		if (WLAN_ADDR_EQ(wlan_vdev_mlme_get_macaddr(vdev), macaddr)
 					== QDF_STATUS_SUCCESS) {
 			if (wlan_objmgr_vdev_try_get_ref(vdev, dbg_id) !=
@@ -744,7 +744,7 @@ struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_macaddr_from_pdev_no_state(
 	vdev = wlan_pdev_vdev_list_peek_head(vdev_list);
 	/* Iterate through pdev's vdev list, till vdev macaddr matches with
 	entry of vdev list */
-	while (vdev != NULL) {
+	while (vdev) {
 		if (WLAN_ADDR_EQ(wlan_vdev_mlme_get_macaddr(vdev), macaddr)
 					== QDF_STATUS_SUCCESS) {
 			wlan_objmgr_vdev_get_ref(vdev, dbg_id);
@@ -773,7 +773,7 @@ void *wlan_objmgr_pdev_get_comp_private_obj(
 		return NULL;
 	}
 
-	if (pdev == NULL) {
+	if (!pdev) {
 		QDF_BUG(0);
 		return NULL;
 	}
@@ -787,7 +787,7 @@ qdf_export_symbol(wlan_objmgr_pdev_get_comp_private_obj);
 void wlan_objmgr_pdev_get_ref(struct wlan_objmgr_pdev *pdev,
 					wlan_objmgr_ref_dbgid id)
 {
-	if (pdev == NULL) {
+	if (!pdev) {
 		obj_mgr_err("pdev obj is NULL");
 		QDF_ASSERT(0);
 		return;
@@ -804,7 +804,7 @@ QDF_STATUS wlan_objmgr_pdev_try_get_ref(struct wlan_objmgr_pdev *pdev,
 {
 	uint8_t pdev_id;
 
-	if (pdev == NULL) {
+	if (!pdev) {
 		obj_mgr_err("pdev obj is NULL");
 		QDF_ASSERT(0);
 		return QDF_STATUS_E_FAILURE;
@@ -834,7 +834,7 @@ void wlan_objmgr_pdev_release_ref(struct wlan_objmgr_pdev *pdev,
 {
 	uint8_t pdev_id;
 
-	if (pdev == NULL) {
+	if (!pdev) {
 		obj_mgr_err("pdev obj is NULL");
 		QDF_ASSERT(0);
 		return;

+ 20 - 20
umac/cmn_services/obj_mgr/src/wlan_objmgr_peer_obj.c

@@ -50,7 +50,7 @@ static QDF_STATUS wlan_objmgr_peer_object_status(
 		/* If component operates in Async, status is Partially created,
 			break */
 		else if (peer->obj_status[id] == QDF_STATUS_COMP_ASYNC) {
-			if (peer->peer_comp_priv_obj[id] == NULL) {
+			if (!peer->peer_comp_priv_obj[id]) {
 				status = QDF_STATUS_COMP_ASYNC;
 				break;
 			}
@@ -74,7 +74,7 @@ static QDF_STATUS wlan_objmgr_peer_obj_free(struct wlan_objmgr_peer *peer)
 	uint8_t *macaddr;
 	uint8_t vdev_id;
 
-	if (peer == NULL) {
+	if (!peer) {
 		obj_mgr_err("PEER is NULL");
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -82,7 +82,7 @@ static QDF_STATUS wlan_objmgr_peer_obj_free(struct wlan_objmgr_peer *peer)
 	macaddr = wlan_peer_get_macaddr(peer);
 
 	vdev = wlan_peer_get_vdev(peer);
-	if (vdev == NULL) {
+	if (!vdev) {
 		obj_mgr_err(
 			"VDEV is NULL for peer(%02x:%02x:%02x:%02x:%02x:%02x)",
 				macaddr[0], macaddr[1], macaddr[2],
@@ -94,7 +94,7 @@ static QDF_STATUS wlan_objmgr_peer_obj_free(struct wlan_objmgr_peer *peer)
 
 	/* get PSOC from VDEV, if it is NULL, return */
 	psoc = wlan_vdev_get_psoc(vdev);
-	if (psoc == NULL) {
+	if (!psoc) {
 		obj_mgr_err(
 			"PSOC is NULL for peer(%02x:%02x:%02x:%02x:%02x:%02x)",
 				macaddr[0], macaddr[1], macaddr[2],
@@ -159,7 +159,7 @@ struct wlan_objmgr_peer *wlan_objmgr_peer_obj_create(
 	QDF_STATUS obj_status;
 	uint8_t id;
 
-	if (vdev == NULL) {
+	if (!vdev) {
 		obj_mgr_err(
 			"VDEV is NULL for peer (%02x:%02x:%02x:%02x:%02x:%02x)",
 				macaddr[0], macaddr[1], macaddr[2],
@@ -168,7 +168,7 @@ struct wlan_objmgr_peer *wlan_objmgr_peer_obj_create(
 	}
 	/* Get psoc, if psoc is NULL, return */
 	psoc = wlan_vdev_get_psoc(vdev);
-	if (psoc == NULL) {
+	if (!psoc) {
 		obj_mgr_err(
 			"PSOC is NULL for peer (%02x:%02x:%02x:%02x:%02x:%02x)",
 				macaddr[0], macaddr[1], macaddr[2],
@@ -232,7 +232,7 @@ struct wlan_objmgr_peer *wlan_objmgr_peer_obj_create(
 	for (id = 0; id < WLAN_UMAC_MAX_COMPONENTS; id++) {
 		handler = g_umac_glb_obj->peer_create_handler[id];
 		arg = g_umac_glb_obj->peer_create_handler_arg[id];
-		if (handler != NULL)
+		if (handler)
 			peer->obj_status[id] = handler(peer, arg);
 		else
 			peer->obj_status[id] = QDF_STATUS_COMP_DISABLED;
@@ -245,7 +245,7 @@ struct wlan_objmgr_peer *wlan_objmgr_peer_obj_create(
 		for (id = 0; id < WLAN_UMAC_MAX_COMPONENTS; id++) {
 			stat_handler = g_umac_glb_obj->peer_status_handler[id];
 			arg = g_umac_glb_obj->peer_status_handler_arg[id];
-			if (stat_handler != NULL)
+			if (stat_handler)
 				stat_handler(peer, arg,
 					     QDF_STATUS_SUCCESS);
 		}
@@ -277,7 +277,7 @@ static QDF_STATUS wlan_objmgr_peer_obj_destroy(struct wlan_objmgr_peer *peer)
 	void *arg;
 	uint8_t *macaddr;
 
-	if (peer == NULL) {
+	if (!peer) {
 		obj_mgr_err("PEER is NULL");
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -328,7 +328,7 @@ QDF_STATUS wlan_objmgr_peer_obj_delete(struct wlan_objmgr_peer *peer)
 	uint8_t print_idx;
 	uint8_t *macaddr;
 
-	if (peer == NULL) {
+	if (!peer) {
 		obj_mgr_err("PEER is NULL");
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -376,7 +376,7 @@ QDF_STATUS wlan_objmgr_peer_component_obj_attach(
 	wlan_peer_obj_lock(peer);
 	/* If there is a valid entry, return failure,
 	valid object needs to be freed first */
-	if (peer->peer_comp_priv_obj[id] != NULL) {
+	if (peer->peer_comp_priv_obj[id]) {
 		wlan_peer_obj_unlock(peer);
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -407,7 +407,7 @@ QDF_STATUS wlan_objmgr_peer_component_obj_attach(
 		for (i = 0; i < WLAN_UMAC_MAX_COMPONENTS; i++) {
 			s_hler = g_umac_glb_obj->peer_status_handler[i];
 			arg = g_umac_glb_obj->peer_status_handler_arg[i];
-			if (s_hler != NULL)
+			if (s_hler)
 				s_hler(peer, arg, obj_status);
 		}
 	}
@@ -494,7 +494,7 @@ QDF_STATUS wlan_objmgr_trigger_peer_comp_priv_object_creation(
 	wlan_peer_obj_lock(peer);
 	/* If component object is already created, delete old
 		component object, then invoke creation */
-	if (peer->peer_comp_priv_obj[id] != NULL) {
+	if (peer->peer_comp_priv_obj[id]) {
 		wlan_peer_obj_unlock(peer);
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -503,7 +503,7 @@ QDF_STATUS wlan_objmgr_trigger_peer_comp_priv_object_creation(
 	/* Invoke registered create handlers */
 	handler = g_umac_glb_obj->peer_create_handler[id];
 	arg = g_umac_glb_obj->peer_create_handler_arg[id];
-	if (handler != NULL)
+	if (handler)
 		peer->obj_status[id] = handler(peer, arg);
 	else
 		return QDF_STATUS_E_FAILURE;
@@ -537,7 +537,7 @@ QDF_STATUS wlan_objmgr_trigger_peer_comp_priv_object_deletion(
 
 	wlan_peer_obj_lock(peer);
 	/* Component object was never created, invalid operation */
-	if (peer->peer_comp_priv_obj[id] == NULL) {
+	if (!peer->peer_comp_priv_obj[id]) {
 		wlan_peer_obj_unlock(peer);
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -547,7 +547,7 @@ QDF_STATUS wlan_objmgr_trigger_peer_comp_priv_object_deletion(
 	/* Invoke registered destroy handlers */
 	handler = g_umac_glb_obj->peer_destroy_handler[id];
 	arg = g_umac_glb_obj->peer_destroy_handler_arg[id];
-	if (handler != NULL)
+	if (handler)
 		peer->obj_status[id] = handler(peer, arg);
 	else
 		return QDF_STATUS_E_FAILURE;
@@ -574,7 +574,7 @@ void *wlan_objmgr_peer_get_comp_private_obj(
 		return NULL;
 	}
 
-	if (peer == NULL) {
+	if (!peer) {
 		QDF_BUG(0);
 		return NULL;
 	}
@@ -600,7 +600,7 @@ wlan_objmgr_peer_get_debug_id_ref(struct wlan_objmgr_peer *peer,
 void wlan_objmgr_peer_get_ref(struct wlan_objmgr_peer *peer,
 			      wlan_objmgr_ref_dbgid id)
 {
-	if (peer == NULL) {
+	if (!peer) {
 		obj_mgr_err("peer obj is NULL for %d", id);
 		QDF_ASSERT(0);
 		return;
@@ -619,7 +619,7 @@ QDF_STATUS wlan_objmgr_peer_try_get_ref(struct wlan_objmgr_peer *peer,
 
 	uint8_t *macaddr;
 
-	if (peer == NULL) {
+	if (!peer) {
 		obj_mgr_err("peer obj is NULL for %d", id);
 		QDF_ASSERT(0);
 		return QDF_STATUS_E_FAILURE;
@@ -754,7 +754,7 @@ struct wlan_objmgr_peer *wlan_peer_get_next_active_peer_of_vdev(
 	qdf_list_node_t *vdev_node = NULL;
 	qdf_list_node_t *prev_vdev_node = NULL;
 
-	if (peer == NULL)
+	if (!peer)
 		return NULL;
 
 	wlan_vdev_obj_lock(vdev);

+ 42 - 42
umac/cmn_services/obj_mgr/src/wlan_objmgr_psoc_obj.c

@@ -52,7 +52,7 @@ static QDF_STATUS wlan_objmgr_psoc_object_status(
 		 * break
 		 */
 		else if (psoc->obj_status[id] == QDF_STATUS_COMP_ASYNC) {
-			if (psoc->soc_comp_priv_obj[id] == NULL) {
+			if (!psoc->soc_comp_priv_obj[id]) {
 				status = QDF_STATUS_COMP_ASYNC;
 				break;
 			}
@@ -144,7 +144,7 @@ struct wlan_objmgr_psoc *wlan_objmgr_psoc_obj_create(uint32_t phy_version,
 	for (id = 0; id < WLAN_UMAC_MAX_COMPONENTS; id++) {
 		handler = g_umac_glb_obj->psoc_create_handler[id];
 		arg = g_umac_glb_obj->psoc_create_handler_arg[id];
-		if (handler != NULL)
+		if (handler)
 			psoc->obj_status[id] = handler(psoc, arg);
 		else
 			psoc->obj_status[id] = QDF_STATUS_COMP_DISABLED;
@@ -158,7 +158,7 @@ struct wlan_objmgr_psoc *wlan_objmgr_psoc_obj_create(uint32_t phy_version,
 		for (id = 0; id < WLAN_UMAC_MAX_COMPONENTS; id++) {
 			stat_handler = g_umac_glb_obj->psoc_status_handler[id];
 			arg = g_umac_glb_obj->psoc_status_handler_arg[id];
-			if (stat_handler != NULL)
+			if (stat_handler)
 				stat_handler(psoc, arg,
 					     QDF_STATUS_SUCCESS);
 		}
@@ -196,7 +196,7 @@ static QDF_STATUS wlan_objmgr_psoc_obj_destroy(struct wlan_objmgr_psoc *psoc)
 	QDF_STATUS obj_status;
 	void *arg;
 
-	if (psoc == NULL) {
+	if (!psoc) {
 		obj_mgr_err("psoc is NULL");
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -248,7 +248,7 @@ QDF_STATUS wlan_objmgr_psoc_obj_delete(struct wlan_objmgr_psoc *psoc)
 {
 	uint8_t print_idx;
 
-	if (psoc == NULL) {
+	if (!psoc) {
 		obj_mgr_err("psoc is NULL");
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -289,7 +289,7 @@ QDF_STATUS wlan_objmgr_psoc_component_obj_attach(
 
 	wlan_psoc_obj_lock(psoc);
 	/* If there is a valid entry, return failure */
-	if (psoc->soc_comp_priv_obj[id] != NULL) {
+	if (psoc->soc_comp_priv_obj[id]) {
 		wlan_psoc_obj_unlock(psoc);
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -323,7 +323,7 @@ QDF_STATUS wlan_objmgr_psoc_component_obj_attach(
 		for (i = 0; i < WLAN_UMAC_MAX_COMPONENTS; i++) {
 			stat_handler = g_umac_glb_obj->psoc_status_handler[i];
 			arg = g_umac_glb_obj->psoc_status_handler_arg[i];
-			if (stat_handler != NULL)
+			if (stat_handler)
 				stat_handler(psoc, arg, obj_status);
 		}
 	}
@@ -426,7 +426,7 @@ QDF_STATUS wlan_objmgr_iterate_obj_list(
 		/* Iterate through PDEV list, invoke handler for each pdev */
 		for (obj_id = 0; obj_id < WLAN_UMAC_MAX_PDEVS; obj_id++) {
 			pdev = wlan_objmgr_get_pdev_by_id(psoc, obj_id, dbg_id);
-			if (pdev != NULL) {
+			if (pdev) {
 				handler(psoc, (void *)pdev, arg);
 				wlan_objmgr_pdev_release_ref(pdev, dbg_id);
 			}
@@ -438,7 +438,7 @@ QDF_STATUS wlan_objmgr_iterate_obj_list(
 		for (obj_id = 0; obj_id < max_vdev_cnt; obj_id++) {
 			vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc,
 						obj_id, dbg_id);
-			if (vdev != NULL) {
+			if (vdev) {
 				handler(psoc, vdev, arg);
 				wlan_objmgr_vdev_release_ref(vdev, dbg_id);
 			}
@@ -497,7 +497,7 @@ QDF_STATUS wlan_objmgr_iterate_obj_list_all(
 		for (obj_id = 0; obj_id < WLAN_UMAC_MAX_PDEVS; obj_id++) {
 			pdev = wlan_objmgr_get_pdev_by_id_no_state(psoc,
 							obj_id, dbg_id);
-			if (pdev != NULL) {
+			if (pdev) {
 				handler(psoc, (void *)pdev, arg);
 				wlan_objmgr_pdev_release_ref(pdev, dbg_id);
 			}
@@ -509,7 +509,7 @@ QDF_STATUS wlan_objmgr_iterate_obj_list_all(
 		for (obj_id = 0; obj_id < max_vdev_cnt; obj_id++) {
 			vdev = wlan_objmgr_get_vdev_by_id_from_psoc_no_state(
 					psoc, obj_id, dbg_id);
-			if (vdev != NULL) {
+			if (vdev) {
 				handler(psoc, vdev, arg);
 				wlan_objmgr_vdev_release_ref(vdev, dbg_id);
 			}
@@ -583,7 +583,7 @@ static QDF_STATUS wlan_objmgr_iterate_obj_list_all_noref(
 		/* Iterate through PDEV list, invoke handler for each pdev */
 		for (obj_id = 0; obj_id < WLAN_UMAC_MAX_PDEVS; obj_id++) {
 			pdev = objmgr->wlan_pdev_list[obj_id];
-			if (pdev != NULL)
+			if (pdev)
 				handler(psoc, (void *)pdev, arg);
 		}
 		break;
@@ -592,7 +592,7 @@ static QDF_STATUS wlan_objmgr_iterate_obj_list_all_noref(
 		max_vdev_cnt = wlan_psoc_get_max_vdev_count(psoc);
 		for (obj_id = 0; obj_id < max_vdev_cnt; obj_id++) {
 			vdev = objmgr->wlan_vdev_list[obj_id];
-			if (vdev != NULL)
+			if (vdev)
 				handler(psoc, vdev, arg);
 		}
 		break;
@@ -682,7 +682,7 @@ QDF_STATUS wlan_objmgr_trigger_psoc_comp_priv_object_creation(
 	/* If component object is already created, delete old
 	 * component object, then invoke creation
 	 */
-	if (psoc->soc_comp_priv_obj[id] != NULL) {
+	if (psoc->soc_comp_priv_obj[id]) {
 		wlan_psoc_obj_unlock(psoc);
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -690,7 +690,7 @@ QDF_STATUS wlan_objmgr_trigger_psoc_comp_priv_object_creation(
 	/* Invoke registered create handlers */
 	handler = g_umac_glb_obj->psoc_create_handler[id];
 	arg = g_umac_glb_obj->psoc_create_handler_arg[id];
-	if (handler != NULL)
+	if (handler)
 		psoc->obj_status[id] = handler(psoc, arg);
 	else
 		return QDF_STATUS_E_FAILURE;
@@ -723,7 +723,7 @@ QDF_STATUS wlan_objmgr_trigger_psoc_comp_priv_object_deletion(
 
 	wlan_psoc_obj_lock(psoc);
 	/* Component object was never created, invalid operation */
-	if (psoc->soc_comp_priv_obj[id] == NULL) {
+	if (!psoc->soc_comp_priv_obj[id]) {
 		wlan_psoc_obj_unlock(psoc);
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -731,7 +731,7 @@ QDF_STATUS wlan_objmgr_trigger_psoc_comp_priv_object_deletion(
 	/* Invoke registered create handlers */
 	handler = g_umac_glb_obj->psoc_destroy_handler[id];
 	arg = g_umac_glb_obj->psoc_destroy_handler_arg[id];
-	if (handler != NULL)
+	if (handler)
 		psoc->obj_status[id] = handler(psoc, arg);
 	else
 		return QDF_STATUS_E_FAILURE;
@@ -827,7 +827,7 @@ struct wlan_objmgr_pdev *wlan_objmgr_get_pdev_by_id(
 	/* get pdev from pdev list */
 	pdev = objmgr->wlan_pdev_list[id];
 	/* Do not return object, if it is not CREATED state */
-	if (pdev != NULL) {
+	if (pdev) {
 		if (wlan_objmgr_pdev_try_get_ref(pdev, dbg_id) !=
 							QDF_STATUS_SUCCESS)
 			pdev = NULL;
@@ -855,7 +855,7 @@ struct wlan_objmgr_pdev *wlan_objmgr_get_pdev_by_id_no_state(
 	/* get pdev from pdev list */
 	pdev = objmgr->wlan_pdev_list[id];
 	/* Do not return object, if it is not CREATED state */
-	if (pdev != NULL)
+	if (pdev)
 		wlan_objmgr_pdev_get_ref(pdev, dbg_id);
 
 	wlan_psoc_obj_unlock(psoc);
@@ -951,7 +951,7 @@ struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_opmode_from_psoc(
 	uint16_t max_vdev_cnt;
 
 	/* if PSOC is NULL, return */
-	if (psoc == NULL)
+	if (!psoc)
 		return NULL;
 
 	wlan_psoc_obj_lock(psoc);
@@ -961,7 +961,7 @@ struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_opmode_from_psoc(
 	while (vdev_cnt < max_vdev_cnt) {
 		vdev = psoc->soc_objmgr.wlan_vdev_list[vdev_cnt];
 		vdev_cnt++;
-		if (vdev == NULL)
+		if (!vdev)
 			continue;
 		wlan_vdev_obj_lock(vdev);
 		if (vdev->vdev_mlme.vdev_opmode == opmode) {
@@ -987,7 +987,7 @@ struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_id_from_psoc(
 	struct wlan_objmgr_vdev *vdev;
 
 	/* if PSOC is NULL, return */
-	if (psoc == NULL)
+	if (!psoc)
 		return NULL;
 	/* vdev id is invalid */
 	if (vdev_id >= wlan_psoc_get_max_vdev_count(psoc))
@@ -996,7 +996,7 @@ struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_id_from_psoc(
 	wlan_psoc_obj_lock(psoc);
 	/* retrieve vdev pointer from vdev list */
 	vdev = psoc->soc_objmgr.wlan_vdev_list[vdev_id];
-	if (vdev != NULL) {
+	if (vdev) {
 		if (wlan_objmgr_vdev_try_get_ref(vdev, dbg_id) !=
 							QDF_STATUS_SUCCESS)
 			vdev = NULL;
@@ -1014,7 +1014,7 @@ struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_id_from_psoc_no_state(
 	struct wlan_objmgr_vdev *vdev;
 
 	/* if PSOC is NULL, return */
-	if (psoc == NULL)
+	if (!psoc)
 		return NULL;
 	/* vdev id is invalid */
 	if (vdev_id >= wlan_psoc_get_max_vdev_count(psoc))
@@ -1023,7 +1023,7 @@ struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_id_from_psoc_no_state(
 	wlan_psoc_obj_lock(psoc);
 	/* retrieve vdev pointer from vdev list */
 	vdev = psoc->soc_objmgr.wlan_vdev_list[vdev_id];
-	if (vdev != NULL)
+	if (vdev)
 		wlan_objmgr_vdev_get_ref(vdev, dbg_id);
 
 	wlan_psoc_obj_unlock(psoc);
@@ -1040,7 +1040,7 @@ struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_macaddr_from_psoc(
 	struct wlan_objmgr_pdev *pdev;
 
 	/* if PSOC is NULL, return */
-	if (psoc == NULL)
+	if (!psoc)
 		return NULL;
 
 	if (!macaddr)
@@ -1066,7 +1066,7 @@ struct wlan_objmgr_vdev *wlan_objmgr_get_vdev_by_macaddr_from_psoc_no_state(
 	struct wlan_objmgr_pdev *pdev;
 
 	/* if PSOC is NULL, return */
-	if (psoc == NULL)
+	if (!psoc)
 		return NULL;
 
 	if (!macaddr)
@@ -1096,7 +1096,7 @@ static QDF_STATUS wlan_obj_psoc_peerlist_remove_peer(
 {
 	qdf_list_node_t *psoc_node = NULL;
 
-	if (peer == NULL)
+	if (!peer)
 		return QDF_STATUS_E_FAILURE;
 	/* get vdev list node element */
 	psoc_node = &peer->psoc_peer;
@@ -1140,7 +1140,7 @@ static struct wlan_objmgr_peer *
 
 	/* Iterate through hash list to get the peer */
 	peer = wlan_psoc_peer_list_peek_head(obj_list);
-	while (peer != NULL) {
+	while (peer) {
 		/* For peer, macaddr is key */
 		if (WLAN_ADDR_EQ(wlan_peer_get_macaddr(peer), macaddr)
 			== QDF_STATUS_SUCCESS) {
@@ -1181,7 +1181,7 @@ static struct wlan_objmgr_peer *wlan_obj_psoc_peerlist_get_peer(
 
 	/* Iterate through hash list to get the peer */
 	peer = wlan_psoc_peer_list_peek_head(obj_list);
-	while (peer != NULL) {
+	while (peer) {
 		/* For peer, macaddr is key */
 		if (WLAN_ADDR_EQ(wlan_peer_get_macaddr(peer), macaddr)
 				== QDF_STATUS_SUCCESS) {
@@ -1219,7 +1219,7 @@ static struct wlan_objmgr_peer *wlan_obj_psoc_peerlist_get_peer_by_pdev_id(
 
 	/* Iterate through hash list to get the peer */
 	peer = wlan_psoc_peer_list_peek_head(obj_list);
-	while (peer != NULL) {
+	while (peer) {
 		/* For peer, macaddr is key */
 		if ((WLAN_ADDR_EQ(wlan_peer_get_macaddr(peer), macaddr)
 			== QDF_STATUS_SUCCESS) &&
@@ -1247,7 +1247,7 @@ static struct wlan_objmgr_peer *wlan_obj_psoc_peerlist_get_peer_no_state(
 
 	/* Iterate through hash list to get the peer */
 	peer = wlan_psoc_peer_list_peek_head(obj_list);
-	while (peer != NULL) {
+	while (peer) {
 		/* For peer, macaddr and pdev_id is key */
 		if ((WLAN_ADDR_EQ(wlan_peer_get_macaddr(peer), macaddr)
 			== QDF_STATUS_SUCCESS) &&
@@ -1303,7 +1303,7 @@ static qdf_list_t
 
 	/* Iterate through hash list to get the peer */
 	peer = wlan_psoc_peer_list_peek_head(obj_list);
-	while (peer != NULL) {
+	while (peer) {
 		wlan_peer_obj_lock(peer);
 		/* For peer, macaddr and pdev id are keys */
 		if ((WLAN_ADDR_EQ(wlan_peer_get_macaddr(peer), macaddr)
@@ -1315,7 +1315,7 @@ static qdf_list_t
 			 *  (vdev mac == bssid) --  return peer
 			 *  (vdev mac != bssid) --  perform next iteration
 			 */
-			if ((bssid == NULL) ||
+			if ((!bssid) ||
 				(wlan_peer_bssid_match(peer, bssid) ==
 				 QDF_STATUS_SUCCESS)) {
 				/* Return peer in logically deleted state */
@@ -1331,7 +1331,7 @@ static qdf_list_t
 					peer_list =
 					qdf_mem_malloc(
 					sizeof(struct wlan_logically_del_peer));
-					if (peer_list == NULL) {
+					if (!peer_list) {
 						wlan_objmgr_peer_release_ref(peer, dbg_id);
 						/* Lock is already released */
 						WLAN_OBJMGR_BUG(0);
@@ -1390,7 +1390,7 @@ static struct wlan_objmgr_peer *wlan_obj_psoc_peerlist_get_peer_by_mac_n_bssid(
 
 	/* Iterate through hash list to get the peer */
 	peer = wlan_psoc_peer_list_peek_head(obj_list);
-	while (peer != NULL) {
+	while (peer) {
 		/* For peer, macaddr is key */
 		if (WLAN_ADDR_EQ(wlan_peer_get_macaddr(peer), macaddr)
 			== QDF_STATUS_SUCCESS) {
@@ -1428,7 +1428,7 @@ static struct wlan_objmgr_peer
 
 	/* Iterate through hash list to get the peer */
 	peer = wlan_psoc_peer_list_peek_head(obj_list);
-	while (peer != NULL) {
+	while (peer) {
 		/* For peer, macaddr is key */
 		if (WLAN_ADDR_EQ(wlan_peer_get_macaddr(peer), macaddr)
 			== QDF_STATUS_SUCCESS) {
@@ -1830,7 +1830,7 @@ void *wlan_objmgr_psoc_get_comp_private_obj(struct wlan_objmgr_psoc *psoc,
 		return NULL;
 	}
 
-	if (psoc == NULL) {
+	if (!psoc) {
 		QDF_BUG(0);
 		return NULL;
 	}
@@ -1844,7 +1844,7 @@ qdf_export_symbol(wlan_objmgr_psoc_get_comp_private_obj);
 void wlan_objmgr_psoc_get_ref(struct wlan_objmgr_psoc *psoc,
 						wlan_objmgr_ref_dbgid id)
 {
-	if (psoc == NULL) {
+	if (!psoc) {
 		obj_mgr_err("psoc obj is NULL for id:%d", id);
 		QDF_ASSERT(0);
 		return;
@@ -1859,7 +1859,7 @@ qdf_export_symbol(wlan_objmgr_psoc_get_ref);
 QDF_STATUS wlan_objmgr_psoc_try_get_ref(struct wlan_objmgr_psoc *psoc,
 						wlan_objmgr_ref_dbgid id)
 {
-	if (psoc == NULL) {
+	if (!psoc) {
 		obj_mgr_err("psoc obj is NULL for id:%d", id);
 		QDF_ASSERT(0);
 		return QDF_STATUS_E_FAILURE;
@@ -1888,7 +1888,7 @@ qdf_export_symbol(wlan_objmgr_psoc_try_get_ref);
 void wlan_objmgr_psoc_release_ref(struct wlan_objmgr_psoc *psoc,
 						wlan_objmgr_ref_dbgid id)
 {
-	if (psoc == NULL) {
+	if (!psoc) {
 		obj_mgr_err("psoc obj is NULL for id:%d", id);
 		QDF_ASSERT(0);
 		return;
@@ -1992,7 +1992,7 @@ qdf_export_symbol(wlan_objmgr_print_ref_all_objects_per_psoc);
 QDF_STATUS wlan_objmgr_psoc_set_user_config(struct wlan_objmgr_psoc *psoc,
 		struct wlan_objmgr_psoc_user_config *user_config_data)
 {
-	if (user_config_data == NULL) {
+	if (!user_config_data) {
 		obj_mgr_err("user_config_data is NULL");
 		QDF_BUG(0);
 		return QDF_STATUS_E_FAILURE;

+ 25 - 25
umac/cmn_services/obj_mgr/src/wlan_objmgr_vdev_obj.c

@@ -52,7 +52,7 @@ static QDF_STATUS wlan_objmgr_vdev_object_status(
 		 * break
 		 */
 		} else if (vdev->obj_status[id] == QDF_STATUS_COMP_ASYNC) {
-			if (vdev->vdev_comp_priv_obj[id] == NULL) {
+			if (!vdev->vdev_comp_priv_obj[id]) {
 				status = QDF_STATUS_COMP_ASYNC;
 				break;
 			}
@@ -76,19 +76,19 @@ static QDF_STATUS wlan_objmgr_vdev_obj_free(struct wlan_objmgr_vdev *vdev)
 	struct wlan_objmgr_pdev *pdev;
 	struct wlan_objmgr_psoc *psoc;
 
-	if (vdev == NULL) {
+	if (!vdev) {
 		obj_mgr_err("vdev is NULL");
 		return QDF_STATUS_E_FAILURE;
 	}
 	/* if PDEV is NULL, return */
 	pdev = wlan_vdev_get_pdev(vdev);
-	if (pdev == NULL) {
+	if (!pdev) {
 		obj_mgr_err("pdev is NULL for vdev-id: %d",
 			vdev->vdev_objmgr.vdev_id);
 		return QDF_STATUS_E_FAILURE;
 	}
 	psoc = wlan_pdev_get_psoc(pdev);
-	if (psoc == NULL) {
+	if (!psoc) {
 		obj_mgr_err("psoc is NULL in pdev");
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -125,13 +125,13 @@ struct wlan_objmgr_vdev *wlan_objmgr_vdev_obj_create(
 	void *arg;
 	QDF_STATUS obj_status;
 
-	if (pdev == NULL) {
+	if (!pdev) {
 		obj_mgr_err("pdev is NULL");
 		return NULL;
 	}
 	psoc = wlan_pdev_get_psoc(pdev);
 	/* PSOC is NULL */
-	if (psoc == NULL) {
+	if (!psoc) {
 		obj_mgr_err("psoc is NULL for pdev-id:%d",
 			pdev->pdev_objmgr.wlan_pdev_id);
 		return NULL;
@@ -215,7 +215,7 @@ struct wlan_objmgr_vdev *wlan_objmgr_vdev_obj_create(
 	for (id = 0; id < WLAN_UMAC_MAX_COMPONENTS; id++) {
 		handler = g_umac_glb_obj->vdev_create_handler[id];
 		arg = g_umac_glb_obj->vdev_create_handler_arg[id];
-		if (handler != NULL)
+		if (handler)
 			vdev->obj_status[id] = handler(vdev, arg);
 		else
 			vdev->obj_status[id] = QDF_STATUS_COMP_DISABLED;
@@ -231,7 +231,7 @@ struct wlan_objmgr_vdev *wlan_objmgr_vdev_obj_create(
 		for (id = 0; id < WLAN_UMAC_MAX_COMPONENTS; id++) {
 			stat_handler = g_umac_glb_obj->vdev_status_handler[id];
 			arg = g_umac_glb_obj->vdev_status_handler_arg[id];
-			if (stat_handler != NULL) {
+			if (stat_handler) {
 				stat_handler(vdev, arg,
 					     QDF_STATUS_SUCCESS);
 			}
@@ -265,7 +265,7 @@ static QDF_STATUS wlan_objmgr_vdev_obj_destroy(struct wlan_objmgr_vdev *vdev)
 	void *arg;
 	uint8_t vdev_id;
 
-	if (vdev == NULL) {
+	if (!vdev) {
 		obj_mgr_err("vdev is NULL");
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -318,7 +318,7 @@ QDF_STATUS wlan_objmgr_vdev_obj_delete(struct wlan_objmgr_vdev *vdev)
 {
 	uint8_t print_idx;
 
-	if (vdev == NULL) {
+	if (!vdev) {
 		obj_mgr_err("vdev is NULL");
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -362,7 +362,7 @@ QDF_STATUS wlan_objmgr_vdev_component_obj_attach(
 
 	wlan_vdev_obj_lock(vdev);
 	/* If there is a valid entry, return failure */
-	if (vdev->vdev_comp_priv_obj[id] != NULL) {
+	if (vdev->vdev_comp_priv_obj[id]) {
 		wlan_vdev_obj_unlock(vdev);
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -394,7 +394,7 @@ QDF_STATUS wlan_objmgr_vdev_component_obj_attach(
 		for (i = 0; i < WLAN_UMAC_MAX_COMPONENTS; i++) {
 			stat_handler = g_umac_glb_obj->vdev_status_handler[i];
 			arg = g_umac_glb_obj->vdev_status_handler_arg[i];
-			if (stat_handler != NULL)
+			if (stat_handler)
 				stat_handler(vdev, arg, obj_status);
 		}
 	}
@@ -488,7 +488,7 @@ QDF_STATUS wlan_objmgr_iterate_peerobj_list(
 	struct wlan_objmgr_peer *peer_next = NULL;
 	uint8_t vdev_id;
 
-	if (vdev == NULL) {
+	if (!vdev) {
 		obj_mgr_err("VDEV is NULL");
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -503,10 +503,10 @@ QDF_STATUS wlan_objmgr_iterate_peerobj_list(
 	}
 	wlan_objmgr_vdev_get_ref(vdev, dbg_id);
 	peer_list = &vdev->vdev_objmgr.wlan_peer_list;
-	if (peer_list != NULL) {
+	if (peer_list) {
 		/* Iterate through VDEV's peer list */
 		peer = wlan_vdev_peer_list_peek_head(peer_list);
-		while (peer != NULL) {
+		while (peer) {
 			peer_next = wlan_peer_get_next_peer_of_vdev(peer_list,
 							       peer);
 			if (wlan_objmgr_peer_try_get_ref(peer, dbg_id) ==
@@ -540,7 +540,7 @@ QDF_STATUS wlan_objmgr_trigger_vdev_comp_priv_object_creation(
 	 * If component object is already created, delete old
 	 * component object, then invoke creation
 	 */
-	if (vdev->vdev_comp_priv_obj[id] != NULL) {
+	if (vdev->vdev_comp_priv_obj[id]) {
 		wlan_vdev_obj_unlock(vdev);
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -549,7 +549,7 @@ QDF_STATUS wlan_objmgr_trigger_vdev_comp_priv_object_creation(
 	/* Invoke registered create handlers */
 	handler = g_umac_glb_obj->vdev_create_handler[id];
 	arg = g_umac_glb_obj->vdev_create_handler_arg[id];
-	if (handler != NULL)
+	if (handler)
 		vdev->obj_status[id] = handler(vdev, arg);
 	else
 		return QDF_STATUS_E_FAILURE;
@@ -581,7 +581,7 @@ QDF_STATUS wlan_objmgr_trigger_vdev_comp_priv_object_deletion(
 
 	wlan_vdev_obj_lock(vdev);
 	/* Component object was never created, invalid operation */
-	if (vdev->vdev_comp_priv_obj[id] == NULL) {
+	if (!vdev->vdev_comp_priv_obj[id]) {
 		wlan_vdev_obj_unlock(vdev);
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -590,7 +590,7 @@ QDF_STATUS wlan_objmgr_trigger_vdev_comp_priv_object_deletion(
 	/* Invoke registered create handlers */
 	handler = g_umac_glb_obj->vdev_destroy_handler[id];
 	arg = g_umac_glb_obj->vdev_destroy_handler_arg[id];
-	if (handler != NULL)
+	if (handler)
 		vdev->obj_status[id] = handler(vdev, arg);
 	else
 		return QDF_STATUS_E_FAILURE;
@@ -618,7 +618,7 @@ static QDF_STATUS wlan_obj_vdev_peerlist_remove_peer(qdf_list_t *obj_list,
 {
 	qdf_list_node_t *vdev_node = NULL;
 
-	if (peer == NULL)
+	if (!peer)
 		return QDF_STATUS_E_FAILURE;
 	/* get vdev list node element */
 	vdev_node = &peer->vdev_peer;
@@ -774,7 +774,7 @@ void *wlan_objmgr_vdev_get_comp_private_obj(
 		return NULL;
 	}
 
-	if (vdev == NULL) {
+	if (!vdev) {
 		QDF_BUG(0);
 		return NULL;
 	}
@@ -788,7 +788,7 @@ qdf_export_symbol(wlan_objmgr_vdev_get_comp_private_obj);
 void wlan_objmgr_vdev_get_ref(struct wlan_objmgr_vdev *vdev,
 						wlan_objmgr_ref_dbgid id)
 {
-	if (vdev == NULL) {
+	if (!vdev) {
 		obj_mgr_err("vdev obj is NULL for id:%d", id);
 		QDF_ASSERT(0);
 		return;
@@ -806,7 +806,7 @@ QDF_STATUS wlan_objmgr_vdev_try_get_ref(struct wlan_objmgr_vdev *vdev,
 {
 	uint8_t vdev_id;
 
-	if (vdev == NULL) {
+	if (!vdev) {
 		obj_mgr_err("vdev obj is NULL for id:%d", id);
 		QDF_ASSERT(0);
 		return QDF_STATUS_E_FAILURE;
@@ -838,7 +838,7 @@ void wlan_objmgr_vdev_release_ref(struct wlan_objmgr_vdev *vdev,
 {
 	uint8_t vdev_id;
 
-	if (vdev == NULL) {
+	if (!vdev) {
 		obj_mgr_err("vdev obj is NULL for id:%d", id);
 		QDF_ASSERT(0);
 		return;
@@ -935,7 +935,7 @@ struct wlan_objmgr_vdev *wlan_vdev_get_next_active_vdev_of_pdev(
 	qdf_list_node_t *node = &vdev->vdev_node;
 	qdf_list_node_t *prev_node = NULL;
 
-	if (node == NULL)
+	if (!node)
 		return NULL;
 
 	wlan_pdev_obj_lock(pdev);