1 /*
2  * Copyright (c) 2020-2022 Huawei Device Co., Ltd.
3  *
4  * HDF is dual licensed: you can use it either under the terms of
5  * the GPL, or the BSD license, at your option.
6  * See the LICENSE file in the root of this repository for complete details.
7  */
8 
9 #include "hdf_host_info.h"
10 #include "osal_mem.h"
11 
HdfHostInfoNewInstance(void)12 struct HdfHostInfo *HdfHostInfoNewInstance(void)
13 {
14     return (struct HdfHostInfo *)OsalMemCalloc(sizeof(struct HdfHostInfo));
15 }
16 
HdfHostInfoFreeInstance(struct HdfHostInfo * hostInfo)17 void HdfHostInfoFreeInstance(struct HdfHostInfo *hostInfo)
18 {
19     if (hostInfo != NULL) {
20         OsalMemFree(hostInfo);
21     }
22 }
23 
HdfHostInfoDelete(struct HdfSListNode * listEntry)24 void HdfHostInfoDelete(struct HdfSListNode *listEntry)
25 {
26     struct HdfHostInfo *hostInfo = (struct HdfHostInfo *)listEntry;
27     if (hostInfo != NULL) {
28         HdfHostInfoFreeInstance(hostInfo);
29     }
30 }