소스 검색

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

Change-Id: Iae6c2f2f0b3041a9397dd13092ea500a8b995fd2
CRs-Fixed: 2418251
Jeff Johnson 6 년 전
부모
커밋
4c5ac90746

+ 1 - 1
utils/epping/src/epping_helper.c

@@ -107,7 +107,7 @@ struct epping_cookie *epping_alloc_cookie(epping_context_t *pEpping_ctx)
 
 
 	qdf_spin_lock_bh(&pEpping_ctx->cookie_lock);
 	qdf_spin_lock_bh(&pEpping_ctx->cookie_lock);
 	cookie = pEpping_ctx->cookie_list;
 	cookie = pEpping_ctx->cookie_list;
-	if (cookie != NULL) {
+	if (cookie) {
 		pEpping_ctx->cookie_list = cookie->next;
 		pEpping_ctx->cookie_list = cookie->next;
 		pEpping_ctx->cookie_count--;
 		pEpping_ctx->cookie_count--;
 	}
 	}

+ 5 - 5
utils/epping/src/epping_main.c

@@ -110,7 +110,7 @@ void epping_disable(void)
 	}
 	}
 
 
 	hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
 	hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
-	if (hif_ctx == NULL) {
+	if (!hif_ctx) {
 		EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
 		EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
 			   "%s: error: hif_ctx = NULL", __func__);
 			   "%s: error: hif_ctx = NULL", __func__);
 		return;
 		return;
@@ -119,7 +119,7 @@ void epping_disable(void)
 	hif_reset_soc(hif_ctx);
 	hif_reset_soc(hif_ctx);
 
 
 	htc_handle = cds_get_context(QDF_MODULE_ID_HTC);
 	htc_handle = cds_get_context(QDF_MODULE_ID_HTC);
-	if (htc_handle == NULL) {
+	if (!htc_handle) {
 		EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
 		EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
 			   "%s: error: htc_handle = NULL", __func__);
 			   "%s: error: htc_handle = NULL", __func__);
 		return;
 		return;
