Lines Matching refs:ws
98 static void free_ws(struct wspace *ws) in free_ws() argument
100 if (!ws) in free_ws()
103 kfree(ws->errlocs); in free_ws()
104 kfree(ws->c); in free_ws()
105 kfree(ws); in free_ws()
111 struct wspace *ws; in alloc_ws() local
114 ws = kzalloc(sizeof(*ws), GFP_KERNEL); in alloc_ws()
115 if (!ws) in alloc_ws()
118 ws->c = kmalloc_array(2 * (nn + nroots), in alloc_ws()
120 if (!ws->c) in alloc_ws()
123 ws->r = ws->c + nn; in alloc_ws()
124 ws->s = ws->r + nn; in alloc_ws()
125 ws->corr = ws->s + nroots; in alloc_ws()
127 ws->errlocs = kmalloc_array(nn + nroots, sizeof(int), GFP_KERNEL); in alloc_ws()
128 if (!ws->errlocs) in alloc_ws()
131 ws->derrlocs = ws->errlocs + nn; in alloc_ws()
132 return ws; in alloc_ws()
135 free_ws(ws); in alloc_ws()
151 static int get_rcw_we(struct rs_control *rs, struct wspace *ws, in get_rcw_we() argument
155 int *derrlocs = ws->derrlocs; in get_rcw_we()
156 int *errlocs = ws->errlocs; in get_rcw_we()
159 uint16_t *c = ws->c; in get_rcw_we()
160 uint16_t *r = ws->r; in get_rcw_we()
262 struct wspace *ws, int method) in test_uc() argument
265 int *derrlocs = ws->derrlocs; in test_uc()
266 int *errlocs = ws->errlocs; in test_uc()
267 uint16_t *corr = ws->corr; in test_uc()
268 uint16_t *c = ws->c; in test_uc()
269 uint16_t *r = ws->r; in test_uc()
270 uint16_t *s = ws->s; in test_uc()
275 nerrs = get_rcw_we(rs, ws, len, errs, eras); in test_uc()
313 static int ex_rs_helper(struct rs_control *rs, struct wspace *ws, in ex_rs_helper() argument
331 test_uc(rs, len, errs, eras, trials, &stat, ws, method); in ex_rs_helper()
349 static int exercise_rs(struct rs_control *rs, struct wspace *ws, in exercise_rs() argument
360 retval |= ex_rs_helper(rs, ws, len, trials, i); in exercise_rs()
368 struct wspace *ws) in test_bc() argument
372 int *derrlocs = ws->derrlocs; in test_bc()
373 uint16_t *corr = ws->corr; in test_bc()
374 uint16_t *r = ws->r; in test_bc()
378 get_rcw_we(rs, ws, len, errs, eras); in test_bc()
407 static int exercise_rs_bc(struct rs_control *rs, struct wspace *ws, in exercise_rs_bc() argument
424 test_bc(rs, len, errs, eras, trials, &stat, ws); in exercise_rs_bc()
450 struct wspace *ws; in run_exercise() local
457 ws = alloc_ws(rsc->codec); in run_exercise()
458 if (!ws) in run_exercise()
475 retval |= exercise_rs(rsc, ws, len, e->ntrials); in run_exercise()
477 retval |= exercise_rs_bc(rsc, ws, len, e->ntrials); in run_exercise()
480 free_ws(ws); in run_exercise()