Skip to content

Commit 5108356

Browse files
committed
Fix level_zero_helpers.cpp
Fix level_zero_helpers.cpp: - make local functions static - initialize level_zero_init_flag with UTIL_ONCE_FLAG_INIT Signed-off-by: Lukasz Dorau <[email protected]>
1 parent 87b1348 commit 5108356

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/providers/level_zero_helpers.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,17 +306,18 @@ static int init_level_zero_lib(void) {
306306
return 0;
307307
}
308308

309-
UTIL_ONCE_FLAG level_zero_init_flag;
310-
int InitResult;
311-
void init_level_zero_once() {
309+
static UTIL_ONCE_FLAG level_zero_init_flag = UTIL_ONCE_FLAG_INIT;
310+
static int InitResult;
311+
312+
static void init_level_zero_once(void) {
312313
InitResult = InitLevelZeroOps();
313314
if (InitResult != 0) {
314315
return;
315316
}
316317
InitResult = init_level_zero_lib();
317318
}
318319

319-
int init_level_zero() {
320+
static int init_level_zero(void) {
320321
utils_init_once(&level_zero_init_flag, init_level_zero_once);
321322

322323
return InitResult;

0 commit comments

Comments
 (0)