@@ -145,7 +145,7 @@ void epping_close(void)
 {
 {
 	epping_context_t *to_free;
 	epping_context_t *to_free;
 
 
-	if (g_epping_ctx == NULL) {
+	if (!g_epping_ctx) {
 		EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
 		EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
 			   "%s: error: g_epping_ctx  = NULL", __func__);
 			   "%s: error: g_epping_ctx  = NULL", __func__);
 		return;
 		return;
@@ -163,7 +163,7 @@ void epping_close(void)
  */
  */
 static void epping_target_suspend_acknowledge(void *context, bool wow_nack)
 static void epping_target_suspend_acknowledge(void *context, bool wow_nack)
 {
 {
-	if (NULL == g_epping_ctx) {
+	if (!g_epping_ctx) {
 		EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
 		EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
 			   "%s: epping_ctx is NULL", __func__);
 			   "%s: epping_ctx is NULL", __func__);
 		return;
 		return;
@@ -251,7 +251,7 @@ int epping_enable(struct device *parent_dev, bool rtnl_held)
 
 
 	p_cds_context = cds_get_global_context();
 	p_cds_context = cds_get_global_context();
 
 
-	if (p_cds_context == NULL) {
+	if (!p_cds_context) {
 		EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
 		EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
 			   "%s: Failed cds_get_global_context", __func__);
 			   "%s: Failed cds_get_global_context", __func__);
 		ret = -1;
 		ret = -1;

+ 2 - 2
utils/epping/src/epping_rx.c

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2017, 2019 The Linux Foundation. All rights reserved.
  *
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
  * any purpose with or without fee is hereby granted, provided that the
@@ -76,7 +76,7 @@ void epping_refill(void *ctx, HTC_ENDPOINT_ID Endpoint)
 	for (RxBuffers = 0; RxBuffers < buffersToRefill; RxBuffers++) {
 	for (RxBuffers = 0; RxBuffers < buffersToRefill; RxBuffers++) {
 		osBuf = qdf_nbuf_alloc(NULL, AR6000_BUFFER_SIZE,
 		osBuf = qdf_nbuf_alloc(NULL, AR6000_BUFFER_SIZE,
 				       AR6000_MIN_HEAD_ROOM, 4, false);
 				       AR6000_MIN_HEAD_ROOM, 4, false);
-		if (NULL == osBuf) {
+		if (!osBuf) {
 			break;
 			break;
 		}
 		}
 		/* the HTC packet wrapper is at the head of the reserved area
 		/* the HTC packet wrapper is at the head of the reserved area

+ 5 - 5
utils/epping/src/epping_tx.c

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2019 The Linux Foundation. All rights reserved.
  *
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
  * any purpose with or without fee is hereby granted, provided that the
@@ -54,7 +54,7 @@ void epping_tx_dup_pkt(epping_adapter_t *adapter,
 	qdf_nbuf_t new_skb;
 	qdf_nbuf_t new_skb;
 
 
 	cookie = epping_alloc_cookie(adapter->pEpping_ctx);
 	cookie = epping_alloc_cookie(adapter->pEpping_ctx);
-	if (cookie == NULL) {
+	if (!cookie) {
 		EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
 		EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
 			   "%s: epping_alloc_cookie returns no resource\n",
 			   "%s: epping_alloc_cookie returns no resource\n",
 			   __func__);
 			   __func__);
@@ -103,7 +103,7 @@ static int epping_tx_send_int(qdf_nbuf_t skb, epping_adapter_t *adapter)
 	/* allocate resource for this packet */
 	/* allocate resource for this packet */
 	cookie = epping_alloc_cookie(adapter->pEpping_ctx);
 	cookie = epping_alloc_cookie(adapter->pEpping_ctx);
 	/* no resource */
 	/* no resource */
-	if (cookie == NULL) {
+	if (!cookie) {
 		EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
 		EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
 			   "%s: epping_alloc_cookie returns no resource\n",
 			   "%s: epping_alloc_cookie returns no resource\n",
 			   __func__);
 			   __func__);
@@ -318,7 +318,7 @@ void epping_tx_complete(void *ctx, HTC_PACKET *htc_pkt)
 	A_BOOL flushing = false;
 	A_BOOL flushing = false;
 	qdf_nbuf_queue_t skb_queue;
 	qdf_nbuf_queue_t skb_queue;
 
 
-	if (htc_pkt == NULL)
+	if (!htc_pkt)
 		return;
 		return;
 
 
 	qdf_nbuf_queue_init(&skb_queue);
 	qdf_nbuf_queue_init(&skb_queue);
@@ -381,7 +381,7 @@ void epping_tx_complete(void *ctx, HTC_PACKET *htc_pkt)
 	while (qdf_nbuf_queue_len(&skb_queue)) {
 	while (qdf_nbuf_queue_len(&skb_queue)) {
 		/* use non-lock version */
 		/* use non-lock version */
 		pktSkb = qdf_nbuf_queue_remove(&skb_queue);
 		pktSkb = qdf_nbuf_queue_remove(&skb_queue);
-		if (pktSkb == NULL)
+		if (!pktSkb)
 			break;
 			break;
 		qdf_nbuf_tx_free(pktSkb, QDF_NBUF_PKT_ERROR);
 		qdf_nbuf_tx_free(pktSkb, QDF_NBUF_PKT_ERROR);
 		pEpping_ctx->total_tx_acks++;
 		pEpping_ctx->total_tx_acks++;

+ 9 - 9
utils/epping/src/epping_txrx.c

@@ -50,14 +50,14 @@ static void epping_timer_expire(void *data)
 	struct net_device *dev = (struct net_device *)data;
 	struct net_device *dev = (struct net_device *)data;
 	epping_adapter_t *adapter;
 	epping_adapter_t *adapter;
 
 
-	if (dev == NULL) {
+	if (!dev) {
 		EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
 		EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
 			   "%s: netdev = NULL", __func__);
 			   "%s: netdev = NULL", __func__);
 		return;
 		return;
 	}
 	}
 
 
 	adapter = netdev_priv(dev);
 	adapter = netdev_priv(dev);
-	if (adapter == NULL) {
+	if (!adapter) {
 		EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
 		EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
 			   "%s: adapter = NULL", __func__);
 			   "%s: adapter = NULL", __func__);
 		return;
 		return;
@@ -82,7 +82,7 @@ static int epping_ndev_stop(struct net_device *dev)
 	int ret = 0;
 	int ret = 0;
 
 
 	adapter = netdev_priv(dev);
 	adapter = netdev_priv(dev);
-	if (NULL == adapter) {
+	if (!adapter) {
 		EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
 		EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
 			   "%s: EPPING adapter context is Null", __func__);
 			   "%s: EPPING adapter context is Null", __func__);
 		ret = -ENODEV;
 		ret = -ENODEV;
@@ -98,7 +98,7 @@ static void epping_ndev_uninit(struct net_device *dev)
 	epping_adapter_t *adapter;
 	epping_adapter_t *adapter;
 
 
 	adapter = netdev_priv(dev);
 	adapter = netdev_priv(dev);
-	if (NULL == adapter) {
+	if (!adapter) {
 		EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
 		EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
 			   "%s: EPPING adapter context is Null", __func__);
 			   "%s: EPPING adapter context is Null", __func__);
 		goto end;
 		goto end;
@@ -113,7 +113,7 @@ static void epping_tx_queue_timeout(struct net_device *dev)
 	epping_adapter_t *adapter;
 	epping_adapter_t *adapter;
 
 
 	adapter = netdev_priv(dev);
 	adapter = netdev_priv(dev);
-	if (NULL == adapter) {
+	if (!adapter) {
 		EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
 		EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
 			   "%s: EPPING adapter context is Null", __func__);
 			   "%s: EPPING adapter context is Null", __func__);
 		goto end;
 		goto end;
@@ -142,7 +142,7 @@ static netdev_tx_t epping_hard_start_xmit(struct sk_buff *skb,
 	int ret = 0;
 	int ret = 0;
 
 
 	adapter = netdev_priv(dev);
 	adapter = netdev_priv(dev);
-	if (NULL == adapter) {
+	if (!adapter) {
 		EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
 		EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
 			   "%s: EPPING adapter context is Null", __func__);
 			   "%s: EPPING adapter context is Null", __func__);
 		kfree_skb(skb);
 		kfree_skb(skb);
@@ -159,7 +159,7 @@ static struct net_device_stats *epping_get_stats(struct net_device *dev)
 {
 {
 	epping_adapter_t *adapter = netdev_priv(dev);
 	epping_adapter_t *adapter = netdev_priv(dev);
 
 
-	if (NULL == adapter) {
+	if (!adapter) {
 		EPPING_LOG(QDF_TRACE_LEVEL_ERROR, "%s: adapter = NULL",
 		EPPING_LOG(QDF_TRACE_LEVEL_ERROR, "%s: adapter = NULL",
 			   __func__);
 			   __func__);
 		return NULL;
 		return NULL;
@@ -174,7 +174,7 @@ static int epping_ndev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 	int ret = 0;
 	int ret = 0;
 
 
 	adapter = netdev_priv(dev);
 	adapter = netdev_priv(dev);
-	if (NULL == adapter) {
+	if (!adapter) {
 		EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
 		EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
 			   "%s: EPPING adapter context is Null", __func__);
 			   "%s: EPPING adapter context is Null", __func__);
 		ret = -ENODEV;
 		ret = -ENODEV;
@@ -363,7 +363,7 @@ epping_adapter_t *epping_add_adapter(epping_context_t *pEpping_ctx,
 			   NET_NAME_UNKNOWN,
 			   NET_NAME_UNKNOWN,
 #endif
 #endif
 			   ether_setup);
 			   ether_setup);
-	if (dev == NULL) {
+	if (!dev) {
 		EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
 		EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
 			   "%s: Cannot allocate epping_adapter_t\n", __func__);
 			   "%s: Cannot allocate epping_adapter_t\n", __func__);
 		return NULL;
 		return NULL;

+ 3 - 3
utils/fwlog/dbglog_host.c

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
  *
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
  * any purpose with or without fee is hereby granted, provided that the
@@ -1505,7 +1505,7 @@ static int dbglog_print_raw_data(uint32_t *buffer, uint32_t length)
 skip_args_processing:
 skip_args_processing:
 			if (debugid < MAX_DBG_MSGS) {
 			if (debugid < MAX_DBG_MSGS) {
 				dbgidString = DBG_MSG_ARR[moduleid][debugid];
 				dbgidString = DBG_MSG_ARR[moduleid][debugid];
-				if (dbgidString != NULL) {
+				if (dbgidString) {
 					AR_DEBUG_PRINTF(ATH_DEBUG_INFO,
 					AR_DEBUG_PRINTF(ATH_DEBUG_INFO,
 							("fw:%s(%x %x):%s\n",
 							("fw:%s(%x %x):%s\n",
 							 dbgidString, timestamp,
 							 dbgidString, timestamp,
@@ -2053,7 +2053,7 @@ int dbglog_parse_debug_logs(ol_scn_t scn, uint8_t *data, uint32_t datalen)
 		if (moduleid >= WLAN_MODULE_ID_MAX)
 		if (moduleid >= WLAN_MODULE_ID_MAX)
 			return A_OK;
 			return A_OK;
 
 
-		if (mod_print[moduleid] == NULL) {
+		if (!mod_print[moduleid]) {
 			/*
 			/*
 			 * No module specific log registered
 			 * No module specific log registered
 			 * use the default handler
 			 * use the default handler

+ 5 - 5
utils/logging/src/wlan_logging_sock_svc.c

@@ -569,7 +569,7 @@ static int pktlog_send_per_pkt_stats_to_user(void)
 	while (!list_empty(&gwlan_logging.pkt_stat_filled_list)
 	while (!list_empty(&gwlan_logging.pkt_stat_filled_list)
 		&& !gwlan_logging.exit) {
 		&& !gwlan_logging.exit) {
 		skb_new = dev_alloc_skb(MAX_SKBMSG_LENGTH);
 		skb_new = dev_alloc_skb(MAX_SKBMSG_LENGTH);
-		if (skb_new == NULL) {
+		if (!skb_new) {
 			if (!rate_limit) {
 			if (!rate_limit) {
 				pr_err("%s: dev_alloc_skb() failed for msg size[%d] drop count = %u\n",
 				pr_err("%s: dev_alloc_skb() failed for msg size[%d] drop count = %u\n",
 					__func__, MAX_SKBMSG_LENGTH,
 					__func__, MAX_SKBMSG_LENGTH,
@@ -645,7 +645,7 @@ static int send_filled_buffers_to_user(void)
 	       && !gwlan_logging.exit) {
 	       && !gwlan_logging.exit) {
 
 
 		skb = dev_alloc_skb(MAX_LOGMSG_LENGTH);
 		skb = dev_alloc_skb(MAX_LOGMSG_LENGTH);
-		if (skb == NULL) {
+		if (!skb) {
 			if (!rate_limit) {
 			if (!rate_limit) {
 				pr_err
 				pr_err
 					("%s: dev_alloc_skb() failed for msg size[%d] drop count = %u\n",
 					("%s: dev_alloc_skb() failed for msg size[%d] drop count = %u\n",
@@ -671,7 +671,7 @@ static int send_filled_buffers_to_user(void)
 		tot_msg_len = NLMSG_SPACE(payload_len);
 		tot_msg_len = NLMSG_SPACE(payload_len);
 		nlh = nlmsg_put(skb, 0, nlmsg_seq++,
 		nlh = nlmsg_put(skb, 0, nlmsg_seq++,
 				ANI_NL_MSG_LOG, payload_len, NLM_F_REQUEST);
 				ANI_NL_MSG_LOG, payload_len, NLM_F_REQUEST);
-		if (NULL == nlh) {
+		if (!nlh) {
 			spin_lock_irqsave(&gwlan_logging.spin_lock, flags);
 			spin_lock_irqsave(&gwlan_logging.spin_lock, flags);
 			list_add_tail(&plog_msg->node,
 			list_add_tail(&plog_msg->node,
 				      &gwlan_logging.free_list);
 				      &gwlan_logging.free_list);
@@ -980,7 +980,7 @@ int wlan_logging_sock_init_svc(void)
 
 
 	for (i = 0; i < MAX_PKTSTATS_BUFF; i++) {
 	for (i = 0; i < MAX_PKTSTATS_BUFF; i++) {
 		gpkt_stats_buffers[i].skb = dev_alloc_skb(MAX_PKTSTATS_LENGTH);
 		gpkt_stats_buffers[i].skb = dev_alloc_skb(MAX_PKTSTATS_LENGTH);
-		if (gpkt_stats_buffers[i].skb == NULL) {
+		if (!gpkt_stats_buffers[i].skb) {
 			pr_err("%s: Memory alloc failed for skb", __func__);
 			pr_err("%s: Memory alloc failed for skb", __func__);
 			/* free previously allocated skb and return */
 			/* free previously allocated skb and return */
 			for (j = 0; j < i ; j++)
 			for (j = 0; j < i ; j++)
@@ -1235,7 +1235,7 @@ void wlan_pkt_stats_to_logger_thread(void *pl_hdr, void *pkt_dump, void *data)
 
 
 	pktlog_hdr = (struct ath_pktlog_hdr *)pl_hdr;
 	pktlog_hdr = (struct ath_pktlog_hdr *)pl_hdr;
 
 
-	if (pktlog_hdr == NULL) {
+	if (!pktlog_hdr) {
 		pr_err("%s : Invalid pkt_stats_header\n", __func__);
 		pr_err("%s : Invalid pkt_stats_header\n", __func__);
 		return;
 		return;
 	}
 	}

+ 6 - 6
utils/nlink/src/wlan_nlink_srv.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
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
  * any purpose with or without fee is hereby granted, provided that the
@@ -195,7 +195,7 @@ int nl_srv_unregister(tWlanNlModTypes msg_type, nl_srv_msg_callback msg_handler)
 		return ret;
 		return ret;
 
 
 	if ((msg_type >= WLAN_NL_MSG_BASE) && (msg_type < WLAN_NL_MSG_MAX) &&
 	if ((msg_type >= WLAN_NL_MSG_BASE) && (msg_type < WLAN_NL_MSG_MAX) &&
-	    msg_handler != NULL) {
+	    msg_handler) {
 		ret = cnss_logger_event_unregister(radio_idx, msg_type,
 		ret = cnss_logger_event_unregister(radio_idx, msg_type,
 						   msg_handler);
 						   msg_handler);
 	} else {
 	} else {
@@ -226,7 +226,7 @@ int nl_srv_register(tWlanNlModTypes msg_type, nl_srv_msg_callback msg_handler)
 		return ret;
 		return ret;
 
 
 	if ((msg_type >= WLAN_NL_MSG_BASE) && (msg_type < WLAN_NL_MSG_MAX) &&
 	if ((msg_type >= WLAN_NL_MSG_BASE) && (msg_type < WLAN_NL_MSG_MAX) &&
-	    msg_handler != NULL) {
+	    msg_handler) {
 		ret = cnss_logger_event_register(radio_idx, msg_type,
 		ret = cnss_logger_event_register(radio_idx, msg_type,
 						 msg_handler);
 						 msg_handler);
 	} else {
 	} else {
@@ -508,7 +508,7 @@ int nl_srv_init(void *wiphy)
 	nl_srv_sock = netlink_kernel_create(&init_net, WLAN_NLINK_PROTO_FAMILY,
 	nl_srv_sock = netlink_kernel_create(&init_net, WLAN_NLINK_PROTO_FAMILY,
 					    &cfg);
 					    &cfg);
 
 
-	if (nl_srv_sock != NULL) {
+	if (nl_srv_sock) {
 		memset(nl_srv_msg_handler, 0, sizeof(nl_srv_msg_handler));
 		memset(nl_srv_msg_handler, 0, sizeof(nl_srv_msg_handler));
 	} else {
 	} else {
 		QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
 		QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
@@ -540,7 +540,7 @@ int nl_srv_register(tWlanNlModTypes msg_type, nl_srv_msg_callback msg_handler)
 	int retcode = 0;
 	int retcode = 0;
 
 
 	if ((msg_type >= WLAN_NL_MSG_BASE) && (msg_type < WLAN_NL_MSG_MAX) &&
 	if ((msg_type >= WLAN_NL_MSG_BASE) && (msg_type < WLAN_NL_MSG_MAX) &&
-	    msg_handler != NULL) {
+	    msg_handler) {
 		nl_srv_msg_handler[msg_type - WLAN_NL_MSG_BASE] = msg_handler;
 		nl_srv_msg_handler[msg_type - WLAN_NL_MSG_BASE] = msg_handler;
 	} else {
 	} else {
 		QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_WARN,
 		QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_WARN,
@@ -708,7 +708,7 @@ static void nl_srv_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
 	type -= WLAN_NL_MSG_BASE;
 	type -= WLAN_NL_MSG_BASE;
 
 
 	/* dispatch to handler */
 	/* dispatch to handler */
-	if (nl_srv_msg_handler[type] != NULL) {
+	if (nl_srv_msg_handler[type]) {
 		(nl_srv_msg_handler[type])(skb);
 		(nl_srv_msg_handler[type])(skb);
 	} else {
 	} else {
 		QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_WARN,
 		QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_WARN,

+ 10 - 10
utils/pktlog/linux_ac.c

@@ -113,7 +113,7 @@ int pktlog_alloc_buf(struct hif_opaque_softc *scn)
 	page_cnt = (sizeof(*(pl_info->buf)) + pl_info->buf_size) / PAGE_SIZE;
 	page_cnt = (sizeof(*(pl_info->buf)) + pl_info->buf_size) / PAGE_SIZE;
 
 
 	qdf_spin_lock_bh(&pl_info->log_lock);
 	qdf_spin_lock_bh(&pl_info->log_lock);
-	if (pl_info->buf != NULL) {
+	if (pl_info->buf) {
 		qdf_spin_unlock_bh(&pl_info->log_lock);
 		qdf_spin_unlock_bh(&pl_info->log_lock);
 		printk(PKTLOG_TAG "Buffer is already in use\n");
 		printk(PKTLOG_TAG "Buffer is already in use\n");
 		return -EINVAL;
 		return -EINVAL;
@@ -121,7 +121,7 @@ int pktlog_alloc_buf(struct hif_opaque_softc *scn)
 	qdf_spin_unlock_bh(&pl_info->log_lock);
 	qdf_spin_unlock_bh(&pl_info->log_lock);
 
 
 	buffer = vmalloc((page_cnt + 2) * PAGE_SIZE);
 	buffer = vmalloc((page_cnt + 2) * PAGE_SIZE);
-	if (buffer == NULL) {
+	if (!buffer) {
 		printk(PKTLOG_TAG
 		printk(PKTLOG_TAG
 		       "%s: Unable to allocate buffer "
 		       "%s: Unable to allocate buffer "
 		       "(%d pages)\n", __func__, page_cnt);
 		       "(%d pages)\n", __func__, page_cnt);
@@ -140,7 +140,7 @@ int pktlog_alloc_buf(struct hif_opaque_softc *scn)
 	}
 	}
 
 
 	qdf_spin_lock_bh(&pl_info->log_lock);
 	qdf_spin_lock_bh(&pl_info->log_lock);
-	if (pl_info->buf != NULL)
+	if (pl_info->buf)
 		pktlog_release_buf(scn);
 		pktlog_release_buf(scn);
 
 
 	pl_info->buf =  buffer;
 	pl_info->buf =  buffer;
@@ -418,9 +418,9 @@ static int pktlog_attach(struct hif_opaque_softc *scn)
 	/* Allocate pktlog dev for later use */
 	/* Allocate pktlog dev for later use */
 	pl_dev = get_pktlog_handle();
 	pl_dev = get_pktlog_handle();
 
 
-	if (pl_dev != NULL) {
+	if (pl_dev) {
 		pl_info_lnx = kmalloc(sizeof(*pl_info_lnx), GFP_KERNEL);
 		pl_info_lnx = kmalloc(sizeof(*pl_info_lnx), GFP_KERNEL);
-		if (pl_info_lnx == NULL) {
+		if (!pl_info_lnx) {
 			QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
 			QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
 				 "%s: Allocation failed for pl_info",
 				 "%s: Allocation failed for pl_info",
 				 __func__);
 				 __func__);
@@ -454,7 +454,7 @@ static int pktlog_attach(struct hif_opaque_softc *scn)
 			g_pktlog_pde, &pktlog_fops,
 			g_pktlog_pde, &pktlog_fops,
 			&pl_info_lnx->info);
 			&pl_info_lnx->info);
 
 
-	if (proc_entry == NULL) {
+	if (!proc_entry) {
 		printk(PKTLOG_TAG "%s: create_proc_entry failed for %s\n",
 		printk(PKTLOG_TAG "%s: create_proc_entry failed for %s\n",
 				__func__, proc_name);
 				__func__, proc_name);
 		goto attach_fail1;
 		goto attach_fail1;
@@ -701,7 +701,7 @@ pktlog_read_proc_entry(char *buf, size_t nbytes, loff_t *ppos,
 
 
 	*read_complete = false;
 	*read_complete = false;
 
 
-	if (log_buf == NULL) {
+	if (!log_buf) {
 		*read_complete = true;
 		*read_complete = true;
 		qdf_spin_unlock_bh(&pl_info->log_lock);
 		qdf_spin_unlock_bh(&pl_info->log_lock);
 		return 0;
 		return 0;
@@ -842,7 +842,7 @@ __pktlog_read(struct file *file, char *buf, size_t nbytes, loff_t *ppos)
 	qdf_spin_lock_bh(&pl_info->log_lock);
 	qdf_spin_lock_bh(&pl_info->log_lock);
 	log_buf = pl_info->buf;
 	log_buf = pl_info->buf;
 
 
-	if (log_buf == NULL) {
+	if (!log_buf) {
 		qdf_spin_unlock_bh(&pl_info->log_lock);
 		qdf_spin_unlock_bh(&pl_info->log_lock);
 		return 0;
 		return 0;
 	}
 	}
@@ -1005,7 +1005,7 @@ int pktlogmod_init(void *context)
 	/* create the proc directory entry */
 	/* create the proc directory entry */
 	g_pktlog_pde = proc_mkdir(PKTLOG_PROC_DIR, NULL);
 	g_pktlog_pde = proc_mkdir(PKTLOG_PROC_DIR, NULL);
 
 
-	if (g_pktlog_pde == NULL) {
+	if (!g_pktlog_pde) {
 		printk(PKTLOG_TAG "%s: proc_mkdir failed\n", __func__);
 		printk(PKTLOG_TAG "%s: proc_mkdir failed\n", __func__);
 		return -EPERM;
 		return -EPERM;
 	}
 	}
@@ -1028,7 +1028,7 @@ attach_fail:
 
 
 void pktlogmod_exit(void *context)
 void pktlogmod_exit(void *context)
 {
 {
-	if (g_pktlog_pde == NULL)
+	if (!g_pktlog_pde)
 		return;
 		return;
 
 
 	pktlog_detach((struct hif_opaque_softc *)context);
 	pktlog_detach((struct hif_opaque_softc *)context);

+ 4 - 4
utils/pktlog/pktlog_ac.c

@@ -595,7 +595,7 @@ void pktlog_init(struct hif_opaque_softc *scn)
 	struct pktlog_dev_t *pl_dev = get_pktlog_handle();
 	struct pktlog_dev_t *pl_dev = get_pktlog_handle();
 	struct ath_pktlog_info *pl_info;
 	struct ath_pktlog_info *pl_info;
 
 
-	if (pl_dev == NULL || pl_dev->pl_info == NULL) {
+	if (!pl_dev || !pl_dev->pl_info) {
 		qdf_print("pl_dev or pl_info is invalid");
 		qdf_print("pl_dev or pl_info is invalid");
 		return;
 		return;
 	}
 	}
@@ -678,7 +678,7 @@ static int __pktlog_enable(struct hif_opaque_softc *scn, int32_t log_state,
 	}
 	}
 
 
 	if (!pl_dev->tgt_pktlog_alloced) {
 	if (!pl_dev->tgt_pktlog_alloced) {
-		if (pl_info->buf == NULL) {
+		if (!pl_info->buf) {
 			error = pktlog_alloc_buf(scn);
 			error = pktlog_alloc_buf(scn);
 
 
 			if (error != 0) {
 			if (error != 0) {
@@ -846,7 +846,7 @@ static int __pktlog_setsize(struct hif_opaque_softc *scn, int32_t size)
 	}
 	}
 
 
 	qdf_spin_lock_bh(&pl_info->log_lock);
 	qdf_spin_lock_bh(&pl_info->log_lock);
-	if (pl_info->buf != NULL) {
+	if (pl_info->buf) {
 		if (pl_dev->is_pktlog_cb_subscribed &&
 		if (pl_dev->is_pktlog_cb_subscribed &&
 			wdi_pktlog_unsubscribe(pdev, pl_info->log_state)) {
 			wdi_pktlog_unsubscribe(pdev, pl_info->log_state)) {
 			pl_info->curr_pkt_state =
 			pl_info->curr_pkt_state =
@@ -934,7 +934,7 @@ int pktlog_clearbuff(struct hif_opaque_softc *scn, bool clear_buff)
 		return -EINVAL;
 		return -EINVAL;
 	}
 	}
 
 
-	if (pl_info->buf != NULL) {
+	if (pl_info->buf) {
 		if (pl_info->buf_size > 0) {
 		if (pl_info->buf_size > 0) {
 			qdf_print("%s: pktlog buffer is cleared.", __func__);
 			qdf_print("%s: pktlog buffer is cleared.", __func__);
 			memset(pl_info->buf, 0, pl_info->buf_size);
 			memset(pl_info->buf, 0, pl_info->buf_size);

+ 2 - 2
utils/pktlog/pktlog_internal.c

@@ -1424,7 +1424,7 @@ int process_rx_desc_remote(void *pdev, void *data)
 	rxstat_log.rx_desc = (void *)pktlog_getbuf(pl_dev, pl_info,
 	rxstat_log.rx_desc = (void *)pktlog_getbuf(pl_dev, pl_info,
 						  log_size, &pl_hdr);
 						  log_size, &pl_hdr);
 
 
-	if (rxstat_log.rx_desc == NULL) {
+	if (!rxstat_log.rx_desc) {
 		QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_DEBUG,
 		QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_DEBUG,
 				"%s: Rx descriptor is NULL", __func__);
 				"%s: Rx descriptor is NULL", __func__);
 		return -EFAULT;
 		return -EFAULT;
@@ -1456,7 +1456,7 @@ process_pktlog_lite(void *context, void *log_data, uint16_t log_type)
 	log_size = pl_hdr.size;
 	log_size = pl_hdr.size;
 	rxstat_log.rx_desc = (void *)pktlog_getbuf(pl_dev, pl_info,
 	rxstat_log.rx_desc = (void *)pktlog_getbuf(pl_dev, pl_info,
 						   log_size, &pl_hdr);
 						   log_size, &pl_hdr);
-	if (rxstat_log.rx_desc == NULL) {
+	if (!rxstat_log.rx_desc) {
 		QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_DEBUG,
 		QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_DEBUG,
 			"%s: Rx descriptor is NULL", __func__);
 			"%s: Rx descriptor is NULL", __func__);
 		return -EFAULT;
 		return -EFAULT;

+ 3 - 3
utils/ptt/src/wlan_ptt_sock_svc.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
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
  * any purpose with or without fee is hereby granted, provided that the
@@ -134,7 +134,7 @@ int ptt_sock_send_msg_to_app(tAniHdr *wmsg, int radio, int src_mod, int pid)
 	payload_len = wmsg_length + sizeof(wnl->radio) + sizeof(*wmsg);
 	payload_len = wmsg_length + sizeof(wnl->radio) + sizeof(*wmsg);
 	tot_msg_len = NLMSG_SPACE(payload_len);
 	tot_msg_len = NLMSG_SPACE(payload_len);
 	skb = dev_alloc_skb(tot_msg_len);
 	skb = dev_alloc_skb(tot_msg_len);
-	if (skb  == NULL) {
+	if (!skb) {
 		PTT_TRACE(QDF_TRACE_LEVEL_ERROR,
 		PTT_TRACE(QDF_TRACE_LEVEL_ERROR,
 			  "%s: dev_alloc_skb() failed for msg size[%d]\n",
 			  "%s: dev_alloc_skb() failed for msg size[%d]\n",
 			  __func__, tot_msg_len);
 			  __func__, tot_msg_len);
@@ -143,7 +143,7 @@ int ptt_sock_send_msg_to_app(tAniHdr *wmsg, int radio, int src_mod, int pid)
 	nlh =
 	nlh =
 		nlmsg_put(skb, pid, nlmsg_seq++, src_mod, payload_len,
 		nlmsg_put(skb, pid, nlmsg_seq++, src_mod, payload_len,
 			  NLM_F_REQUEST);
 			  NLM_F_REQUEST);
-	if (NULL == nlh) {
+	if (!nlh) {
 		PTT_TRACE(QDF_TRACE_LEVEL_ERROR,
 		PTT_TRACE(QDF_TRACE_LEVEL_ERROR,
 			  "%s: nlmsg_put() failed for msg size[%d]\n", __func__,
 			  "%s: nlmsg_put() failed for msg size[%d]\n", __func__,
 			  tot_msg_len);
 			  tot_msg_len);