Merge "[qca-nss-drv] Fix extra buffer structure in 64 bits build"
diff --git a/exports/nss_n2h.h b/exports/nss_n2h.h
index ea34e2a..8963490 100644
--- a/exports/nss_n2h.h
+++ b/exports/nss_n2h.h
@@ -129,10 +129,15 @@
 struct nss_n2h_buf_pool {
 	uint32_t nss_buf_page_size;	/**< Size of the buffer page. */
 	uint32_t nss_buf_num_pages;	/**< Number of buffer pages. */
-	void *nss_buf_pool_vaddr[MAX_PAGES_PER_MSG];
-			/**< Virtual addresses of the buffers. */
+
 	uint32_t nss_buf_pool_addr[MAX_PAGES_PER_MSG];
 			/**< Buffer addresses. */
+	nss_ptr_t nss_buf_pool_vaddr[MAX_PAGES_PER_MSG];
+			/**< Virtual addresses of the buffers. */
+#ifndef __LP64__
+	uint32_t padding[MAX_PAGES_PER_MSG];
+			/* Pad to fit 64bits, do not reuse */
+#endif
 };
 
 /**
diff --git a/nss_n2h.c b/nss_n2h.c
index 1223c7d..1bb8d68 100644
--- a/nss_n2h.c
+++ b/nss_n2h.c
@@ -1228,7 +1228,7 @@
 {
 	int page_count;
 	for (page_count = 0; page_count < buf_pool->nss_buf_num_pages; page_count++) {
-		kfree(buf_pool->nss_buf_pool_vaddr[page_count]);
+		kfree((void *)buf_pool->nss_buf_pool_vaddr[page_count]);
 	}
 }
 
@@ -1268,7 +1268,7 @@
 			}
 
 			kmemleak_not_leak(kern_addr);
-			buf_pool->nss_buf_pool_vaddr[page_count] = kern_addr;
+			buf_pool->nss_buf_pool_vaddr[page_count] = (nss_ptr_t)kern_addr;
 			buf_pool->nss_buf_pool_addr[page_count] = dma_map_single(nss_ctx->dev, kern_addr, PAGE_SIZE, DMA_TO_DEVICE);
 		}