Kaynağa Gözat

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

Change-Id: I6c5589e430bdd8687122337fe88fb84ba72bab60
CRs-Fixed: 2418391
Jeff Johnson 6 yıl önce
ebeveyn
işleme
6795c3a9aa

+ 3 - 3
core/dp/htt/htt.c

@@ -69,7 +69,7 @@ struct htt_htc_pkt *htt_htc_pkt_alloc(struct htt_pdev_t *pdev)
 	}
 	HTT_TX_MUTEX_RELEASE(&pdev->htt_tx_mutex);
 
-	if (pkt == NULL)
+	if (!pkt)
 		pkt = qdf_mem_malloc(sizeof(*pkt));
 
 	if (!pkt)
@@ -750,8 +750,8 @@ int htt_update_endpoint(struct htt_pdev_t *pdev,
 	int     rc = 0;
 
 	hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
-	if (qdf_unlikely(NULL == hif_ctx)) {
-		QDF_ASSERT(NULL != hif_ctx);
+	if (qdf_unlikely(!hif_ctx)) {
+		QDF_ASSERT(hif_ctx);
 		QDF_TRACE(QDF_MODULE_ID_HTT, QDF_TRACE_LEVEL_ERROR,
 			  "%s:%d: assuming non-tx service.",
 			  __func__, __LINE__);

+ 3 - 3
core/dp/htt/htt_h2t.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-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
@@ -86,7 +86,7 @@ void htt_h2t_send_complete(void *context, HTC_PACKET *htc_pkt)
 
 	/* process (free or keep) the netbuf that held the message */
 	netbuf = (qdf_nbuf_t) htc_pkt->pNetBufContext;
-	if (send_complete_part2 != NULL) {
+	if (send_complete_part2) {
 		send_complete_part2(htt_pkt->pdev_ctxt, htc_pkt->Status, netbuf,
 				    htt_pkt->msdu_id);
 	}
@@ -347,7 +347,7 @@ QDF_STATUS htt_h2t_rx_ring_rfs_cfg_msg_ll(struct htt_pdev_t *pdev)
 		      "Disable Rx flow steering");
 	}
 	cds_cfg = cds_get_ini_config();
-	if (cds_cfg != NULL) {
+	if (cds_cfg) {
 		msg_local |= ((cds_cfg->max_msdus_per_rxinorderind & 0xff)
 			      << 16);
 		QDF_TRACE(QDF_MODULE_ID_HTT, QDF_TRACE_LEVEL_INFO_LOW,

+ 2 - 2
core/dp/htt/htt_internal.h

@@ -766,8 +766,8 @@ static inline int htt_display_rx_buf_debug(struct htt_pdev_t *pdev)
 	int i;
 	struct rx_buf_debug *buf;
 
-	if ((pdev != NULL) &&
-	    (pdev->rx_buff_list != NULL)) {
+	if ((pdev) &&
+	    (pdev->rx_buff_list)) {
 		buf = pdev->rx_buff_list;
 		for (i = 0; i < HTT_RX_RING_BUFF_DBG_LIST; i++) {
 			if (buf[i].posted != 0)

+ 4 - 4
core/dp/htt/htt_tx.c

@@ -160,7 +160,7 @@ static int htt_tx_frag_desc_attach(struct htt_pdev_t *pdev,
 		pdev->frag_descs.size, desc_pool_elems,
 		qdf_get_dma_mem_context((&pdev->frag_descs), memctx), false);
 	if ((0 == pdev->frag_descs.desc_pages.num_pages) ||
-		(NULL == pdev->frag_descs.desc_pages.dma_pages)) {
+		(!pdev->frag_descs.desc_pages.dma_pages)) {
 		ol_txrx_err("FRAG descriptor alloc fail");
 		return -ENOBUFS;
 	}
@@ -343,7 +343,7 @@ int htt_tx_attach(struct htt_pdev_t *pdev, int desc_pool_elems)
 				  qdf_get_dma_mem_context((&pdev->tx_descs),
 							  memctx), true);
 	if ((0 == pdev->tx_descs.desc_pages.num_pages) ||
-	    (NULL == pdev->tx_descs.desc_pages.cacheable_pages)) {
+	    (!pdev->tx_descs.desc_pages.cacheable_pages)) {
 		ol_txrx_err("HTT desc alloc fail");
 		goto out_fail;
 	}
@@ -511,7 +511,7 @@ int htt_tx_attach(struct htt_pdev_t *pdev, int desc_pool_elems)
 		pdev->tx_descs.size, pdev->tx_descs.pool_elems,
 		qdf_get_dma_mem_context((&pdev->tx_descs), memctx), false);
 	if ((0 == pdev->tx_descs.desc_pages.num_pages) ||
-		(NULL == pdev->tx_descs.desc_pages.dma_pages)) {
+		(!pdev->tx_descs.desc_pages.dma_pages)) {
 		ol_txrx_err("HTT desc alloc fail");
 		goto out_fail;
 	}
@@ -738,7 +738,7 @@ void htt_tx_sched(htt_pdev_handle pdev)
 	int packet_len;
 
 	HTT_TX_NBUF_QUEUE_REMOVE(pdev, msdu);
-	while (msdu != NULL) {
+	while (msdu) {
 		int not_accepted;
 		/* packet length includes HTT tx desc frag added above */
 		packet_len = qdf_nbuf_len(msdu);

+ 3 - 3
core/dp/txrx/ol_rx.c

@@ -284,7 +284,7 @@ static void ol_rx_process_inv_peer(ol_txrx_pdev_handle pdev,
 	 *  clear to static analysis that this code is safe, add an explicit
 	 *  check that htt_rx_mpdu_wifi_hdr_retrieve provides a non-NULL value.
 	 */
-	if (wh == NULL || !IEEE80211_IS_DATA(wh))
+	if (!wh || !IEEE80211_IS_DATA(wh))
 		return;
 
 	/* ignore frames for non-existent bssids */
@@ -707,7 +707,7 @@ ol_rx_indication_handler(ol_txrx_pdev_handle pdev,
 						       status);
 
 				if (status == htt_rx_status_tkip_mic_err &&
-				    vdev != NULL && peer != NULL) {
+				    vdev && peer) {
 					union htt_rx_pn_t pn;
 					uint8_t key_id;
 
@@ -1308,7 +1308,7 @@ DONE:
 			 * list, NULL terminator should be added
 			 * for delivery list.
 			 */
-			if (next == NULL && deliver_list_head) {
+			if (!next && deliver_list_head) {
 				/* add NULL terminator */
 				qdf_nbuf_set_next(deliver_list_tail, NULL);
 			}

+ 4 - 4
core/dp/txrx/ol_rx_defrag.c

@@ -176,7 +176,7 @@ ol_rx_frag_restructure(
 	const struct ol_rx_defrag_cipher *f_type,
 	int rx_desc_len)
 {
-	if ((ind_old_position == NULL) || (rx_desc_old_position == NULL)) {
+	if ((!ind_old_position) || (!rx_desc_old_position)) {
 		ol_txrx_err("ind_old_position,rx_desc_old_position is NULL\n");
 		ASSERT(0);
 		return;
@@ -580,14 +580,14 @@ void ol_rx_defrag_waitlist_remove(struct ol_txrx_peer_t *peer, unsigned int tid)
 	struct ol_txrx_pdev_t *pdev = peer->vdev->pdev;
 	struct ol_rx_reorder_t *rx_reorder = &peer->tids_rx_reorder[tid];
 
-	if (rx_reorder->defrag_waitlist_elem.tqe_next != NULL) {
+	if (rx_reorder->defrag_waitlist_elem.tqe_next) {
 
 		TAILQ_REMOVE(&pdev->rx.defrag.waitlist, rx_reorder,
 			     defrag_waitlist_elem);
 
 		rx_reorder->defrag_waitlist_elem.tqe_next = NULL;
 		rx_reorder->defrag_waitlist_elem.tqe_prev = NULL;
-	} else if (rx_reorder->defrag_waitlist_elem.tqe_next != NULL) {
+	} else if (rx_reorder->defrag_waitlist_elem.tqe_next) {
 		ol_txrx_alert("waitlist->tqe_prv = NULL\n");
 		QDF_ASSERT(0);
 		rx_reorder->defrag_waitlist_elem.tqe_next = NULL;
@@ -1037,7 +1037,7 @@ ol_rx_defrag_mic(ol_txrx_pdev_handle pdev,
 			break;
 
 		wbuf = qdf_nbuf_next(wbuf);
-		if (wbuf == NULL)
+		if (!wbuf)
 			return OL_RX_DEFRAG_ERR;
 
 		rx_desc_len = ol_rx_get_desc_len(htt_pdev, wbuf,

+ 3 - 3
core/dp/txrx/ol_rx_reorder.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-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
@@ -344,7 +344,7 @@ ol_rx_reorder_flush(struct ol_txrx_vdev_t *vdev,
 		if (rx_reorder_array_elem->head) {
 			OL_RX_REORDER_MPDU_CNT_DECR(&peer->tids_rx_reorder[tid],
 						    1);
-			if (head_msdu == NULL) {
+			if (!head_msdu) {
 				head_msdu = rx_reorder_array_elem->head;
 				tail_msdu = rx_reorder_array_elem->tail;
 				rx_reorder_array_elem->head = NULL;
@@ -695,7 +695,7 @@ ol_rx_pn_ind_handler(ol_txrx_pdev_handle pdev,
 				} while (1);
 
 			} else {
-				if (head_msdu == NULL) {
+				if (!head_msdu) {
 					head_msdu = rx_reorder_array_elem->head;
 					tail_msdu = rx_reorder_array_elem->tail;
 				} else {

+ 2 - 2
core/dp/txrx/ol_tx_classify.c

@@ -387,7 +387,7 @@ ol_tx_classify(
 
 	TX_SCHED_DEBUG_PRINT("Enter %s\n", __func__);
 	dest_addr = ol_tx_dest_addr_find(pdev, tx_nbuf);
-	if (unlikely(NULL == dest_addr)) {
+	if (unlikely(!dest_addr)) {
 		QDF_TRACE(QDF_MODULE_ID_TXRX,
 				QDF_TRACE_LEVEL_ERROR,
 				"Error: dest_addr is NULL.\n");
@@ -629,7 +629,7 @@ ol_tx_classify_mgmt(
 
 	TX_SCHED_DEBUG_PRINT("Enter %s\n", __func__);
 	dest_addr = ol_tx_dest_addr_find(pdev, tx_nbuf);
-	if (unlikely(NULL == dest_addr)) {
+	if (unlikely(!dest_addr)) {
 		QDF_TRACE(QDF_MODULE_ID_TXRX,
 				QDF_TRACE_LEVEL_ERROR,
 				"Error: dest_addr is NULL.\n");

+ 4 - 4
core/dp/txrx/ol_tx_desc.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011, 2014-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
@@ -337,13 +337,13 @@ static void ol_tso_unmap_tso_segment(struct ol_txrx_pdev_t *pdev,
 	bool is_last_seg = false;
 	struct qdf_tso_num_seg_elem_t *tso_num_desc = NULL;
 
-	if (qdf_unlikely(tx_desc->tso_desc == NULL)) {
+	if (qdf_unlikely(!tx_desc->tso_desc)) {
 		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
 			  "%s %d TSO desc is NULL!",
 			  __func__, __LINE__);
 		qdf_assert(0);
 		return;
-	} else if (qdf_unlikely(tx_desc->tso_num_desc == NULL)) {
+	} else if (qdf_unlikely(!tx_desc->tso_num_desc)) {
 		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
 			  "%s %d TSO common info is NULL!",
 			  __func__, __LINE__);
@@ -895,7 +895,7 @@ ol_tso_seg_dbg_sanitize(struct qdf_tso_seg_elem_t *tsoseg)
 	int rc = -1;
 	struct ol_tx_desc_t *txdesc;
 
-	if (tsoseg != NULL) {
+	if (tsoseg) {
 		txdesc = tsoseg->dbg.txdesc;
 		/* Don't validate if TX desc is NULL*/
 		if (!txdesc)

+ 8 - 8
core/dp/txrx/ol_tx_queue.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-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
@@ -788,12 +788,12 @@ ol_tx_bad_peer_update_tx_limit(struct ol_txrx_pdev_t *pdev,
 			       u_int16_t frames,
 			       u_int16_t tx_limit_flag)
 {
-	if (unlikely(NULL == pdev)) {
+	if (unlikely(!pdev)) {
 		TX_SCHED_DEBUG_PRINT_ALWAYS("Error: NULL pdev handler\n");
 		return;
 	}
 
-	if (unlikely(NULL == txq)) {
+	if (unlikely(!txq)) {
 		TX_SCHED_DEBUG_PRINT_ALWAYS("Error: NULL txq\n");
 		return;
 	}
@@ -946,12 +946,12 @@ ol_txrx_peer_link_status_handler(
 	u_int16_t i = 0;
 	struct ol_txrx_peer_t *peer = NULL;
 
-	if (NULL == pdev) {
+	if (!pdev) {
 		TX_SCHED_DEBUG_PRINT_ALWAYS("Error: NULL pdev handler\n");
 		return;
 	}
 
-	if (NULL == peer_link_status) {
+	if (!peer_link_status) {
 		TX_SCHED_DEBUG_PRINT_ALWAYS(
 			"Error:NULL link report message. peer num %d\n",
 			peer_num);
@@ -1274,7 +1274,7 @@ ol_tx_queue_log_record_display(struct ol_txrx_pdev_t *pdev, int offset)
 		if (record.peer_id != 0xffff) {
 			peer = ol_txrx_peer_find_by_id(pdev,
 						       record.peer_id);
-			if (peer != NULL)
+			if (peer)
 				QDF_TRACE(QDF_MODULE_ID_TXRX,
 					  QDF_TRACE_LEVEL_ERROR,
 					  "Q: %6d  %5d  %3d  %4d (%02x:%02x:%02x:%02x:%02x:%02x)",
@@ -1313,7 +1313,7 @@ ol_tx_queue_log_record_display(struct ol_txrx_pdev_t *pdev, int offset)
 
 		if (record.peer_id != 0xffff) {
 			peer = ol_txrx_peer_find_by_id(pdev, record.peer_id);
-			if (peer != NULL)
+			if (peer)
 				QDF_TRACE(QDF_MODULE_ID_TXRX,
 					  QDF_TRACE_LEVEL_ERROR,
 					  "DQ: %6d  %5d  %3d  %4d (%02x:%02x:%02x:%02x:%02x:%02x)",
@@ -1352,7 +1352,7 @@ ol_tx_queue_log_record_display(struct ol_txrx_pdev_t *pdev, int offset)
 
 		if (record.peer_id != 0xffff) {
 			peer = ol_txrx_peer_find_by_id(pdev, record.peer_id);
-			if (peer != NULL)
+			if (peer)
 				QDF_TRACE(QDF_MODULE_ID_TXRX,
 					  QDF_TRACE_LEVEL_ERROR,
 					  "F: %6d  %5d  %3d  %4d (%02x:%02x:%02x:%02x:%02x:%02x)",

+ 7 - 7
core/dp/txrx/ol_tx_sched.c

@@ -382,7 +382,7 @@ ol_tx_sched_init_rr(
 	int i;
 
 	scheduler = qdf_mem_malloc(sizeof(struct ol_tx_sched_rr_t));
-	if (scheduler == NULL)
+	if (!scheduler)
 		return scheduler;
 
 	for (i = 0; i < (OL_TX_NUM_TIDS + OL_TX_VDEV_NUM_QUEUES); i++) {
@@ -1019,7 +1019,7 @@ static void ol_tx_sched_wrr_param_update(struct ol_txrx_pdev_t *pdev,
 		"VO"
 	};
 
-	if (NULL == scheduler)
+	if (!scheduler)
 		return;
 
 	QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_INFO,
@@ -1073,7 +1073,7 @@ ol_tx_sched_init_wrr_adv(
 
 	scheduler = qdf_mem_malloc(
 			sizeof(struct ol_tx_sched_wrr_adv_t));
-	if (scheduler == NULL)
+	if (!scheduler)
 		return scheduler;
 
 	OL_TX_SCHED_WRR_ADV_CAT_CFG_STORE(VO, scheduler);
@@ -1256,7 +1256,7 @@ ol_tx_sched_discard_select(
 	/* then decide which peer within this category to discard from next */
 	txq = ol_tx_sched_discard_select_txq(
 			pdev, ol_tx_sched_category_tx_queues(pdev, cat));
-	if (NULL == txq)
+	if (!txq)
 		/* No More pending Tx Packets in Tx Queue. Exit Discard loop */
 		return 0;
 
@@ -1355,7 +1355,7 @@ ol_tx_sched_notify(
 	}
 }
 
-#define OL_TX_MSDU_ID_STORAGE_ERR(ptr) (NULL == ptr)
+#define OL_TX_MSDU_ID_STORAGE_ERR(ptr) (!ptr)
 
 static void
 ol_tx_sched_dispatch(
@@ -1371,7 +1371,7 @@ ol_tx_sched_dispatch(
 	TX_SCHED_DEBUG_PRINT("Enter %s\n", __func__);
 	while (sctx->frms) {
 		tx_desc = TAILQ_FIRST(&sctx->head);
-		if (tx_desc == NULL) {
+		if (!tx_desc) {
 			/* TODO: find its reason */
 			QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
 				  "%s: err, no enough tx_desc from stx->head.\n",
@@ -1380,7 +1380,7 @@ ol_tx_sched_dispatch(
 		}
 		msdu = tx_desc->netbuf;
 		TAILQ_REMOVE(&sctx->head, tx_desc, tx_desc_list_elem);
-		if (NULL == head_msdu)
+		if (!head_msdu)
 			head_msdu = msdu;
 
 		if (prev)

+ 2 - 2
core/dp/txrx/ol_tx_send.c

@@ -1044,7 +1044,7 @@ ol_tx_single_completion_handler(ol_txrx_pdev_handle pdev,
 #endif
 
 	tx_desc = ol_tx_desc_find_check(pdev, tx_desc_id);
-	if (tx_desc == NULL) {
+	if (!tx_desc) {
 		ol_txrx_err("invalid desc_id(%u), ignore it", tx_desc_id);
 		return;
 	}
@@ -1320,7 +1320,7 @@ ol_tx_delay_tid_from_l3_hdr(struct ol_txrx_pdev_t *pdev,
 	int l2_hdr_size;
 
 	dest_addr = ol_tx_dest_addr_find(pdev, msdu);
-	if (NULL == dest_addr)
+	if (!dest_addr)
 		return QDF_NBUF_TX_EXT_TID_INVALID;
 
 	is_mcast = IEEE80211_IS_MULTICAST(dest_addr);

+ 19 - 19
core/dp/txrx/ol_txrx.c

@@ -740,7 +740,7 @@ ol_txrx_pdev_attach(ol_txrx_soc_handle soc,
 	if (ol_cfg_is_high_latency(cfg_pdev)) {
 		qdf_spinlock_create(&pdev->tx_queue_spinlock);
 		pdev->tx_sched.scheduler = ol_tx_sched_attach(pdev);
-		if (pdev->tx_sched.scheduler == NULL)
+		if (!pdev->tx_sched.scheduler)
 			goto fail2;
 	}
 	ol_txrx_pdev_txq_log_init(pdev);
@@ -918,7 +918,7 @@ ol_txrx_pdev_post_attach(struct cdp_pdev *ppdev)
 	qdf_mem_multi_pages_alloc(pdev->osdev, &pdev->tx_desc.desc_pages,
 		pdev->tx_desc.desc_reserved_size, desc_pool_size, 0, true);
 	if ((0 == pdev->tx_desc.desc_pages.num_pages) ||
-		(NULL == pdev->tx_desc.desc_pages.cacheable_pages)) {
+		(!pdev->tx_desc.desc_pages.cacheable_pages)) {
 		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
 			"Page alloc fail");
 		ret = -ENOMEM;
@@ -2657,7 +2657,7 @@ QDF_STATUS ol_txrx_peer_state_update(struct cdp_pdev *ppdev,
 
 	peer =  ol_txrx_peer_find_hash_find_get_ref(pdev, peer_mac, 0, 1,
 						    PEER_DEBUG_ID_OL_INTERNAL);
-	if (NULL == peer) {
+	if (!peer) {
 		ol_txrx_err(
 			   "peer is null for peer_mac 0x%x 0x%x 0x%x 0x%x 0x%x 0x%x\n",
 			   peer_mac[0], peer_mac[1], peer_mac[2], peer_mac[3],
@@ -2832,7 +2832,7 @@ ol_txrx_peer_qoscapable_get(struct ol_txrx_pdev_t *txrx_pdev, uint16_t peer_id)
 
 	struct ol_txrx_peer_t *peer_t =
 		ol_txrx_peer_find_by_id(txrx_pdev, peer_id);
-	if (peer_t != NULL)
+	if (peer_t)
 		return peer_t->qos_capable;
 	return 0;
 }
@@ -2887,13 +2887,13 @@ int ol_txrx_peer_release_ref(ol_txrx_peer_handle peer,
 	TXRX_ASSERT2(peer);
 
 	vdev = peer->vdev;
-	if (NULL == vdev) {
+	if (!vdev) {
 		ol_txrx_err("The vdev is not present anymore\n");
 		return -EINVAL;
 	}
 
 	pdev = vdev->pdev;
-	if (NULL == pdev) {
+	if (!pdev) {
 		ol_txrx_err("The pdev is not present anymore\n");
 		err_code = 0xbad2;
 		goto ERR_STATE;
@@ -3368,7 +3368,7 @@ static QDF_STATUS ol_txrx_wait_for_pending_tx(int timeout)
 {
 	struct ol_txrx_pdev_t *txrx_pdev = cds_get_context(QDF_MODULE_ID_TXRX);
 
-	if (txrx_pdev == NULL) {
+	if (!txrx_pdev) {
 		ol_txrx_err("txrx context is null");
 		return QDF_STATUS_E_FAULT;
 	}
@@ -4324,7 +4324,7 @@ static void ol_vdev_rx_set_intrabss_fwd(struct cdp_vdev *pvdev, bool val)
 {
 	struct ol_txrx_vdev_t *vdev = (struct ol_txrx_vdev_t *)pvdev;
 
-	if (NULL == vdev)
+	if (!vdev)
 		return;
 
 	vdev->disable_intrabss_fwd = val;
@@ -4343,7 +4343,7 @@ static void ol_txrx_update_mac_id(uint8_t vdev_id, uint8_t mac_id)
 			(struct ol_txrx_vdev_t *)
 			ol_txrx_get_vdev_from_vdev_id(vdev_id);
 
-	if (NULL == vdev) {
+	if (!vdev) {
 		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_ERROR,
 			  "%s: Invalid vdev_id %d", __func__, vdev_id);
 		return;
@@ -4845,7 +4845,7 @@ static QDF_STATUS ol_txrx_register_ocb_peer(uint8_t *mac_addr,
 void ol_txrx_set_ocb_peer(struct ol_txrx_pdev_t *pdev,
 			  struct ol_txrx_peer_t *peer)
 {
-	if (pdev == NULL)
+	if (!pdev)
 		return;
 
 	pdev->ocb_peer = peer;
@@ -4864,7 +4864,7 @@ bool ol_txrx_get_ocb_peer(struct ol_txrx_pdev_t *pdev,
 {
 	int rc;
 
-	if ((pdev == NULL) || (peer == NULL)) {
+	if ((!pdev) || (!peer)) {
 		rc = false;
 		goto exit;
 	}
@@ -4964,12 +4964,12 @@ static void ol_register_offld_flush_cb(void (offld_flush_cb)(void *))
 	struct hif_opaque_softc *hif_device;
 	struct ol_txrx_pdev_t *pdev = cds_get_context(QDF_MODULE_ID_TXRX);
 
-	if (pdev == NULL) {
+	if (!pdev) {
 		ol_txrx_err("pdev NULL!");
 		TXRX_ASSERT2(0);
 		goto out;
 	}
-	if (pdev->offld_flush_cb != NULL) {
+	if (pdev->offld_flush_cb) {
 		ol_txrx_info("offld already initialised");
 		if (pdev->offld_flush_cb != offld_flush_cb) {
 			ol_txrx_err(
@@ -4982,7 +4982,7 @@ static void ol_register_offld_flush_cb(void (offld_flush_cb)(void *))
 	pdev->offld_flush_cb = offld_flush_cb;
 	hif_device = cds_get_context(QDF_MODULE_ID_HIF);
 
-	if (qdf_unlikely(hif_device == NULL)) {
+	if (qdf_unlikely(!hif_device)) {
 		ol_txrx_err("hif_device NULL!");
 		qdf_assert(0);
 		goto out;
@@ -5007,13 +5007,13 @@ static void ol_deregister_offld_flush_cb(void)
 	struct hif_opaque_softc *hif_device;
 	struct ol_txrx_pdev_t *pdev = cds_get_context(QDF_MODULE_ID_TXRX);
 
-	if (pdev == NULL) {
+	if (!pdev) {
 		ol_txrx_err("pdev NULL!");
 		return;
 	}
 	hif_device = cds_get_context(QDF_MODULE_ID_HIF);
 
-	if (qdf_unlikely(hif_device == NULL)) {
+	if (qdf_unlikely(!hif_device)) {
 		ol_txrx_err("hif_device NULL!");
 		qdf_assert(0);
 		return;
@@ -5037,7 +5037,7 @@ static QDF_STATUS ol_register_data_stall_detect_cb(
 {
 	struct ol_txrx_pdev_t *pdev = cds_get_context(QDF_MODULE_ID_TXRX);
 
-	if (pdev == NULL) {
+	if (!pdev) {
 		ol_txrx_err("pdev NULL!");
 		return QDF_STATUS_E_INVAL;
 	}
@@ -5057,7 +5057,7 @@ static QDF_STATUS ol_deregister_data_stall_detect_cb(
 {
 	struct ol_txrx_pdev_t *pdev = cds_get_context(QDF_MODULE_ID_TXRX);
 
-	if (pdev == NULL) {
+	if (!pdev) {
 		ol_txrx_err("pdev NULL!");
 		return QDF_STATUS_E_INVAL;
 	}
@@ -5479,7 +5479,7 @@ void *ol_get_pldev(struct cdp_pdev *txrx_pdev)
 {
 	struct ol_txrx_pdev_t *pdev =
 				 (struct ol_txrx_pdev_t *)txrx_pdev;
-	if (pdev != NULL)
+	if (pdev)
 		return pdev->pl_dev;
 
 	return NULL;

+ 4 - 4
core/dp/txrx/ol_txrx_encap.c

@@ -298,12 +298,12 @@ ol_rx_decap_to_native_wifi(struct ol_txrx_vdev_t *vdev,
 		hdsize = sizeof(struct ieee80211_frame);
 
 	wh = (struct ieee80211_frame_addr4 *)qdf_nbuf_push_head(msdu, hdsize);
-	TXRX_ASSERT2(wh != NULL);
+	TXRX_ASSERT2(wh);
 	TXRX_ASSERT2(hdsize <= info->hdr_len);
 	qdf_mem_copy((uint8_t *) wh, info->hdr, hdsize);
 
 	/* amsdu subfrm handling if ethr_hdr is not NULL  */
-	if (ethr_hdr != NULL) {
+	if (ethr_hdr) {
 		switch (wh->i_fc[1] & IEEE80211_FC1_DIR_MASK) {
 		case IEEE80211_FC1_DIR_NODS:
 			qdf_mem_copy(wh->i_addr1, ethr_hdr->dest_addr,
@@ -381,7 +381,7 @@ ol_rx_decap_to_8023(struct ol_txrx_vdev_t *vdev,
 		buf = qdf_nbuf_push_head(msdu, ETHERNET_HDR_LEN - l2_hdr_space);
 
 	/* normal msdu(non-subfrm of A-MSDU) if ethr_hdr is null */
-	if (ethr_hdr == NULL) {
+	if (!ethr_hdr) {
 		/*
 		 * mpdu hdr should be present in info,
 		 * re-create ethr_hdr based on mpdu hdr
@@ -416,7 +416,7 @@ ol_rx_decap_to_8023(struct ol_txrx_vdev_t *vdev,
 			break;
 		}
 	}
-	if (llc_hdr == NULL) {
+	if (!llc_hdr) {
 		ethr_hdr->ethertype[0] = (ether_type >> 8) & 0xff;
 		ethr_hdr->ethertype[1] = (ether_type) & 0xff;
 	} else {

+ 1 - 1
core/dp/txrx/ol_txrx_flow_control.c

@@ -790,7 +790,7 @@ void ol_tx_flow_pool_map_handler(uint8_t flow_id, uint8_t flow_type,
 	pool = ol_tx_get_flow_pool(flow_pool_id);
 	if (!pool) {
 		pool = ol_tx_create_flow_pool(flow_pool_id, flow_pool_size);
-		if (pool == NULL) {
+		if (!pool) {
 			ol_txrx_err("creation of flow_pool %d size %d failed",
 				    flow_pool_id, flow_pool_size);
 			return;

+ 1 - 1
core/dp/txrx/ol_txrx_internal.h

@@ -615,7 +615,7 @@ NOT_IP_TCP:
 		else							\
 			err_type = OL_RX_ERR_UNKNOWN;			\
 									\
-		if (vdev != NULL && peer != NULL) {			\
+		if (vdev && peer) {			\
 			OL_RX_ERR_STATISTICS_1(pdev, vdev, peer,	\
 					       rx_mpdu_desc, err_type); \
 		} else {						\

+ 2 - 2
core/dp/txrx/ol_txrx_peer_find.c

@@ -652,7 +652,7 @@ void ol_rx_peer_unmap_handler(ol_txrx_pdev_handle pdev, uint16_t peer_id)
 	}
 	peer = pdev->peer_id_to_obj_map[peer_id].peer;
 
-	if (peer == NULL) {
+	if (!peer) {
 		/*
 		 * Currently peer IDs are assigned for vdevs as well as peers.
 		 * If the peer ID is for a vdev, then the peer pointer stored
@@ -724,7 +724,7 @@ void ol_txrx_peer_remove_obj_map_entries(ol_txrx_pdev_handle pdev,
 		peer_id = peer->peer_ids[i];
 		save_peer_ids[i] = HTT_INVALID_PEER;
 		if (peer_id == HTT_INVALID_PEER ||
-			pdev->peer_id_to_obj_map[peer_id].peer == NULL) {
+			!pdev->peer_id_to_obj_map[peer_id].peer) {
 			/* unused peer_id, or object is already dereferenced */
 			continue;
 		}

+ 2 - 2
core/dp/txrx/ol_txrx_peer_find.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2015-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011, 2015-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
@@ -76,7 +76,7 @@ struct ol_txrx_peer_t *ol_txrx_peer_find_by_id(struct ol_txrx_pdev_t *pdev,
 	 * If the peer ID is for a vdev, the peer_id_to_obj_map entry
 	 * will hold NULL rather than a valid peer pointer.
 	 */
-	/* TXRX_ASSERT2(peer != NULL); */
+	/* TXRX_ASSERT2(peer); */
 	/*
 	 * Only return the peer object if it is valid,
 	 * i.e. it has not already been detached.