qcacmn: Fix kernel checkpatch warnings in QDF

Fix kernel checkpatch warnings in QDF.

Change-Id: Id2f54c6c436bde55b040012fbbe9922cb177461e
CRs-Fixed: 2028128
diff --git a/hif/src/ce/ce_internal.h b/hif/src/ce/ce_internal.h
index 36b7b9a..bce3ee0 100644
--- a/hif/src/ce/ce_internal.h
+++ b/hif/src/ce/ce_internal.h
@@ -97,7 +97,7 @@
 	unsigned int high_water_mark_nentries;
 	void *srng_ctx;
 	void **per_transfer_context;
-	OS_DMA_MEM_CONTEXT(ce_dmacontext) /* OS Specific DMA context */
+	OS_DMA_MEM_CONTEXT(ce_dmacontext); /* OS Specific DMA context */
 };
 
 /* Copy Engine internal state */
diff --git a/hif/src/pcie/if_pci.h b/hif/src/pcie/if_pci.h
index b5707ab..7016fe3 100644
--- a/hif/src/pcie/if_pci.h
+++ b/hif/src/pcie/if_pci.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -103,7 +103,7 @@
 struct hif_msi_info {
 	void *magic;
 	dma_addr_t magic_da;
-	OS_DMA_MEM_CONTEXT(dmacontext)
+	OS_DMA_MEM_CONTEXT(dmacontext);
 };
 
 struct hif_pci_softc {
diff --git a/qdf/inc/osdep.h b/qdf/inc/osdep.h
index 24c0601..70cc94c 100644
--- a/qdf/inc/osdep.h
+++ b/qdf/inc/osdep.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -144,7 +144,7 @@
 #define OS_FREE(_p)                     qdf_mem_free(_p)
 
 #define OS_DMA_MEM_CONTEXT(context)	    \
-		dma_addr_t context;
+		dma_addr_t context
 
 #define OS_GET_DMA_MEM_CONTEXT(var, field)  \
 		&(var->field)
diff --git a/qdf/inc/qdf_lock.h b/qdf/inc/qdf_lock.h
index 6319fb3..d8f2bba 100644
--- a/qdf/inc/qdf_lock.h
+++ b/qdf/inc/qdf_lock.h
@@ -296,6 +296,7 @@
 static inline int qdf_spin_trylock_bh(qdf_spinlock_t *lock, const char *func)
 {
 	int trylock_return;
+
 	BEFORE_TRYLOCK(lock);
 	trylock_return = __qdf_spin_trylock_bh(&lock->lock);
 	AFTER_TRYLOCK(lock, trylock_return, func);
diff --git a/qdf/inc/qdf_mc_timer.h b/qdf/inc/qdf_mc_timer.h
index c63f292..e8202d5 100644
--- a/qdf/inc/qdf_mc_timer.h
+++ b/qdf/inc/qdf_mc_timer.h
@@ -50,7 +50,8 @@
 
 /* Type declarations */
 /* qdf Timer callback function prototype (well, actually a prototype for
-   a pointer to this callback function) */
+ * a pointer to this callback function)
+ */
 typedef void (*qdf_mc_timer_callback_t)(void *user_data);
 
 typedef enum {
@@ -250,10 +251,10 @@
 unsigned long qdf_mc_timer_get_system_time(void);
 
 /**
-  * qdf_get_monotonic_boottime_ns() - Get kernel boottime in ns
-  *
-  * Return: kernel boottime in nano sec
-  */
+ * qdf_get_monotonic_boottime_ns() - Get kernel boottime in ns
+ *
+ * Return: kernel boottime in nano sec
+ */
 s64 qdf_get_monotonic_boottime_ns(void);
 
 /**
diff --git a/qdf/inc/qdf_nbuf.h b/qdf/inc/qdf_nbuf.h
index 8958511..408a98e 100644
--- a/qdf/inc/qdf_nbuf.h
+++ b/qdf/inc/qdf_nbuf.h
@@ -761,6 +761,7 @@
 		uint32_t line_num)
 {
 	qdf_nbuf_t net_buf;
+
 	net_buf = __qdf_nbuf_alloc(osdev, size, reserve, align, prio);
 
 	/* Store SKB in internal QDF tracking table */
@@ -852,7 +853,6 @@
 
 static inline void qdf_net_buf_debug_release_skb(qdf_nbuf_t net_buf)
 {
-	return;
 }
 
 /* Nbuf allocation rouines */
diff --git a/qdf/inc/qdf_util.h b/qdf/inc/qdf_util.h
index 6e79826..b5b19f2 100644
--- a/qdf/inc/qdf_util.h
+++ b/qdf/inc/qdf_util.h
@@ -218,6 +218,7 @@
 static inline bool qdf_is_macaddr_zero(struct qdf_mac_addr *mac_addr)
 {
 	struct qdf_mac_addr zero_mac_addr = QDF_MAC_ADDR_ZERO_INITIALIZER;
+
 	return qdf_is_macaddr_equal(mac_addr, &zero_mac_addr);
 }
 
@@ -508,6 +509,7 @@
 static inline int qdf_get_pwr2(int value)
 {
 	int log2;
+
 	if (QDF_IS_PWR2(value))
 		return value;
 
diff --git a/qdf/linux/src/i_osdep.h b/qdf/linux/src/i_osdep.h
index 31e2596..553de1f 100644
--- a/qdf/linux/src/i_osdep.h
+++ b/qdf/linux/src/i_osdep.h
@@ -60,10 +60,7 @@
 #undef spin_unlock
 #undef spin_trylock
 
-#define spin_lock(x) \
-	do { \
-		spin_lock_bh(x); \
-	} while (0)
+#define spin_lock(x)  spin_lock_bh(x)
 
 #define spin_unlock(x) \
 	do { \
@@ -136,6 +133,7 @@
 	int32_t num_queued;
 	int32_t mesg_len;
 	uint8_t *mesg_queue_buf;
+
 	STAILQ_HEAD(, _os_mesg_t) mesg_head;
 	STAILQ_HEAD(, _os_mesg_t) mesg_free_head;
 	spinlock_t lock;
diff --git a/qdf/linux/src/i_qdf_lock.h b/qdf/linux/src/i_qdf_lock.h
index 96acd6b..eea7867 100644
--- a/qdf/linux/src/i_qdf_lock.h
+++ b/qdf/linux/src/i_qdf_lock.h
@@ -168,6 +168,7 @@
 						  unsigned long timeout)
 {
 	unsigned long jiffie_val = msecs_to_jiffies(timeout);
+
 	return down_timeout(m, jiffie_val);
 }
 
@@ -258,16 +259,15 @@
  */
 static inline int __qdf_spin_trylock_bh(__qdf_spinlock_t *lock)
 {
-	if (likely(irqs_disabled() || in_irq() || in_softirq())) {
+	if (likely(irqs_disabled() || in_irq() || in_softirq()))
 		return spin_trylock(&lock->spinlock);
-	} else {
-		if (spin_trylock_bh(&lock->spinlock)) {
-			lock->flags |= QDF_LINUX_UNLOCK_BH;
-			return 1;
-		} else {
-			return 0;
-		}
+
+	if (spin_trylock_bh(&lock->spinlock)) {
+		lock->flags |= QDF_LINUX_UNLOCK_BH;
+		return 1;
 	}
+
+	return 0;
 }
 
 /**
diff --git a/qdf/linux/src/i_qdf_mem.h b/qdf/linux/src/i_qdf_mem.h
index de945da..1d0bc7e 100644
--- a/qdf/linux/src/i_qdf_mem.h
+++ b/qdf/linux/src/i_qdf_mem.h
@@ -92,6 +92,7 @@
 	size_t elem_size;
 	void *pool_mem;
 	u_int32_t mem_size;
+
 	STAILQ_HEAD(, mempool_elem) free_list;
 	spinlock_t lock;
 	u_int32_t max_elem;
@@ -180,7 +181,7 @@
 void *__qdf_mempool_alloc(qdf_device_t osdev, __qdf_mempool_t pool);
 void __qdf_mempool_free(qdf_device_t osdev, __qdf_mempool_t pool, void *buf);
 
-#define __qdf_mempool_elem_size(_pool) ((_pool)->elem_size);
+#define __qdf_mempool_elem_size(_pool) ((_pool)->elem_size)
 #endif
 
 /**
diff --git a/qdf/linux/src/i_qdf_module.h b/qdf/linux/src/i_qdf_module.h
index 674b405..67651f3 100644
--- a/qdf/linux/src/i_qdf_module.h
+++ b/qdf/linux/src/i_qdf_module.h
@@ -53,7 +53,7 @@
 
 #define __qdf_virt_module_exit(_x)  module_exit(_x)
 
-#define __qdf_virt_module_name(_name) MODULE_LICENSE("Proprietary");
+#define __qdf_virt_module_name(_name) MODULE_LICENSE("Proprietary")
 
 #define __qdf_export_symbol(_sym) EXPORT_SYMBOL(_sym)
 
diff --git a/qdf/linux/src/i_qdf_nbuf.h b/qdf/linux/src/i_qdf_nbuf.h
index 54d2379..06c96a4 100644
--- a/qdf/linux/src/i_qdf_nbuf.h
+++ b/qdf/linux/src/i_qdf_nbuf.h
@@ -427,9 +427,7 @@
 	(QDF_NBUF_CB_TX_NUM_EXTRA_FRAGS(skb) + 1)
 
 #define __qdf_nbuf_reset_num_frags(skb) \
-	do { \
-		QDF_NBUF_CB_TX_NUM_EXTRA_FRAGS(skb) = 0; \
-	} while (0)
+	(QDF_NBUF_CB_TX_NUM_EXTRA_FRAGS(skb) = 0)
 
 /**
  *   end of nbuf->cb access macros
@@ -441,9 +439,7 @@
 #define __qdf_nbuf_mapped_paddr_get(skb) QDF_NBUF_CB_PADDR(skb)
 
 #define __qdf_nbuf_mapped_paddr_set(skb, paddr)	\
-	do { \
-		QDF_NBUF_CB_PADDR(skb) = paddr; \
-	} while (0)
+	(QDF_NBUF_CB_PADDR(skb) = paddr)
 
 #define __qdf_nbuf_frag_push_head(					\
 	skb, frag_len, frag_vaddr, frag_paddr)				\
@@ -489,9 +485,7 @@
 	} while (0)
 
 #define __qdf_nbuf_set_vdev_ctx(skb, vdev_ctx) \
-	do { \
-		QDF_NBUF_CB_TX_VDEV_CTX((skb)) = (vdev_ctx); \
-	} while (0)
+	(QDF_NBUF_CB_TX_VDEV_CTX((skb)) = (vdev_ctx))
 
 #define __qdf_nbuf_get_vdev_ctx(skb) \
 	QDF_NBUF_CB_TX_VDEV_CTX((skb))
@@ -514,9 +508,7 @@
 		 QDF_NBUF_CB_TX_FTYPE((skb))
 
 #define __qdf_nbuf_set_chfrag_start(skb, val) \
-	do { \
-		(QDF_NBUF_CB_TX_EXTRA_FRAG_FLAGS_CHFRAG_START((skb))) = val; \
-	} while (0)
+	((QDF_NBUF_CB_TX_EXTRA_FRAG_FLAGS_CHFRAG_START((skb))) = val)
 
 #define __qdf_nbuf_is_chfrag_start(skb) \
 	(QDF_NBUF_CB_TX_EXTRA_FRAG_FLAGS_CHFRAG_START((skb)))
@@ -530,17 +522,13 @@
 	(QDF_NBUF_CB_TX_EXTRA_FRAG_FLAGS_CHFRAG_CONT((skb)))
 
 #define __qdf_nbuf_set_chfrag_end(skb, val) \
-	do { \
-		(QDF_NBUF_CB_TX_EXTRA_FRAG_FLAGS_CHFRAG_END((skb))) = val; \
-	} while (0)
+	((QDF_NBUF_CB_TX_EXTRA_FRAG_FLAGS_CHFRAG_END((skb))) = val)
 
 #define __qdf_nbuf_is_chfrag_end(skb) \
 	(QDF_NBUF_CB_TX_EXTRA_FRAG_FLAGS_CHFRAG_END((skb)))
 
-#define __qdf_nbuf_trace_set_proto_type(skb, proto_type)	\
-	do { \
-		QDF_NBUF_CB_TX_PROTO_TYPE(skb) = (proto_type); \
-	} while (0)
+#define __qdf_nbuf_trace_set_proto_type(skb, proto_type)  \
+	(QDF_NBUF_CB_TX_PROTO_TYPE(skb) = (proto_type))
 
 #define __qdf_nbuf_trace_get_proto_type(skb) \
 	QDF_NBUF_CB_TX_PROTO_TYPE(skb)
@@ -548,25 +536,19 @@
 #define __qdf_nbuf_data_attr_get(skb)		\
 	QDF_NBUF_CB_TX_DATA_ATTR(skb)
 #define __qdf_nbuf_data_attr_set(skb, data_attr) \
-	do { \
-		QDF_NBUF_CB_TX_DATA_ATTR(skb) = (data_attr); \
-	} while (0)
+	(QDF_NBUF_CB_TX_DATA_ATTR(skb) = (data_attr))
 
 #define __qdf_nbuf_ipa_owned_get(skb) \
 	QDF_NBUF_CB_TX_IPA_OWNED(skb)
 
 #define __qdf_nbuf_ipa_owned_set(skb) \
-	do { \
-		QDF_NBUF_CB_TX_IPA_OWNED(skb) = 1; \
-	} while (0)
+	(QDF_NBUF_CB_TX_IPA_OWNED(skb) = 1)
 
 #define __qdf_nbuf_ipa_priv_get(skb)	\
 	QDF_NBUF_CB_TX_IPA_PRIV(skb)
 
 #define __qdf_nbuf_ipa_priv_set(skb, priv) \
-	do { \
-		QDF_NBUF_CB_TX_IPA_PRIV(skb) = (priv); \
-	} while (0)
+	(QDF_NBUF_CB_TX_IPA_PRIV(skb) = (priv))
 
 /**
  * __qdf_nbuf_num_frags_init() - init extra frags
@@ -1138,9 +1120,7 @@
 }
 
 #define __qdf_nbuf_set_tx_htt2_frm(skb, candi) \
-	do { \
-		QDF_NBUF_CB_TX_HL_HTT2_FRM(skb) = (candi); \
-	} while (0)
+	(QDF_NBUF_CB_TX_HL_HTT2_FRM(skb) = (candi))
 
 #define __qdf_nbuf_get_tx_htt2_frm(skb)	\
 	QDF_NBUF_CB_TX_HL_HTT2_FRM(skb)
@@ -1449,7 +1429,6 @@
 static inline void
 __qdf_nbuf_set_send_complete_flag(struct sk_buff *skb, bool flag)
 {
-	return;
 }
 
 /**
@@ -1608,7 +1587,8 @@
  * @skb: sk buff
  *
  * Return: TCP MSS size
- * */
+ *
+ */
 static inline size_t __qdf_nbuf_tcp_tso_size(struct sk_buff *skb)
 {
 	return skb_shinfo(skb)->gso_size;
@@ -1659,6 +1639,7 @@
 __qdf_nbuf_get_rx_info(__qdf_nbuf_t nbuf)
 {
 	uint8_t offset = sizeof(struct qdf_nbuf_cb);
+
 	return (void *)((uint8_t *)(nbuf->cb) + offset);
 }
 
@@ -1786,9 +1767,9 @@
 static inline void __qdf_invalidate_range(void *start, void *end)
 {
 	/* TODO figure out how to invalidate cache on x86 and other
-	   non-MSM platform */
+	 * non-MSM platform
+	 */
 	pr_err("Cache invalidate not yet implemneted for non-MSM platforms\n");
-	return;
 }
 #endif
 
diff --git a/qdf/linux/src/i_qdf_util.h b/qdf/linux/src/i_qdf_util.h
index 771db72..970d44b 100644
--- a/qdf/linux/src/i_qdf_util.h
+++ b/qdf/linux/src/i_qdf_util.h
@@ -56,7 +56,7 @@
 #endif
 
 #include <qdf_types.h>
-#include <asm/io.h>
+#include <linux/io.h>
 #include <asm/byteorder.h>
 
 #ifdef QCA_PARTNER_PLATFORM
@@ -320,6 +320,7 @@
 __qdf_get_totalramsize(void)
 {
 	struct sysinfo meminfo;
+
 	si_meminfo(&meminfo);
 	return MEMINFO_KB(meminfo.totalram);
 }
diff --git a/qdf/linux/src/qdf_defer.c b/qdf/linux/src/qdf_defer.c
index de3678b..9d61947 100644
--- a/qdf/linux/src/qdf_defer.c
+++ b/qdf/linux/src/qdf_defer.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -46,6 +46,7 @@
 void __qdf_defer_func(struct work_struct *work)
 {
 	__qdf_work_t *ctx = container_of(work, __qdf_work_t, work);
+
 	if (ctx->fn == NULL) {
 		QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
 			  "No callback registered !!");
diff --git a/qdf/linux/src/qdf_event.c b/qdf/linux/src/qdf_event.c
index 6dafcc8..f399831 100644
--- a/qdf/linux/src/qdf_event.c
+++ b/qdf/linux/src/qdf_event.c
@@ -248,6 +248,7 @@
 	timeout *= qdf_timer_get_multiplier();
 	if (timeout) {
 		long ret;
+
 		ret = wait_for_completion_timeout(&event->complete,
 						  msecs_to_jiffies(timeout));
 		if (0 >= ret)
diff --git a/qdf/linux/src/qdf_list.c b/qdf/linux/src/qdf_list.c
index 7d6df22..2a1fbd0 100644
--- a/qdf/linux/src/qdf_list.c
+++ b/qdf/linux/src/qdf_list.c
@@ -213,6 +213,7 @@
 QDF_STATUS qdf_list_peek_front(qdf_list_t *list, qdf_list_node_t **node2)
 {
 	struct list_head *listptr;
+
 	if (list_empty(&list->anchor))
 		return QDF_STATUS_E_EMPTY;
 
diff --git a/qdf/linux/src/qdf_lock.c b/qdf/linux/src/qdf_lock.c
index d51940c..987e9b7 100644
--- a/qdf/linux/src/qdf_lock.c
+++ b/qdf/linux/src/qdf_lock.c
@@ -151,14 +151,14 @@
 		lock->refcount++;
 		lock->state = LOCK_ACQUIRED;
 		return QDF_STATUS_SUCCESS;
-	} else {
-		/* lock is already destroyed */
-		QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
-			  "%s: Lock is already destroyed", __func__);
-		mutex_unlock(&lock->m_lock);
-		QDF_ASSERT(0);
-		return QDF_STATUS_E_FAILURE;
 	}
+
+	/* lock is already destroyed */
+	QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
+		  "%s: Lock is already destroyed", __func__);
+	mutex_unlock(&lock->m_lock);
+	QDF_ASSERT(0);
+	return QDF_STATUS_E_FAILURE;
 }
 EXPORT_SYMBOL(qdf_mutex_acquire);
 
@@ -504,8 +504,8 @@
 {
 	void *ol_sc;
 	int ret;
-	ol_sc = cds_get_context(QDF_MODULE_ID_HIF);
 
+	ol_sc = cds_get_context(QDF_MODULE_ID_HIF);
 	if (ol_sc == NULL) {
 		QDF_ASSERT(0);
 		QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
@@ -516,6 +516,7 @@
 	ret = hif_pm_runtime_allow_suspend(ol_sc, lock);
 	if (ret)
 		return QDF_STATUS_E_FAILURE;
+
 	return QDF_STATUS_SUCCESS;
 }
 EXPORT_SYMBOL(qdf_runtime_pm_allow_suspend);
@@ -801,8 +802,9 @@
 		__qdf_put_lock_cookie(&lock_cookies[i]);
 
 	/* stats must be allocated for the spinlock before the cookie,
-	   otherwise this qdf_lock_list_spinlock wouldnt get intialized
-	   propperly */
+	 * otherwise this qdf_lock_list_spinlock wouldnt get initialized
+	 * properly
+	 */
 	qdf_spinlock_create(&qdf_lock_list_spinlock);
 	qdf_atomic_init(&lock_cookie_get_failures);
 	qdf_atomic_init(&lock_cookie_untracked_num);
@@ -823,8 +825,9 @@
 }
 
 /* allocated separate memory in case the lock memory is freed without
-	   running the deinitialization code.  The cookie list will not be
-	   corrupted. */
+ * running the deinitialization code.  The cookie list will not be
+ * corrupted.
+ */
 void qdf_lock_stats_cookie_create(struct lock_stats *stats,
 				  const char *func, int line)
 {
@@ -832,6 +835,7 @@
 
 	if (cookie == NULL) {
 		int count;
+
 		qdf_atomic_inc(&lock_cookie_get_failures);
 		count = qdf_atomic_inc_return(&lock_cookie_untracked_num);
 		stats->cookie = (void *) DUMMY_LOCK_COOKIE;
diff --git a/qdf/linux/src/qdf_mc_timer.c b/qdf/linux/src/qdf_mc_timer.c
index c0d3d6f..f5bb757 100644
--- a/qdf/linux/src/qdf_mc_timer.c
+++ b/qdf/linux/src/qdf_mc_timer.c
@@ -93,9 +93,9 @@
 		persistent_timer_count--;
 		if (0 == persistent_timer_count) {
 			/* since the number of persistent timers has
-			   decreased from 1 to 0, the timer should allow
-			   sleep
-			  */
+			 * decreased from 1 to 0, the timer should allow
+			 * sleep
+			 */
 		}
 	}
 }
@@ -162,7 +162,6 @@
 {
 	qdf_list_create(&qdf_timer_list, 1000);
 	qdf_spinlock_create(&qdf_timer_list_lock);
-	return;
 }
 EXPORT_SYMBOL(qdf_mc_timer_manager_init);
 
@@ -705,6 +704,7 @@
 unsigned long qdf_mc_timer_get_system_time(void)
 {
 	struct timeval tv;
+
 	do_gettimeofday(&tv);
 	return tv.tv_sec * 1000 + tv.tv_usec / 1000;
 }
diff --git a/qdf/linux/src/qdf_mem.c b/qdf/linux/src/qdf_mem.c
index 33781e9..a894e46 100644
--- a/qdf/linux/src/qdf_mem.c
+++ b/qdf/linux/src/qdf_mem.c
@@ -838,6 +838,7 @@
 static void qdf_mem_debug_clean(void)
 {
 	uint32_t list_size;
+
 	list_size = qdf_list_size(&qdf_mem_list);
 	if (list_size) {
 		qdf_list_node_t *node;
@@ -861,7 +862,8 @@
 			if (QDF_STATUS_SUCCESS == qdf_status) {
 				mem_struct = (struct s_qdf_mem_struct *)node;
 				/* Take care to log only once multiple memory
-				   leaks from the same place */
+				 * leaks from the same place
+				 */
 				if (strcmp(prev_mleak_file,
 					mem_struct->file_name)
 				    || (prev_mleak_line_num !=
diff --git a/qdf/linux/src/qdf_nbuf.c b/qdf/linux/src/qdf_nbuf.c
index 9046934..c63d165 100644
--- a/qdf/linux/src/qdf_nbuf.c
+++ b/qdf/linux/src/qdf_nbuf.c
@@ -153,6 +153,7 @@
 	 * such as scan commands are not tracked
 	 */
 	uint8_t packet_type;
+
 	packet_type = QDF_NBUF_CB_TX_PACKET_TRACK(nbuf);
 
 	if ((packet_type != QDF_NBUF_TX_PKT_DATA_TRACK) &&
@@ -258,10 +259,9 @@
 
 	skb = dev_alloc_skb(size);
 
-	if (!skb) {
-		pr_info("ERROR:NBUF alloc failed\n");
+	if (!skb)
 		return NULL;
-	}
+
 	memset(skb->cb, 0x0, sizeof(skb->cb));
 
 	/*
@@ -331,6 +331,7 @@
 __qdf_nbuf_map(qdf_device_t osdev, struct sk_buff *skb, qdf_dma_dir_t dir)
 {
 	struct skb_shared_info *sh = skb_shinfo(skb);
+
 	qdf_assert((dir == QDF_DMA_TO_DEVICE)
 			|| (dir == QDF_DMA_FROM_DEVICE));
 
@@ -386,7 +387,7 @@
  *
  * Return: QDF_STATUS
  */
-#if defined(A_SIMOS_DEVHOST) || defined (HIF_USB)
+#if defined(A_SIMOS_DEVHOST) || defined(HIF_USB)
 QDF_STATUS
 __qdf_nbuf_map_single(qdf_device_t osdev, qdf_nbuf_t buf, qdf_dma_dir_t dir)
 {
@@ -422,11 +423,10 @@
  *
  * Return: none
  */
-#if defined(A_SIMOS_DEVHOST) || defined (HIF_USB)
+#if defined(A_SIMOS_DEVHOST) || defined(HIF_USB)
 void __qdf_nbuf_unmap_single(qdf_device_t osdev, qdf_nbuf_t buf,
 				qdf_dma_dir_t dir)
 {
-	return;
 }
 #else
 void __qdf_nbuf_unmap_single(qdf_device_t osdev, qdf_nbuf_t buf,
@@ -481,8 +481,6 @@
 	case CHECKSUM_NONE:
 		return QDF_NBUF_TX_CKSUM_NONE;
 	case CHECKSUM_PARTIAL:
-		/* XXX ADF and Linux checksum don't map with 1-to-1. This is
-		 * not 100% correct */
 		return QDF_NBUF_TX_CKSUM_TCP_UDP;
 	case CHECKSUM_COMPLETE:
 		return QDF_NBUF_TX_CKSUM_TCP_UDP_IP;
@@ -537,7 +535,6 @@
 void __qdf_nbuf_reg_trace_cb(qdf_nbuf_trace_update_t cb_func_ptr)
 {
 	qdf_trace_update_cb = cb_func_ptr;
-	return;
 }
 EXPORT_SYMBOL(__qdf_nbuf_reg_trace_cb);
 
@@ -1425,8 +1422,6 @@
 		gp_qdf_net_buf_track_tbl[i] = NULL;
 		spin_lock_init(&g_qdf_net_buf_track_lock[i]);
 	}
-
-	return;
 }
 EXPORT_SYMBOL(qdf_net_buf_debug_init);
 
@@ -1468,8 +1463,6 @@
 	if (count)
 		QDF_BUG(0);
 #endif
-
-	return;
 }
 EXPORT_SYMBOL(qdf_net_buf_debug_exit);
 
@@ -1553,8 +1546,6 @@
 	}
 
 	spin_unlock_irqrestore(&g_qdf_net_buf_track_lock[i], irq_flag);
-
-	return;
 }
 EXPORT_SYMBOL(qdf_net_buf_debug_add_node);
 
@@ -1610,8 +1601,6 @@
 	} else {
 		qdf_nbuf_track_free(p_node);
 	}
-
-	return;
 }
 EXPORT_SYMBOL(qdf_net_buf_debug_delete_node);
 
@@ -1724,6 +1713,7 @@
 	if (tso_info->ethproto == htons(ETH_P_IP)) { /* IPv4 */
 		/* for IPv4, get the IP ID and enable TCP and IP csum */
 		struct iphdr *ipv4_hdr = ip_hdr(skb);
+
 		tso_info->ip_id = ntohs(ipv4_hdr->id);
 		tso_info->ipv4_csum_en = 1;
 		tso_info->tcp_ipv4_csum_en = 1;
@@ -1857,8 +1847,6 @@
 		   tso_cmn_info->eit_hdr_len,
 		   curr_seg->seg.tso_flags.tcp_seq_num,
 		   curr_seg->seg.total_len);
-
-
 }
 
 /**
@@ -2329,7 +2317,6 @@
 __qdf_nbuf_unmap_nbytes_single(
 	qdf_device_t osdev, struct sk_buff *buf, qdf_dma_dir_t dir, int nbytes)
 {
-	return;
 }
 EXPORT_SYMBOL(__qdf_nbuf_unmap_nbytes_single);
 
@@ -2365,6 +2352,7 @@
 	int nbytes)
 {
 	struct skb_shared_info  *sh = skb_shinfo(skb);
+
 	qdf_assert((dir == QDF_DMA_TO_DEVICE) || (dir == QDF_DMA_FROM_DEVICE));
 
 	/*
@@ -2454,6 +2442,7 @@
 
 	for (int i = 1; i <= sh->nr_frags; i++) {
 		skb_frag_t    *f        = &sh->frags[i - 1];
+
 		sg->sg_segs[i].vaddr    = (uint8_t *)(page_address(f->page) +
 			f->page_offset);
 		sg->sg_segs[i].len      = f->size;
@@ -2503,6 +2492,7 @@
 {
 	struct skb_shared_info  *sh = skb_shinfo(nbuf);
 	const skb_frag_t *frag = sh->frags + cur_frag;
+
 	return skb_frag_size(frag);
 }
 EXPORT_SYMBOL(__qdf_nbuf_get_frag_size);
@@ -2534,9 +2524,9 @@
 	int offset, qdf_dma_dir_t dir, int cur_frag)
 {
 	dma_addr_t paddr, frag_len;
-
 	struct skb_shared_info *sh = skb_shinfo(nbuf);
 	const skb_frag_t *frag = sh->frags + cur_frag;
+
 	frag_len = skb_frag_size(frag);
 
 	QDF_NBUF_CB_TX_EXTRA_FRAG_PADDR(nbuf) = paddr =
@@ -2892,7 +2882,6 @@
 void __qdf_nbuf_reg_free_cb(qdf_nbuf_free_t cb_func_ptr)
 {
 	nbuf_free_cb = cb_func_ptr;
-	return;
 }
 
 /**
diff --git a/qdf/linux/src/qdf_perf.c b/qdf/linux/src/qdf_perf.c
index 4705aac..5fdf1c7 100644
--- a/qdf/linux/src/qdf_perf.c
+++ b/qdf/linux/src/qdf_perf.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -32,7 +32,7 @@
 
 #include <linux/version.h>
 #include <linux/kernel.h>
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
 #include <linux/fs.h>
 #include <linux/proc_fs.h>
 #include <linux/vmalloc.h>
diff --git a/qdf/linux/src/qdf_threads.c b/qdf/linux/src/qdf_threads.c
index 024b936..df82fbc 100644
--- a/qdf/linux/src/qdf_threads.c
+++ b/qdf/linux/src/qdf_threads.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -78,6 +78,7 @@
 void qdf_sleep_us(uint32_t us_interval)
 {
 	unsigned long timeout = usecs_to_jiffies(us_interval) + 1;
+
 	if (in_interrupt()) {
 		QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_ERROR,
 			  "%s cannot be called from interrupt context!!!",
diff --git a/qdf/linux/src/qdf_trace.c b/qdf/linux/src/qdf_trace.c
index 8f57ec0..c4271fa 100644
--- a/qdf/linux/src/qdf_trace.c
+++ b/qdf/linux/src/qdf_trace.c
@@ -159,7 +159,8 @@
 			QDF_TRACE_LEVEL_NONE;
 	else
 		/* set the desired bit in the bit mask for the module trace
-		 * level */
+		 * level
+		 */
 		g_qdf_trace_info[module].module_trace_level |=
 			QDF_TRACE_LEVEL_TO_MODULE_BITMASK(level);
 }
@@ -210,24 +211,28 @@
 	}
 
 	/* Treat 'none' differently.  NONE means we have to turn off all
-	   the bits in the bit mask so none of the traces appear */
+	 * the bits in the bit mask so none of the traces appear
+	 */
 	if (QDF_TRACE_LEVEL_NONE == level) {
 		g_qdf_trace_info[module].module_trace_level =
 			QDF_TRACE_LEVEL_NONE;
 	}
 	/* Treat 'All' differently.  All means we have to turn on all
-	   the bits in the bit mask so all of the traces appear */
+	 * the bits in the bit mask so all of the traces appear
+	 */
 	else if (QDF_TRACE_LEVEL_ALL == level) {
 		g_qdf_trace_info[module].module_trace_level = 0xFFFF;
 	} else {
 		if (on)
 			/* set the desired bit in the bit mask for the module
-			   trace level */
+			 * trace level
+			 */
 			g_qdf_trace_info[module].module_trace_level |=
 				QDF_TRACE_LEVEL_TO_MODULE_BITMASK(level);
 		else
 			/* clear the desired bit in the bit mask for the module
-			   trace level */
+			 * trace level
+			 */
 			g_qdf_trace_info[module].module_trace_level &=
 				~(QDF_TRACE_LEVEL_TO_MODULE_BITMASK(level));
 	}
@@ -381,6 +386,7 @@
 void qdf_trace_enable(uint32_t bitmask_of_module_id, uint8_t enable)
 {
 	int i;
+
 	if (bitmask_of_module_id) {
 		for (i = 0; i < QDF_MODULE_ID_MAX; i++) {
 			if (((bitmask_of_module_id >> i) & 1)) {
@@ -427,6 +433,7 @@
 void qdf_trace_init(void)
 {
 	uint8_t i;
+
 	g_qdf_trace_data.head = INVALID_QDF_TRACE_ADDR;
 	g_qdf_trace_data.tail = INVALID_QDF_TRACE_ADDR;
 	g_qdf_trace_data.num = 0;
@@ -773,7 +780,6 @@
 	g_qdf_dp_trace_data.proto_bitmap = proto_bitmap;
 	g_qdf_dp_trace_data.no_of_record = no_of_record;
 	g_qdf_dp_trace_data.verbosity    = verbosity;
-	return;
 }
 EXPORT_SYMBOL(qdf_dp_trace_set_value);
 
@@ -911,7 +917,6 @@
 			QDF_NBUF_CB_RX_DP_TRACE(nbuf) = 1;
 	}
 	spin_unlock_bh(&l_dp_trace_lock);
-	return;
 }
 EXPORT_SYMBOL(qdf_dp_trace_set_track);
 #if CONFIG_MCL
@@ -1166,6 +1171,7 @@
 {
 	struct qdf_dp_trace_record_s *rec = NULL;
 	int index;
+
 	spin_lock_bh(&l_dp_trace_lock);
 
 	g_qdf_dp_trace_data.num++;