Skip to content

Commit 3dda59a

Browse files
author
Jyri Sarha
committed
vregion: remove need to include rtos/alloc.h in !CONFIG_SOF_VREGIONS build
Remove need to include rtos/alloc.h in !CONFIG_SOF_VREGIONS build. We do not need the dummy vregion objects for anything, so get rid of them. From now on creating a vregion object when CONFIG_SOF_VREGIONS is not defined will fail. Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
1 parent 1f4b8f0 commit 3dda59a

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

src/include/sof/lib/vregion.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -125,29 +125,20 @@ void vregion_mem_info(struct vregion *vr, size_t *size, uintptr_t *start);
125125

126126
#else /* CONFIG_SOF_VREGIONS */
127127

128-
#include <rtos/alloc.h>
129-
130128
struct vregion {
131129
unsigned int use_count;
132130
};
133131

134132
static inline struct vregion *vregion_create(size_t lifetime_size, size_t interim_size)
135133
{
136-
struct vregion *vr = rmalloc(0, sizeof(*vr));
137-
138-
vr->use_count = 1;
139-
return vr;
134+
return NULL;
140135
}
141136
static inline struct vregion *vregion_get(struct vregion *vr)
142137
{
143-
if (vr)
144-
vr->use_count++;
145138
return vr;
146139
}
147140
static inline struct vregion *vregion_put(struct vregion *vr)
148141
{
149-
if (vr && !--vr->use_count)
150-
rfree(vr);
151142
return vr;
152143
}
153144
static inline void *vregion_alloc(struct vregion *vr, enum vregion_mem_type type, size_t size)

0 commit comments

Comments
 (0)