staging: wilc1000: fix const cast warnings
[deliverable/linux.git] / drivers / staging / wilc1000 / wilc_memory.c
1
2 #include "wilc_oswrapper.h"
3
4 /*!
5 * @author syounan
6 * @date 18 Aug 2010
7 * @version 1.0
8 */
9 void *WILC_MemoryAlloc(WILC_Uint32 u32Size, tstrWILC_MemoryAttrs *strAttrs,
10 WILC_Char *pcFileName, WILC_Uint32 u32LineNo)
11 {
12 if (u32Size > 0) {
13 return kmalloc(u32Size, GFP_ATOMIC);
14 } else {
15 return WILC_NULL;
16 }
17 }
18
19 /*!
20 * @author syounan
21 * @date 18 Aug 2010
22 * @version 1.0
23 */
24 void *WILC_MemoryCalloc(WILC_Uint32 u32Size, tstrWILC_MemoryAttrs *strAttrs,
25 WILC_Char *pcFileName, WILC_Uint32 u32LineNo)
26 {
27 return kcalloc(u32Size, 1, GFP_KERNEL);
28 }
29
30 /*!
31 * @author syounan
32 * @date 18 Aug 2010
33 * @version 1.0
34 */
35 void *WILC_MemoryRealloc(void *pvOldBlock, WILC_Uint32 u32NewSize,
36 tstrWILC_MemoryAttrs *strAttrs, WILC_Char *pcFileName, WILC_Uint32 u32LineNo)
37 {
38 if (u32NewSize == 0) {
39 kfree(pvOldBlock);
40 return WILC_NULL;
41 } else if (pvOldBlock == WILC_NULL) {
42 return kmalloc(u32NewSize, GFP_KERNEL);
43 } else {
44 return krealloc(pvOldBlock, u32NewSize, GFP_KERNEL);
45 }
46
47 }
48
49 /*!
50 * @author syounan
51 * @date 18 Aug 2010
52 * @version 1.0
53 */
54 void WILC_MemoryFree(const void *pvBlock, tstrWILC_MemoryAttrs *strAttrs,
55 WILC_Char *pcFileName, WILC_Uint32 u32LineNo)
56 {
57 kfree(pvBlock);
58 }
This page took 0.068696 seconds and 5 git commands to generate.