浏览代码

qcacmn: add a new macro __qdf_alloc_size

In kernel 5.16, __alloc_size is defined in linux/compiler_types.h
file. So instead of calling this macro, define and use new macro
__qdf_alloc_size.

Change-Id: Ie1930bf2aaf0cb6bc079bc66aba9eeba92ec8c12
CRs-Fixed: 3295139
Rajesh Chauhan 2 年之前
父节点
当前提交
38b4da1cc9
共有 2 个文件被更改,包括 6 次插入4 次删除
  1. 2 1
      qdf/linux/src/i_qdf_talloc.h
  2. 4 3
      qdf/src/qdf_talloc.c

+ 2 - 1
qdf/linux/src/i_qdf_talloc.h

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2018-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. 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
@@ -40,7 +41,7 @@
 
 #define __free(ptr) kfree(ptr)
 
-#define __alloc_size(ptr) ksize(ptr)
+#define __qdf_alloc_size(ptr) ksize(ptr)
 
 #endif /* __I_QDF_TALLOC_H */
 

+ 4 - 3
qdf/src/qdf_talloc.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2018, 2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2022 Qualcomm Innovation Center, Inc. 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
@@ -64,7 +65,7 @@ __qdf_zalloc_auto(const size_t size, const char *func, const uint16_t line)
 		return NULL;
 	}
 
-	qdf_mem_kmalloc_inc(__alloc_size(ptr));
+	qdf_mem_kmalloc_inc(__qdf_alloc_size(ptr));
 
 	return ptr;
 }
@@ -80,14 +81,14 @@ __qdf_zalloc_atomic(const size_t size, const char *func, const uint16_t line)
 		return NULL;
 	}
 
-	qdf_mem_kmalloc_inc(__alloc_size(ptr));
+	qdf_mem_kmalloc_inc(__qdf_alloc_size(ptr));
 
 	return ptr;
 }
 
 static void __qdf_free(const void *ptr)
 {
-	qdf_mem_kmalloc_dec(__alloc_size(ptr));
+	qdf_mem_kmalloc_dec(__qdf_alloc_size(ptr));
 
 	__free(ptr);
 }