Lines Matching refs:res

96 	TEE_Result res = TEE_SUCCESS;  in test_read_init()  local
101 res = test_get_offs_size(type, idx, vers, &offs, &sz); in test_read_init()
102 if (res == TEE_SUCCESS) { in test_read_init()
110 return res; in test_read_init()
170 #define CHECK_RES(res, cleanup) \ argument
172 TEE_Result _res = (res); \
200 TEE_Result res = TEE_SUCCESS; in read_block() local
204 res = tee_fs_htree_read_block(ht, bn, b); in read_block()
205 if (res != TEE_SUCCESS) in read_block()
206 return res; in read_block()
225 TEE_Result res = TEE_SUCCESS; in do_range() local
229 res = fn(ht, n + begin, salt); in do_range()
230 CHECK_RES(res, goto out); in do_range()
234 return res; in do_range()
242 TEE_Result res = TEE_SUCCESS; in do_range_backwards() local
246 res = fn(ht, num_blocks - 1 - n + begin, salt); in do_range_backwards()
247 CHECK_RES(res, goto out); in do_range_backwards()
251 return res; in do_range_backwards()
259 TEE_Result res = TEE_SUCCESS; in htree_test_rewrite() local
269 res = tee_fs_htree_open(true, hash, uuid, &test_htree_ops, aux, &ht); in htree_test_rewrite()
270 CHECK_RES(res, goto out); in htree_test_rewrite()
276 res = do_range(write_block, &ht, 0, num_blocks, salt); in htree_test_rewrite()
277 CHECK_RES(res, goto out); in htree_test_rewrite()
279 res = do_range(read_block, &ht, 0, num_blocks, salt); in htree_test_rewrite()
280 CHECK_RES(res, goto out); in htree_test_rewrite()
287 res = do_range_backwards(write_block, &ht, 0, num_blocks, salt); in htree_test_rewrite()
288 CHECK_RES(res, goto out); in htree_test_rewrite()
290 res = do_range(read_block, &ht, 0, num_blocks, salt); in htree_test_rewrite()
291 CHECK_RES(res, goto out); in htree_test_rewrite()
298 res = do_range(write_block, &ht, 0, num_blocks, salt); in htree_test_rewrite()
299 CHECK_RES(res, goto out); in htree_test_rewrite()
301 res = do_range(read_block, &ht, 0, num_blocks, salt); in htree_test_rewrite()
302 CHECK_RES(res, goto out); in htree_test_rewrite()
308 res = tee_fs_htree_sync_to_storage(&ht, hash); in htree_test_rewrite()
309 CHECK_RES(res, goto out); in htree_test_rewrite()
311 res = do_range(read_block, &ht, 0, num_blocks, salt); in htree_test_rewrite()
312 CHECK_RES(res, goto out); in htree_test_rewrite()
318 res = tee_fs_htree_open(false, hash, uuid, &test_htree_ops, aux, &ht); in htree_test_rewrite()
319 CHECK_RES(res, goto out); in htree_test_rewrite()
324 res = do_range(read_block, &ht, 0, num_blocks, salt); in htree_test_rewrite()
325 CHECK_RES(res, goto out); in htree_test_rewrite()
331 res = do_range_backwards(write_block, &ht, w_unsync_begin, w_unsync_num, in htree_test_rewrite()
333 CHECK_RES(res, goto out); in htree_test_rewrite()
335 res = do_range(read_block, &ht, 0, w_unsync_begin, salt); in htree_test_rewrite()
336 CHECK_RES(res, goto out); in htree_test_rewrite()
337 res = do_range(read_block, &ht, w_unsync_begin, w_unsync_num, salt + 1); in htree_test_rewrite()
338 CHECK_RES(res, goto out); in htree_test_rewrite()
339 res = do_range(read_block, &ht, w_unsync_begin + w_unsync_num, in htree_test_rewrite()
341 CHECK_RES(res, goto out); in htree_test_rewrite()
347 res = do_range(write_block, &ht, w_unsync_begin, w_unsync_num, in htree_test_rewrite()
349 CHECK_RES(res, goto out); in htree_test_rewrite()
351 res = do_range(read_block, &ht, 0, w_unsync_begin, salt); in htree_test_rewrite()
352 CHECK_RES(res, goto out); in htree_test_rewrite()
353 res = do_range(read_block, &ht, w_unsync_begin, w_unsync_num, salt + 2); in htree_test_rewrite()
354 CHECK_RES(res, goto out); in htree_test_rewrite()
355 res = do_range(read_block, &ht, w_unsync_begin + w_unsync_num, in htree_test_rewrite()
357 CHECK_RES(res, goto out); in htree_test_rewrite()
366 res = tee_fs_htree_open(false, hash, uuid, &test_htree_ops, aux, &ht); in htree_test_rewrite()
367 CHECK_RES(res, goto out); in htree_test_rewrite()
369 res = do_range(read_block, &ht, 0, num_blocks, salt); in htree_test_rewrite()
370 CHECK_RES(res, goto out); in htree_test_rewrite()
378 res = tee_fs_htree_open(false, NULL, uuid, &test_htree_ops, aux, &ht); in htree_test_rewrite()
379 CHECK_RES(res, goto out); in htree_test_rewrite()
381 res = do_range(read_block, &ht, 0, num_blocks, salt); in htree_test_rewrite()
382 CHECK_RES(res, goto out); in htree_test_rewrite()
390 if (res == TEE_ERROR_TIME_NOT_SET) in htree_test_rewrite()
391 res = TEE_ERROR_SECURITY; in htree_test_rewrite()
392 return res; in htree_test_rewrite()
436 TEE_Result res = TEE_SUCCESS; in test_write_read() local
454 res = htree_test_rewrite(aux, n, m, o); in test_write_read()
455 CHECK_RES(res, goto out); in test_write_read()
463 return res; in test_write_read()
470 TEE_Result res = TEE_SUCCESS; in test_corrupt_type() local
478 res = test_get_offs_size(type, idx, 0, &offs, &size0); in test_corrupt_type()
479 CHECK_RES(res, return res); in test_corrupt_type()
489 res = test_get_offs_size(type, idx, 0, &offs, &size); in test_corrupt_type()
490 CHECK_RES(res, goto out); in test_corrupt_type()
492 res = test_get_offs_size(type, idx, 1, &offs, &size); in test_corrupt_type()
493 CHECK_RES(res, goto out); in test_corrupt_type()
501 res = tee_fs_htree_open(false, hash, uuid, &test_htree_ops, in test_corrupt_type()
503 if (!res) { in test_corrupt_type()
504 res = do_range(read_block, &ht, 0, num_blocks, 1); in test_corrupt_type()
516 if (res == TEE_ERROR_TIME_NOT_SET) { in test_corrupt_type()
518 res = TEE_ERROR_SECURITY; in test_corrupt_type()
521 if (!res) in test_corrupt_type()
541 if (res) { in test_corrupt_type()
542 res = TEE_SUCCESS; in test_corrupt_type()
545 res = TEE_ERROR_SECURITY; in test_corrupt_type()
550 return res; in test_corrupt_type()
559 TEE_Result res = TEE_SUCCESS; in test_corrupt() local
567 res = TEE_ERROR_OUT_OF_MEMORY; in test_corrupt()
575 res = tee_fs_htree_open(true, hash, uuid, &test_htree_ops, aux, &ht); in test_corrupt()
576 CHECK_RES(res, goto out); in test_corrupt()
577 res = do_range(write_block, &ht, 0, num_blocks, 1); in test_corrupt()
578 CHECK_RES(res, goto out); in test_corrupt()
579 res = tee_fs_htree_sync_to_storage(&ht, hash); in test_corrupt()
580 CHECK_RES(res, goto out); in test_corrupt()
584 res = tee_fs_htree_open(false, hash, uuid, &test_htree_ops, aux, &ht); in test_corrupt()
585 CHECK_RES(res, goto out); in test_corrupt()
586 res = do_range(read_block, &ht, 0, num_blocks, 1); in test_corrupt()
587 CHECK_RES(res, goto out); in test_corrupt()
590 res = test_corrupt_type(uuid, hash, num_blocks, aux, in test_corrupt()
592 CHECK_RES(res, goto out); in test_corrupt()
594 res = test_corrupt_type(uuid, hash, num_blocks, aux, in test_corrupt()
596 CHECK_RES(res, goto out); in test_corrupt()
599 res = test_corrupt_type(uuid, hash, num_blocks, aux, in test_corrupt()
601 CHECK_RES(res, goto out); in test_corrupt()
607 return res; in test_corrupt()
613 TEE_Result res = TEE_SUCCESS; in core_fs_htree_tests() local
618 res = test_write_read(10); in core_fs_htree_tests()
619 if (res) in core_fs_htree_tests()
620 return res; in core_fs_htree_tests()